Skip to content
radical-collaborationPublic

About

AUTONMI: agents at HPC scale on RHAPSODY, RaDEX and Dragon

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

AUTONMI

AUTONMI (AUtonomous Task OrchestratioN MIddleware) is layered middleware for running very large numbers of AI agents alongside HPC simulations. At the top (L3), an application's agents drive its workflow: each agent calls a model and runs tools, such as simulations. Flowgentic (L2) connects those agents to the execution layer: its agent host starts them and caps how many are live, its fleet admits and routes their model calls across the model servers, and its tool runtime turns their tool calls into tasks, which AsyncFlow runs on an engine per population. RHAPSODY (L1) runs those tasks at scale. Dragon is the runtime underneath for distributed execution and communication. RaDEX, on Dragon's distributed dictionary, is the in-memory store that agents and simulations share across nodes: it holds the agents' state and the simulations' results. So far each agent runs on its own: agents that talk to each other over A2A, and agents written in frameworks such as LangGraph or OpenClaw, are planned.

AUTONMI runs populations of agents as nodes of an AsyncFlow application's graph, at HPC scale. An application gives an agent definition. AUTONMI runs its agents in populations on Flowgentic's agent host, on RHAPSODY, RaDEX and Dragon. Each population has an AsyncFlow engine of its own for its agents' simulations. A run in a mini-app checks itself across Flowgentic's telemetry, the application's records and, when it samples them, the model servers' counters.

Where AUTONMI sits

Where AUTONMI sits: the systems it runs on, and the seams where another tool fits

The stack answers where AUTONMI sits among the systems it runs on, and which of them another tool can replace.

AUTONMI is built on Flowgentic and AsyncFlow, which are fixed. The layers in blue are seams, each named by its interface. The tool in each seam is the one AUTONMI ships and tests, an example of the layer. Another tool that implements the interface can take its place, today or after the work below.

Seam Interface What AUTONMI ships Another tool
Model servers OpenAI-compatible HTTP, with /health to wait for a server vLLM, in a job of its own (jobs/model.sh); the application's stub, for tests Fits today: any server that speaks the API. Only vLLM is tested, and the servers' counters (autonmi.vllm) are vLLM's
MCP servers MCP, by URL The application's own (AgentDefinition.services) Fits today
Store Flowgentic's KeyValueStore, with tensors RaDEX under Dragon; a dictionary in the process locally After some work: autonmi.store.open_store opens these two only
Execution backend RHAPSODY's backend interface, which AsyncFlow takes RHAPSODY's Concurrent backend locally, its native Dragon backend under Dragon After some work: a population picks one of these two by name (PopulationConfig.backend). RHAPSODY's other backends, such as Dask's, need a way to be picked. Locally, the simulations' executor fits today: any concurrent.futures.Executor (PopulationConfig.executor)
Runtime Processes, queues, and placement on nodes and GPUs Dragon; threads in one process locally After more work: a campaign's runtime is local or dragon (CampaignConfig.runtime), and AUTONMI starts processes, queues and the store, and places them, with Dragon's own calls

Workflow Mini-Apps is fixed too, but a run can go without its MiniApp (app=None). Remote-side agents, which run as sessions of an agent runtime such as dragon.ai.agent.batch, are experimental and not in a release: they rely on an experimental version of RHAPSODY backed by a custom Dragon wheel.

Architecture

AUTONMI's architecture: its components by module, and the interfaces at its edge

The architecture answers what AUTONMI's own components are, what each does, and which interfaces connect them to each other and to the systems around AUTONMI.

How a campaign runs

How a campaign runs under Dragon: populations as Dragon processes across nodes, and their calls to the store, the model servers and the tool services

The execution model answers what happens, in order, when a campaign runs, and in which process on which node.

  1. Start. The campaign splits the agents into populations, and adds each one to the mini-app's AsyncFlow engine as a task. Under Dragon, RHAPSODY's native backend starts each population as a Dragon process on its node.
  2. A model turn. In each population, Flowgentic's agent host starts the agents in waves, and its loop runs each one (a scripted agent runs on AUTONMI's script runner instead). A model call goes through the population's fleet, which admits it within the caps, to a model server.
  3. A task tool. A task tool, such as a simulation, becomes a task of the population's own AsyncFlow engine, which runs it on a worker process of the node, on its CPUs or a GPU.
  4. A waiting agent. An agent can suspend while its tasks run: its state goes to the store, and it resumes with its tasks' values.
  5. An MCP tool. An MCP call goes through a tool service, on the mini-app's node, to the application's MCP servers.
  6. Rows and stats. Once every agent has ended, each population writes its rows and stats into the run directory and returns them to the campaign. check() then verifies the run.

Locally the same parts run in the mini-app's process: each population is an AsyncFlow block of the mini-app's engine, with an engine of its own on RHAPSODY's Concurrent backend; the simulations run on a pool of threads or processes, and the store is a dictionary.

Status

Experimental: the API will change. Tested locally, and under Dragon on one node and across nodes, on CPUs and GPUs. requirements.txt pins the versions of Flowgentic, AsyncFlow, RHAPSODY and Workflow Mini-Apps it is tested with. The LangGraph demo it grew from lives in the autonmi-demo repository.

Install

Python 3.12 or 3.13:

pip install autonmi-py

Runs under Dragon also need Dragon (pip install dragonhpc) and RaDEX, which installs from its source: RaDEX is not on PyPI.

To run the examples and the tests, install from a clone of the repository with uv, at the versions AUTONMI is tested with:

uv venv --python 3.12
uv pip install -r requirements.txt -e '.[test]'

Getting started says what the requirements pin, and how to add the clone of workflow-mini-apps that the conformance kit's shape check needs.

Example

A campaign of the conformance kit's toy application, 100 agents in two populations, on a laptop (docs/examples/toy_campaign.py):

import asyncio
from concurrent.futures import ThreadPoolExecutor

from radical.asyncflow import WorkflowEngine
from rhapsody.backends import ConcurrentExecutionBackend

from autonmi import Campaign, CampaignConfig
from autonmi.conformance.toy import Toy


async def main() -> bool:
    """Run the campaign, and return whether every check passes."""
    backend = await ConcurrentExecutionBackend(ThreadPoolExecutor(4))
    flow = await WorkflowEngine.create(backend=backend, work_dir="runs/toy")  # AsyncFlow's files, in the run
    campaign = Campaign(flow, Toy(agents=100), CampaignConfig(run_dir="runs/toy", populations=2))
    try:
        await campaign.start_services()
        await campaign.run()
        await campaign.stop_services()
        return campaign.check()
    finally:
        await campaign.close()
        await flow.shutdown()


if __name__ == "__main__":
    print("checks pass:", asyncio.run(main()))
.venv/bin/python docs/examples/toy_campaign.py

A run directory holds one run: remove runs/toy before you run it again.

Documentation

The documentation of the latest release is at radical-collaboration.github.io/autonmi. Its source is in docs/, built with MkDocs:

uv venv --python 3.12 .venv/docs
uv pip install --python .venv/docs/bin/python -r docs/requirements.txt
.venv/docs/bin/mkdocs serve
  • Getting started: the install and a first run.
  • Concepts: the mini-app, populations, agent definitions, services, placement, failures, telemetry and checks.
  • Guides: writing an application, Dragon, model servers, GPUs.
  • Reference: the command line, settings, the run directory, the API.

License

MIT: see LICENSE.

About

AUTONMI: agents at HPC scale on RHAPSODY, RaDEX and Dragon

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages