agilerl-arena
agilerl-arena is the standalone Arena SDK + CLI package for AgileRL.
It provides:
- Python client for Arena workflows (auth, environment validation, experiment submission, deployment, inference)
arenaCLI for scripting and CI usage- The training manifest schema (
agilerl.arena.models): the Pydantic models every runtime trains from, plusarena manifest validateandarena manifest schema
This package is distributed independently from core agilerl, but exposes modules through the shared namespace:
from agilerl.arena import ArenaClient, Agent
from agilerl.arena.models import TrainingManifest
Core agilerl re-exports those models and adds only what a local run needs (environment construction, a buildable replay buffer).
Installation
Install the SDK and CLI on their own (no torch):
pip install agilerl-arena
Core agilerl depends on this package, so pip install agilerl includes it.
Quickstart
1) Authenticate
Preferred for CI/automation:
export ARENA_API_KEY="arena_pat_..."
Or interactive login:
arena login
2) Validate a training manifest
arena manifest validate path/to/manifest.yaml
arena manifest schema
3) Validate an environment
arena env validate my-env --source path/to/my_env.py
4) Check GPU memory (LLM manifests)
arena memory estimate path/to/manifest.yaml --gpu "NVIDIA L4"
# An unset engine width or max_num_seqs is resolved from the node's GPUs:
arena memory estimate path/to/manifest.yaml --gpu "NVIDIA L4" --num-gpus 4
# Longest context one dedicated L4 serving GPU can hold:
arena memory solve max_model_len --inference --gpu "NVIDIA L4" \
--model Qwen/Qwen2.5-7B-Instruct
estimate is a pre-submission gate (exit 0 fits, 3 over budget, 2 usage error).
solve holds every other input fixed and returns the largest value of one
field. Install agilerl-arena[hub] unless you pass --config path/to/config.json.
See agilerl/arena/memory/README.md.
5) Submit a training manifest
arena experiments submit path/to/manifest.yaml --project my-project
# Ask for GPUs instead of a node type; Arena uses the fewest nodes:
arena experiments submit path/to/manifest.yaml --project my-project \
--num-gpus 8 --gpu-type h100-80
Without --resource-id, --num-nodes, --num-gpus or --gpu-type, Arena
picks the cheapest resource that fits. The GPU flags can't be combined with
--resource-id / --num-nodes.
Python SDK example
from agilerl.arena import ArenaClient
from agilerl.arena.models import TrainingManifest
client = ArenaClient() # uses ARENA_API_KEY if set
TrainingManifest.get_validated("dqn.yaml")
client.validate_environment(
source="acrobot.py",
name="acrobot-env",
)
result = client.submit_experiment(
manifest="dqn.yaml",
resource_id="arena-medium",
project="my-project",
)
print(result)
Inference example
from agilerl.arena import Agent
agent = Agent("https://<deployment-id>.inference.agilerl.com", api_key="arena_pat_...")
action, _ = agent.get_action(observation)
Use the deployment URL from arena agent list.
Notes on packaging and imports
- Distribution name:
agilerl-arena - Python import namespace:
agilerl.arena - CLI command:
arena
agilerl-arena and agilerl intentionally share the agilerl.* namespace as separate packages.
BYOC cluster registration
Register a customer Kubernetes cluster against Arena (enterprise BYOC v1) and write Helm values files locally. Re-running with the same cluster name updates the existing registration (upsert) instead of creating a duplicate.
arena cluster register --name my-cluster \
--storage-endpoint http://s3.corp.example.com:9000 \
--storage-bucket arena-prod \
--storage-secret-name corp-s3
--agent-namespace (default arena) is the namespace for the agent Helm
release. With --install, the release is named after the cluster (--name),
unless arena-byoc-agent is already installed in that namespace. The chart
names its ClusterRoles after the release, so per-cluster release names let two
Arena agents share one Kubernetes cluster without colliding.
Without --no-write, the CLI writes into --output-dir (default
./arena-cluster-<name>):
agent-helm-values.yamlstorage-helm-values.yaml, when Arena returns bundled MinIO valuescluster-token.txt, mode 0600
Bundled MinIO is optional. --lab is shorthand for --install-storage --narrow-allowed-ips:
arena cluster register --name lab-cluster --install --lab --no-write
The first --install-storage installs MinIO in the storage namespace. Later
upserts reuse that Secret and do not reinstall the storage chart. Before
installing the agent chart, the CLI copies the storage Secret into the agent
namespace and creates that namespace if it is missing.
Register enables the BYOC provider unless you pass --skip-enable. Requires an
Arena server with the enterprise BYOC cluster register API.
Lifecycle
arena cluster unregister --name my-cluster removes the Arena registration.
--uninstall-helm also uninstalls the agent chart. Bundled MinIO
(arena-byoc-storage) stays unless you pass --uninstall-storage.
arena cluster rotate-token --name my-cluster rotates the Arena cluster token
and writes it into the in-cluster Secret, then restarts the agent Deployment
Helm found for that cluster. The Secret name comes from
existingClusterTokenSecret in the agent Helm values, and is cluster-token
otherwise. Pass --agent-namespace when Helm lists more than one agent install.
Both commands resolve a kubeconfig in this order: --kubeconfig,
./arena-cluster-<name>/kubeconfig, KUBECONFIG, ~/.kube/config. They find
Helm releases with helm list --all-namespaces, preferring a release named
after the cluster and falling back to arena-byoc-agent.
Cloud cluster provisioning
arena cluster can provision a Kubernetes cluster with a packaged
Terraform module, then register and install the Arena Helm agent. Nebius is the
first supported provider.
Install Terraform and the Nebius CLI, then generate a spec and fill in the cloud IDs:
arena cluster generate-spec --output nebius-cluster.yaml
After provision, the CLI runs nebius mk8s cluster get-credentials using the
Terraform cluster_id output and writes ./arena-cluster-<name>/kubeconfig.
By default it also installs Gateway API v1.6.0 CRDs, enables Cilium Gateway
API (enable-gateway-api: "true"), and creates an arena Gateway in the
arena namespace with wildcard HTTP and HTTPS listeners for
*.<inference.domain>. Set arena.inference.domain in the cluster spec and
optionally arena.inference.hostname_template for the host part (default
inference-{deploymentId}). Registration passes domain and hostname template separately to
Arena and the agent Helm values.
Provisioning also creates a Nebius access key for the <name>-storage service
account and writes it to the arena.storage.secret_name Secret in the
arena namespace (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, endpoint),
which the agent, Ray, and inference charts read. --agent-namespace (default
arena) sets where --register-and-install installs the agent chart. With
arena.storage.install: true the MinIO chart creates that Secret
instead. register and --register-and-install also create a GPU resource
class per nebius.workers entry, named <cluster>-<worker.name>, with node selector
nebius.com/node-group-id set to that provisioned worker node group. On AWS,
one class is created per aws.workers entry with num_gpus greater than 0,
selected by eks.amazonaws.com/nodegroup. CPU, GPU count, and memory are the
machine size from the worker preset or instance. VRAM per GPU
(gramPerGpu, required by Arena's GPU experiment cascade) comes from
each worker's platform.
arena holds settings that are the same on every cloud: storage, inference,
gateway, and workload scheduling. nebius or aws holds that cloud's
resources. cluster register --spec and provision --register-and-install
both read arena. Set arena.storage.install: true to install the bundled
MinIO Helm chart (lab profile). arena.storage.secret_name defaults to
arena-storage in that case, and storage otherwise. Values in explicit
command-line flags override the YAML spec.
Before plan / provision / destroy, the Nebius Terraform provider needs
credentials. Either export a service-account authorized key:
export SA_ID="serviceaccount-..."
export AUTHKEY_PUBLIC_ID="publickey-..."
export AUTHKEY_PRIVATE_PATH="$HOME/.nebius/authorized_key.pem"
export NEBIUS_CLI="$HOME/.nebius/bin/nebius"
or omit SA_ID and authenticate as your Nebius CLI user. In that case set
nebius.service_account_id to an existing account, or leave it unset to
create a service account named arena, add it to the tenant admins group,
and attach it to the cluster node groups.
arena cluster plan --spec nebius-cluster.yaml
arena cluster provision --spec nebius-cluster.yaml
KUBECONFIG=./arena-cluster-arena-nebius/kubeconfig \
arena cluster register --spec nebius-cluster.yaml --install
Use --register-and-install on provision to run the last command
automatically. After the cluster is registered, add GPU sizes from the
Nebius project:
arena cluster register-classes --spec nebius-cluster.yaml --all
arena cluster register-classes --spec nebius-cluster.yaml \
--preset gpu-h100-sxm:8gpu-128vcpu-1600gb \
--preset gpu-h200-sxm:1gpu-16vcpu-200gb
--all registers every GPU preset. Repeat --preset platform:preset to
register some of them. With neither flag, the CLI prints the list and asks
which to register. The class CPU and memory are that preset's machine size.
A worker's register_node_group defaults to false, so the class is registered
without creating a Nebius node group. That class selects
nebius.com/platform and nebius.com/preset. gpu.type is the platform and
gpu.count matches the preset. Set register_node_group: true on that
worker, or pass --register-node-group, to append a missing preset to
nebius.workers (min size 0) and apply Terraform before the class is created.
The class then selects nebius.com/node-group-id.
If a class with that name already exists and differs, the CLI prints the diff
and asks before updating it. --yes applies the update.
terraform_state.bucket is required. It must be a dedicated
Object Storage bucket, not the experiment-data bucket. plan / provision
look it up with the Nebius CLI. If it is missing, set
terraform_state.create_bucket: true or pass --create-state-bucket
(or confirm the prompt) to create it, a service account, and an access key.
Keys are written to ./arena-cluster-<name>/tfstate-credentials.json and used
as AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY for the Terraform S3 backend.
On AWS, provisioning creates an IAM user named <name>-tfstate, allows it only
on that bucket, and writes the same file. Only the S3 backend uses these keys
(through a profile file in the Terraform directory); the AWS provider keeps
your own credentials. If the file is lost, a new key is
created on that user.
If that file is gone, the keys are fetched again from the Nebius access key
named <name>-tfstate. When the spec omits nebius.project_id or
nebius.storage_project_id, register, plan, provision, status, and
destroy load them from the cluster stored in Arena, then fetch those keys.
arena cluster destroy --name <cluster> does this without a spec file.
Terraform module files default to ./arena-cluster-<name>/terraform; pass
--state-dir to keep them elsewhere.
Module versions
The .tf files are a versioned module, arena-cluster-aws or
arena-cluster-nebius. This CLI implements orchestration contracts aws.v1
and nebius.v1: the order of applies, the variables it writes, and the
outputs it reads. A module release can change resources inside that contract.
A new phase or a new required variable is a new contract and needs a new CLI.
Each release is MAJOR.MINOR.PATCH. The wheel bundles 1.0.0. A cluster
pins the release in ./arena-cluster-<name>/module.json and, after register,
under byocProvider.config.module (name, version, digest,
orchestration). Plan, apply, and destroy keep using that pin. Set
module_version in the spec, or pass --module-version, to choose a release
for a new cluster. --module-version on an existing pin is the upgrade.
plan first. A spec version that disagrees with the pin stops the command.
--module-catalog-url points at a catalog. --module-catalog-public-key is
the Ed25519 PEM that signed it. The CLI checks index.json.sig and
manifest.json.sig, then the sha256 digest of the module files (not the
tarball). A yanked release is skipped for new clusters and still downloads
for a pin. If the catalog cannot be reached and the cluster has no pin, the
CLI uses the bundled module. A requested version that is not bundled needs
the catalog.
The catalog layout is:
modules/aws/index.json
modules/aws/index.json.sig
modules/aws/1.0.0/manifest.json
modules/aws/1.0.0/manifest.json.sig
modules/aws/1.0.0/module.tar.gz
manifest.json carries schema 1, name, provider, version,
orchestration, terraform_version, archive, digest, and files.
The tarball contains those files and nothing else. It does not contain
backend.tf. The Nebius module does not contain provider.tf; the CLI
writes both at run time. Credentials and state stay on the machine that
runs Terraform. The catalog never sees them.
aws.v1 applies aws_eks_cluster.arena, installs Cilium, then applies the
rest. It keeps the experiment bucket and its IAM user unless
--delete-storage is set. nebius.v1 has no Cilium phase. Destroy leaves
the Nebius projects to finish_destroy, and keeps object storage unless
--delete-storage is set.
terraform_state:
bucket: arena-nebius-tfstate
# key: clusters/arena-nebius/terraform.tfstate
Provisioning uses two Nebius projects. nebius.project_id holds the cluster,
VPC, subnet, and shared filesystem. nebius.storage_project_id holds the
experiment bucket, its IAM, and the Terraform state bucket. Omit either one and
Terraform creates it, which makes nebius.region required.
destroy deletes the Kubernetes cluster and asks for confirmation. It deletes
the compute project when provisioning created it, and always keeps the storage
project. The experiment-data bucket is never deleted unless you pass
--delete-storage. --delete-storage-project also deletes the Terraform state
bucket and the storage project, and only works when provisioning created that
project. Otherwise the CLI asks whether to delete this cluster's Terraform state
object and keeps the state bucket. --yes skips prompts and keeps the state
object. The next provision imports the existing experiment bucket instead of
creating a new one.
arena cluster destroy --spec nebius-cluster.yaml
arena cluster destroy --spec nebius-cluster.yaml --delete-storage
arena cluster destroy --spec nebius-cluster.yaml --delete-storage-project
destroy does not uninstall the BYOC Helm releases. Use arena cluster unregister --name <name> --uninstall-helm for that.
More CLI commands are in the published Arena docs and arena --help.
Metadata
Release files for agilerl-arena 1.34.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agilerl_arena-1.34.0.tar.gz | 429.8 kB | Without provenance | Details for agilerl_arena-1.34.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agilerl_arena-1.34.0-py3-none-any.whl | Python 3 | none | any | Details for agilerl_arena-1.34.0-py3-none-any.whl |
Total release size: 965.4 kB
Release files / agilerl_arena-1.34.0.tar.gz
| Download URL | agilerl_arena-1.34.0.tar.gz |
|---|---|
| Size | 429.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd62621a9f53d44748b11d59edb0870fc9877670c1888d9a5a07b21f2360f2c7
|
|
BLAKE2b-256 checksum How to use checksums |
abf9bcefb3b11d2f56460163db9486e6e3f14f53910ea5ea65b2b58c21922120
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / agilerl_arena-1.34.0-py3-none-any.whl
| Download URL | agilerl_arena-1.34.0-py3-none-any.whl |
|---|---|
| Size | 535.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3b80ca647aa37c89e9a1297d676864fd1f5d88fecbfb3ba1bdb868741fc99acd
|
|
BLAKE2b-256 checksum How to use checksums |
d0d621a6d2e6a4ab0965b903653b7f23d72417d28ffe2dec73a8fa7cd9ab74a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for agilerl-arena 1.34.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.