Metadata-Version: 2.4
Name: fair-agentbox
Version: 0.0.0
Summary: A distributed container orchestrator for AI agents
Author: AgentBox contributors
License-Expression: Apache-2.0
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torchmonarch>=0.7.0
Requires-Dist: cloudpickle>=3.0.0
Provides-Extra: dev
Requires-Dist: ruff-api==0.2.1; extra == "dev"
Requires-Dist: stdlibs==2025.10.28; extra == "dev"
Requires-Dist: ufmt==2.9.1; extra == "dev"
Requires-Dist: usort==1.1.0; extra == "dev"
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-timeout>=2.0.0; extra == "dev"
Requires-Dist: ruff<0.16,>=0.15; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: psutil>=5.9.0; extra == "dev"
Dynamic: license-file

# AgentBox

> [!WARNING]
> AgentBox is under construction. APIs, behavior, and documentation may
> change without notice.

AgentBox is a distributed container orchestrator for AI agents. It is built for
researchers studying multi-agent systems on high-performance computing (HPC)
clusters without requiring root access. It was originally built at Meta FAIR to [study research agents](https://arxiv.org/abs/2603.26499) and has since
been refactored and improved. AgentBox uses
[Apptainer](https://apptainer.org/) to isolate agents from each other and from accessing privileged test sets. AgentBox leans on
[Monarch](https://github.com/meta-pytorch/monarch) to coordinate agent containers.

> **Supported platforms:** Linux (local and [Slurm](https://slurm.schedmd.com/overview.html)). macOS works for local
> workers; containers on macOS run through a
> [Lima-backed Apptainer](docs/installation.md#macos). Windows is not
> supported.

## Quick start

Requires Python 3.12+. Containers additionally need `apptainer` on the worker.

```bash
pip install -e .
```

```python
from agentbox import AgentBoxManager, Container

with AgentBoxManager.create_local(num_workers=1) as manager:
    with manager.acquire_machine() as machine:
        print(machine.run("uname -a").stdout)  # on the worker host

        with Container(machine, image="docker://python:3.12-slim") as box:
            result = box.run(["python3", "-c", "print('hello from a container')"])
            print(result.stdout)
```

To run on Slurm instead, replace the manager:

```python
from agentbox import AgentBoxManager, SlurmAllocation

manager = AgentBoxManager.create_slurm(
    allocation=SlurmAllocation(partition="cpu", cpus_per_task=8),
    num_workers=16,
)
manager.wait_for_workers(min_available=16)
```

## Documentation

- [Installation](docs/installation.md)
- [Core concepts](docs/concepts.md)
- [Containers](docs/containers.md)
- [API map](docs/api.md)
- [Examples](docs/examples.md)

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) and our
[Code of Conduct](CODE_OF_CONDUCT.md).

## License

AgentBox is Apache 2.0 licensed, as found in the [LICENSE](LICENSE) file.
