Metadata-Version: 2.5
Name: agilerl
Version: 3.0.0
Summary: Train and deploy specialized agents on Arena, AgileRL's post-training platform, from your terminal.
Project-URL: Homepage, https://agilerl.com
Project-URL: Documentation, https://docs.arena.agilerl.com/
Project-URL: Repository, https://github.com/AgileRL/AgileRL
Project-URL: Issues, https://github.com/AgileRL/AgileRL/issues
Author-email: AgileRL <dev@agilerl.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: agilerl,arena,llm,reinforcement learning,rlhf
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: <3.15,>=3.10
Requires-Dist: click>=8.3.0
Requires-Dist: cryptography>=42
Requires-Dist: httpx<1,>=0.27
Requires-Dist: lazy-loader>=0.4
Requires-Dist: packaging>=20.0
Requires-Dist: pydantic<3,>=2.0
Requires-Dist: python-keycloak<8,>=4.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich<16,>=13.0
Requires-Dist: typing-extensions>=4.4
Description-Content-Type: text/markdown

<p align="center">
  <img src="https://raw.githubusercontent.com/AgileRL/AgileRL/main/.github/images/agilerl-logo.png" alt="AgileRL" width="480">
</p>

<p align="center"><b>Train and deploy specialized agents on <a href="https://arena.agilerl.com">Arena</a>, straight from your terminal.</b></p>

`agilerl` is the command-line tool and Python SDK for Arena, AgileRL's post-training platform.

## What is Arena?

Arena turns open-weight LLMs and VLMs into task-specific agents. It covers supervised fine-tuning, preference tuning, distillation from a teacher model, and single- and multi-turn reinforcement learning, then serves the trained agent for inference.

You don't tune the infrastructure. Arena sizes every job itself, working out the most efficient training setup for the compute you have. Train on our GPUs or bring your own cluster.

Bring your own data and tasks. Upload your own datasets, or recorded conversations with tool calls to train on. For reinforcement learning, upload your own environment as Python code or a package: Arena runs any environment that follows the OpenEnv `reset` / `step` API, and converts gym-style environments for you.

It's fast, too: in our [benchmarks](https://agilerl.com/blog/arena-finishes-awm-in-11-hours), Arena trains faster than the leading open-source RL libraries.

<picture>
  <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/AgileRL/AgileRL/main/.github/images/awm-scatter-hours-dark.png">
  <img src="https://raw.githubusercontent.com/AgileRL/AgileRL/main/.github/images/awm-scatter-hours.png" alt="Held-out eval accuracy against training hours on the AWM benchmark: Arena reaches 42.2 in about 12 hours; Prime-RL 33.9, Miles 23.7 and ART 17.5 were stopped after 48 hours, TRL 21.9 and verl 16.6 took over 30." width="100%">
</picture>

## What the CLI gives you

- **Experiments as code.** Describe a run in a YAML manifest, keep it in git, and launch it with `arena experiments submit`.
- **Know before you spend.** `arena memory estimate` tells you whether a run fits your GPUs before you launch it, and `arena memory solve max_model_len` finds the longest context you can train at.
- **Check your inputs.** `arena env validate` tests your environment before any GPU time is used.
- **The whole platform from your shell.** Create projects and datasets, list GPU types, track experiments and checkpoints, register your own cluster, and generate client code for a deployed agent.
- **A Python SDK.** Use `from agilerl import ArenaClient` in scripts, notebooks and CI.

## Install

```bash
uv tool install agilerl
```

This installs the `arena` command in its own environment. To use the Python SDK (`from agilerl import ArenaClient`) in a project, run `uv add agilerl` instead. `pip install agilerl` also works.

`agilerl` supports Python 3.10 to 3.14. To train inside your own Snowflake account, use the Arena Native App from the Snowflake Marketplace.

## Quickstart

Log in once, then submit an experiment from a manifest:

```bash
arena login
arena experiments submit manifest.yaml
```

Writing a manifest, preparing datasets and environments, and deploying your agent are all covered in the [Arena docs](https://docs.arena.agilerl.com/).

## Docs

The [Arena CLI guide](https://docs.arena.agilerl.com/cli) covers every command, or you can run `arena --help` to see them in your terminal.

## Migrating from `agilerl-arena`

Uninstall `agilerl-arena` the way you installed it, then install `agilerl`. Both packages ship the `arena` command, so uninstalling `agilerl-arena` removes it.

If you installed it with pip:

```bash
pip uninstall -y agilerl-arena
pip install -U --force-reinstall agilerl
```

`--force-reinstall` puts the `arena` command back even when `agilerl` is already installed, for example after the CLI upgraded itself.

If you installed it as a uv tool:

```bash
uv tool uninstall agilerl-arena
uv tool install agilerl
```

If `uv tool install` says `arena` already exists, for example from a pip install, add `--force`.

Then change your imports from `agilerl.arena.*` to `agilerl.*`, for example `from agilerl import ArenaClient`.

## Looking for the AgileRL framework?

Before 3.0, `agilerl` was our open-source reinforcement learning framework. From 3.0, `agilerl` is the Arena CLI, and installing it replaces the framework in the same environment. To keep using the framework, install it in a separate virtualenv:

```bash
python -m venv .venv-agilerl2
.venv-agilerl2/bin/pip install 'agilerl<3'
```

With uv: `uv venv .venv-agilerl2 && uv pip install --python .venv-agilerl2 'agilerl<3'`.

To downgrade an environment that already has `agilerl` 3, reinstall `agilerl-arena` 1.x afterwards. Both it and `agilerl` 3 ship the `arena` command, and removing `agilerl` 3 deletes it:

```bash
python -m pip install 'agilerl<3' && python -m pip install --force-reinstall --no-deps 'agilerl-arena<2'
```

Run it with that environment's `python`. With uv, name the environment: `uv pip install --python .venv 'agilerl<3' && uv pip install --python .venv --reinstall --no-deps 'agilerl-arena<2'`.

The 2.x releases are in the [PyPI release history](https://pypi.org/project/agilerl/#history), and their source is under the `v2.*` [tags on GitHub](https://github.com/AgileRL/AgileRL/tags).

## License and help

`agilerl` is licensed under Apache 2.0 (see [LICENSE](https://github.com/AgileRL/AgileRL/blob/main/LICENSE)). Report bugs and ask questions in [GitHub issues](https://github.com/AgileRL/AgileRL/issues).
