Skip to content

Live dashboard

This page is live/README.md, the dashboard's own instructions.

A campaign, live: the agents working, waiting and making model requests, model calls per second, the simulations in flight, the model servers' queues, tokens and KV cache, and the tools, in Grafana.

Only the demo streams to it today. Its launcher, autonmi-launch, and its job scripts live in the autonmi-demo repository, and the commands below run from a checkout of it. The framework's mini-apps do not stream to the dashboard yet.

All of it is optional. The demo runs without it: without --otlp, autonmi-launch streams nothing and imports nothing of OpenTelemetry's SDK, and nothing in the demo, its launcher or its job scripts needs a container runtime. This folder is a convenience for watching a run:

  • autonmi-launch --otlp makes each agent process stream what Flowgentic and RHAPSODY already record, over OTLP, to an OpenTelemetry collector. It needs the SDK and its exporter, which the demo does not install: pip install -r requirements-live.txt (or the live extra). Without them, --otlp stops before the run starts and says so.
  • stack.sh starts a collector, Prometheus and Grafana for the user who runs it, with Docker on a laptop or Apptainer on a cluster's node. Any collector that writes to a Prometheus works too, such as Flowgentic's examples/live-dashboard, which takes AUTONMI's dashboard as APP_DASHBOARDS=live/dashboards/AUTONMI (its model-server panels stay empty: that stack does not scrape the servers).
  • Prometheus scrapes the vLLM servers' own /metrics; Grafana's home page is AUTONMI's dashboard.

On a laptop, with Docker

With stub model servers that answer as vLLM does, so no GPU is needed:

pip install -r requirements-live.txt
live/stack.sh up                                    # prints Grafana's address; log in as admin
python -m autonmi.demo.workflow.stub_server --fleet runs/fleet --servers 2 --latency 0.5 &
live/stack.sh scrape runs/fleet                     # Prometheus scrapes the servers' /metrics
source <(live/stack.sh env)                         # the collector's address and token
autonmi-launch --runtime local --agents 3000 --workers 150 --sim-median 4 --no-burn \
    --model openai --endpoints-file runs/fleet/endpoints --api-key-file runs/fleet/api-key --otlp
touch runs/fleet/stop                               # stops the stub servers
live/stack.sh down

The stub servers follow autonmi-launch's default workflow. For a campaign with other workflow options (--seed, --lookup-calls, --plan-calls, --max-sims, the physics or the thinking budget), give the servers the same ones, quoted: --campaign-args "--plan-calls 1 --think-budget 256". Otherwise their answers do not match the campaign's workflow, and it does not verify.

With Docker on macOS, keep the state directory under your home (the default, ~/.local/state/autonmi-live): the Docker VM shares only that.

On a Slurm cluster, with Apptainer

job.sh runs the stack as a job of its own, beside the model job, on a node with Apptainer. It scrapes a fleet's servers once they are up, and again when a requeued model job moves them. A campaign streams to it when given the collector's address and token, and --otlp. Submit from the repository's root:

LIVE_PYTHON=$AUTONMI_VENV/bin/python \
    sbatch -A ACCOUNT -p PARTITION -c 4 --mem=8G -t 04:00:00 -o LIVE/live-%j.out live/job.sh LIVE FLEET
source LIVE/agents.env                              # once the job has started the stack
jobs/submit campaign RUN FLEET --cpus-per-task=112 --mem=200G --time=01:00:00 -- \
    --agents 1000 --processes 2 --workers 50 --model openai --otlp
touch LIVE/stop                                     # stops the stack; its data stay in LIVE

The job's output names its node and Grafana's port; reach Grafana with an SSH tunnel to that node, as ssh -L 3000:127.0.0.1:<port> <node> through the login node. Its first start pulls the three images into ~/.cache/autonmi-live (LIVE_IMAGES), which takes a few minutes. Prometheus keeps its data in LIVE for 15 days, so a later job shows earlier runs too. LIVE_PYTHON is a Python with bcrypt, for Prometheus's password; without one, stack.sh uses htpasswd. jobs/submit stub-model FLEET starts stub servers in place of the model job, to try it on CPUs (after --, --campaign-args with the campaign's workflow options, as above).

Under Dragon, RHAPSODY's telemetry (on with --otlp, for the simulation panels) keeps each agent process in its session's close after the run, until the launcher's teardown ends it: with two agent processes, a run's job ends about two minutes later than without it. The results and the summary are not affected, nor the dashboard's totals (the processes keep exporting while they wait). --otlp-no-rhapsody leaves RHAPSODY's telemetry out, and the simulation panels empty.

On a shared node

A port on 127.0.0.1 is open to every user of the node, not only to the one who started the stack. So:

  • Grafana asks for a login (admin, with the password stack.sh made);
  • the collector asks for a token, which only the campaigns' environment carries;
  • Prometheus asks for a password, which only Grafana and the collector have.

stack.sh makes the three secrets once and keeps them, readable by the user only, in its state directory (~/.local/state/autonmi-live, or the job's LIVE). It passes them to the services in their environment, never on a command line, which other users can read.

Under Apptainer the services share the node's network. So the stack has no Jaeger, whose query port has no login, and the agents send metrics only. Grafana and Prometheus listen on 127.0.0.1 only. In the job, the collector listens on the cluster's network, so that campaigns on other nodes reach it; locally, on 127.0.0.1. Nothing uses TLS: keep GRAFANA_ANONYMOUS off, and cross a network through an SSH tunnel.

Two checks keep the secrets from reaching another user's process:

  • stack.sh up, under Apptainer, first checks that no other process listens on its three ports, and stops if one does: the stack's own service would exit, and that process would answer in its place. Another port is a matter of GRAFANA_PORT, OTLP_HTTP_PORT or PROMETHEUS_PORT.
  • autonmi-launch --otlp needs the collector's address, from --otlp URL or OTEL_EXPORTER_OTLP_ENDPOINT (agents.env). Without one it stops before the run starts, rather than send to OpenTelemetry's default, localhost:4318, which on a shared node may be anyone's collector.

The token reaches a campaign's job through its environment (source LIVE/agents.env before jobs/submit). Slurm keeps a job's environment where its administrators can read it, so the token is for this stack only: it lets a process send metrics to the collector, and nothing else.

What the panels read

Panel From
Agents working, waiting, making a model request, done Flowgentic's flowgentic.agents, by state: working is working and tool_call, waiting is model_queued and tool_wait
Model calls per second Flowgentic's flowgentic.fleet.request.duration (its count), and vLLM's finished requests
Simulations in flight, and per second RHAPSODY's tasks_running and tasks_completed. RHAPSODY counts a task as running from when its backend accepts it, so this includes the simulations queued for a worker
Requests running and waiting, tokens, KV cache, prefix-cache hits vLLM's own metrics
Admission wait, time at the server Flowgentic's fleet metrics
Tool calls and their time, event-loop lag Flowgentic's tool and host metrics

The dashboard reads only metrics that Flowgentic 0.5.1, which the demo pins, and Flowgentic 0.6.0 and 0.7.0 send. So it also shows the processes of a Flowgentic 0.7.0 application that call flowgentic.otlp.configure() with the same names: run the run, service agents, instance the process (agents-<i>; local in a local run, whose agent hosts are threads of one process). autonmi-demo's tests/test_live_dashboard.py ties every query to the instruments' names, and to what a campaign streamed with --otlp sends. Here, tests/test_live_stack.py checks the stack's scripts and secrets, and that every panel reads the run and the servers chosen.

Files

File What it is
stack.sh Starts and stops this user's stack, with Docker or Apptainer; makes and keeps its secrets; points Prometheus at a fleet
job.sh The stack as a Slurm job, under Apptainer, scraping a fleet's servers
compose.yaml The services under Docker: the collector, Prometheus, Jaeger, Grafana
collector.yaml OTLP in, with a token; metrics to Prometheus, with its password
collector-traces.yaml With Docker only: the sampled spans, to Jaeger
prometheus.yaml The OTLP receiver's settings, and the scrape of the model servers
grafana/ The data sources and the dashboards' folders
dashboards/AUTONMI/autonmi.json AUTONMI's dashboard, Grafana's home page

Flowgentic's and RHAPSODY's own dashboards, from Flowgentic's examples/live-dashboard/dashboards, appear beside it with COMPONENT_DASHBOARDS=<that directory> live/stack.sh up. On Flowgentic 0.5.1, the Flowgentic dashboard's panels on whole calls, tokens and retries stay empty: those metrics came with 0.6.0.