Registry / ai-ml / beaker-py

beaker-py

JSON →
library2.7.0pypypi✓ verified 85d ago

beaker-py is a lightweight, standalone, pure Python client for the Beaker platform, which is a machine learning experiment and dataset management system. It provides an RPC-based client to interact with Beaker servers. The library is actively maintained, with its latest version being 2.6.0, and follows a continuous release cadence.

pip install beaker-py
INSTALL
IMPORT
SIG · BEAKER-PY
B
beaker-py
ai-mlpythonv2.7.0
Install
5.7s avg
Import
1852ms
Disk
69MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.7.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 2.250s · 70.3MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 5.7s · import 1.453s · 68MB
69MB installed
● package 69MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Beaker
from beaker import Beaker

The quickstart demonstrates initializing the Beaker client using `Beaker.from_env()`, which automatically picks up configuration from `~/.beaker/config.yml` or the `BEAKER_TOKEN` environment variable. It then attempts to list datasets within a specified workspace.

import os from beaker import Beaker # Ensure BEAKER_TOKEN environment variable is set or a ~/.beaker/config.yml exists # Example: export BEAKER_TOKEN="your_beaker_user_token" # Or, for a quick demonstration without a real token (will likely fail auth): # os.environ['BEAKER_TOKEN'] = os.environ.get('BEAKER_TOKEN', 'dummy-token-for-example') try: # Instantiate the Beaker client, optionally specifying a default workspace with Beaker.from_env(default_workspace="your_org/your_workspace") as beaker: # Example: List datasets (requires proper auth and workspace) print(f"Beaker client initialized for workspace: {beaker.workspace.current.name}") datasets = beaker.dataset.list() if datasets: print(f"Found {len(datasets)} datasets, e.g., {datasets[0].name}") else: print("No datasets found or unable to list.") except Exception as e: print(f"Failed to interact with Beaker: {e}") print("Please ensure BEAKER_TOKEN is set or ~/.beaker/config.yml is configured correctly.")
Debug
Known issues
breakingVersion 2.x introduces significant breaking changes from version 1.x. The project codebase and documentation location also moved. Old imports and API calls from `beaker-py<2.0` will not work with `beaker-py>=2.0`.
fix
Consult the official v1 -> v2 migration guide (beaker-py-docs.allen.ai) for detailed steps. Ensure your `pip install` command is specific if you need version 1, e.g., `pip install 'beaker-py<2.0'`.
affects: >=2.0.0
gotchaAuthentication and configuration are critical. The client relies on a `BEAKER_TOKEN` environment variable or a configuration file at `~/.beaker/config.yml`. Without proper credentials, most operations will fail with authentication or permission errors.
fix
Set the `BEAKER_TOKEN` environment variable to your Beaker user token or configure `~/.beaker/config.yml` as per Beaker CLI instructions. Use `Beaker.from_env()` for automatic configuration loading.
affects: All
gotchaDo not confuse `beaker-py` (client for AllenAI's Beaker platform) with the `beaker` library (a session and caching library). They are distinct projects with different purposes and APIs.
fix
Always use `pip install beaker-py` and `from beaker import Beaker` when targeting the Beaker platform client. Verify the GitHub repository (allenai/beaker) if in doubt.
affects: All
Errors
Common errors & fixes
Failed to interact with Beaker: BeakerPermissionsError: User does not have permission...
The authenticated user lacks the necessary permissions for the requested operation or resource.
fix
Check the permissions for your Beaker user token or the configured user within the Beaker platform. Ensure the default workspace specified has the correct access rights for your user.
Failed to interact with Beaker: BeakerConfigurationError: No Beaker configuration file found at ... or BEAKER_TOKEN environment variable set.
The Beaker client could not find valid authentication credentials.
fix
Set the `BEAKER_TOKEN` environment variable, e.g., `export BEAKER_TOKEN="your_token"`, or ensure a valid `~/.beaker/config.yml` file exists with your Beaker configuration.
Failed to interact with Beaker: BeakerWorkspaceNotFound: Workspace 'your_org/non_existent_workspace' not found.
The specified Beaker workspace either does not exist or the authenticated user does not have access to it.
fix
Verify the exact name or ID of the workspace in the Beaker UI or CLI. Ensure your `BEAKER_TOKEN` grants access to this specific workspace.
Upgrade
Version history
2.7.0latest on PyPI · released May 27, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
22
OpenAI (training)
1
Resources
beaker-py — pip install beaker-py · libregistry