Skip to main content

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)
  • arena CLI for scripting and CI usage
  • The training manifest schema (agilerl.arena.models): the Pydantic models every runtime trains from, plus arena manifest validate and arena 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 the training run fits on an L4:
arena memory solve max_model_len path/to/manifest.yaml --gpu "NVIDIA L4"

estimate is a pre-submission gate (exit 0 fits, 3 over budget, 2 usage error). solve holds the rest of the manifest fixed and returns the largest max_model_len that fits. For a model outside the Arena catalog, install agilerl-arena[hub] or 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 Kubernetes cluster against Arena (enterprise BYOC) and write Helm values files locally. Re-running with the same cluster name updates the existing registration (upsert) instead of creating a duplicate. --byoc-scope is customer (the default when omitted) or platform. A platform cluster shares the Arena catalog and bucket and needs a platform admin. Choosing platform uses ephemeral placement unless --placement is set, or the spec already sets both scope and placement.

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.yaml
  • storage-helm-values.yaml, when Arena returns bundled MinIO values
  • cluster-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.39.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agilerl-arena 1.39.2
File Size Uploaded Provenance Actions
agilerl_arena-1.39.2.tar.gz 576.6 kB Without provenance Details for agilerl_arena-1.39.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agilerl-arena 1.39.2
File Interpreter ABI Platform Actions
agilerl_arena-1.39.2-py3-none-any.whl Python 3 none any Details for agilerl_arena-1.39.2-py3-none-any.whl

Total release size: 1.3 MB

Release files / agilerl_arena-1.39.2.tar.gz

Download URL agilerl_arena-1.39.2.tar.gz
Size 576.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f84c827385e4a13084a914818054f3e53938bf6d7092dedc082b563986264620
BLAKE2b-256 checksum
How to use checksums
2d05889f46eb341d6186d4e4c9b74e4243f4094e043f32eb652ccad71a41d3c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.39.2-py3-none-any.whl

Download URL agilerl_arena-1.39.2-py3-none-any.whl
Size 706.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38d40e37964a623736490ffe400897ef88aef7371481969985c31187bf73077b
BLAKE2b-256 checksum
How to use checksums
94033fd5aad8555291fbb125987ac64b27d385cb8b6ef582b0078caaa58fb9e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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.39.2

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.

Release history Release notifications | RSS feed

This release

1.39.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page