Metrum AI Router

One prompt that builds the whole AMD demo, start to finish

You paste one prompt into a coding agent on your Mac. It rents a fresh AMD Instinct MI325X machine on DigitalOcean, builds Metrum AI Router from source, connects it to two cloud models, gives a coding agent on that machine its own router key, and rehearses a live demo. It never touches existing machines and never shows a secret on screen.

What the prompt sets up The coding agent on the Mac creates the droplet with doctl and copies two provider keys over SSH. On the droplet, the pi agent calls the router on 127.0.0.1:18081, which sends 70 percent of calls to OpenAI GPT-6 Luna and 30 percent to Fireworks DeepSeek V4.1 Flash. The presenter views the admin dashboard through an SSH tunnel. Only port 22 is open. Your Mac Coding agent runs the prompt from chetan-infra-agent/ env.json OpenAI + Fireworks keys Browser admin dashboard via ssh -L 18081 DigitalOcean droplet demo325-for-poweredge-mi350p · port 22 only pi coding agent own router key model: big-coder Metrum AI Router 127.0.0.1:18081 checks key, limits weighted pick 70 / 30 records cost per call usage.sqlite AMD Instinct MI325X · 256 GB HBM3E Visible with rocm-smi. Idle in this demo; it is where the routing brain and self-hosted models go next. OpenAI gpt-6-luna 70% of calls Fireworks deepseek-v4p1-flash 30% of calls doctl keys over ssh, umask 077 admin tunnel
The router never listens on a public port. The only way in is SSH, and the dashboard rides an SSH tunnel.

Eight phases, each verified before the next

The agent runs these in order, checks each one before moving on, and logs every command with its outcome. Select a phase to see what it does, what it proves, and when it stops to ask you.

    The rules it cannot bend

    These hold for the whole run. Most of them exist so the agent can work unattended on a real cloud account without risk to other machines or to secrets.

    New machine only

    If a droplet named demo325-for-poweredge-mi350p already exists, it stops. It never reuses, resizes, reboots or deletes anything that was already there, even to get under the GPU limit.

    Secrets stay off screen

    Provider keys, router tokens and the admin password are read from files and written to files. They never appear in a command line, log, chat message or commit. It reports only whether a key is present.

    Built from source

    The router is built from the main branch with the repo's own make local-router target, not from a release download.

    Simple weighted routing

    Calls split 70/30 at random between two cloud models. The d3 and OpenJev routing models are skipped because loading them takes too long for this demo.

    Nothing public but SSH

    The router binds to 127.0.0.1. The cloud firewall opens port 22 to your IPv4 address only, and the agent checks from your Mac that no other port answers.

    Stops and asks

    No MI325X access, a GPU limit error, extra spend, sudo on your Mac, or a check that fails twice: each one pauses the run for your decision.

    Leaves it running

    The droplet stays up for your demo. You get the teardown commands; the agent does not run them.

    Credited code

    Every script the agent writes starts with the Metrum AI copyright header.

    The live demo it rehearses

    The agent runs every beat once as a rehearsal, then hands you the exact commands to replay in front of the audience.

    Open the dashboard

    SSH tunnel from your Mac, then sign in at /admin/reports/ with the new password.

    New password 200. No password or admin/admin: 401.

    Agent at work

    pi builds a small Python word-count tool with tests, runs them, and fixes failures until they pass.

    Files created and a green test run.

    Weighted split

    Twenty short calls to big-coder, then a count of which cloud model served each one.

    About 14 Luna and 6 DeepSeek. Random, so never exact.

    Stop a rogue agent

    Issue a second key, show it works, revoke it, restart the router process.

    Rogue key gets 403 key-disabled. pi keeps working.

    Read the receipts

    Requests, cost by upstream model, usage per key, and one request drilldown.

    The revoked key's 403s show in security events.

    Fixes learned from the dry run

    A first run on a real account hit each of these. The prompt now tells the agent about them up front.

    PhaseWhat went wrongWhat the prompt does now
    0The IP lookup returned IPv6, but the firewall rule needs an IPv4 /32.Uses curl -4.
    0, 1The account has a GPU droplet limit; a create can fail with "will exceed your GPU limit".Lists GPU droplets and their monthly cost first, and stops on that error.
    1Some DigitalOcean GPU images start a ROCm container listening on 0.0.0.0 ports 8000, 8888 and 30000.Checks ss -ltn and docker ps, disables them, then probes from the Mac that only 22 answers.
    2go.mod pins toolchain go1.26.9, so an older Go downloads it during the build.Installs go1.26.9 directly.
    6, 7Tiny test calls failed with 502 only on the Luna share of traffic. OpenAI rejects output limits under 16 tokens.Every test call sets max_tokens to 32.
    7Passwords in curl arguments show up in the process list.Feeds Basic-auth credentials on stdin with curl -K -.
    7The router PID was hard to find because the supervisor starts it by relative path.Uses pgrep -f '^tmp/local-pi/metrum-ai-router --config' and waits for /readyz after the kill.
    7Reissuing the rogue key failed because the token file already existed.Deletes the token file before each issue; the step can be repeated.
    7Revoked-key errors were missing from the usage-per-key report.Points to security events for the 403s and names each admin API.

    What you get back

    Final report

    • Droplet details: ID, IP, region, size, image and firewall ID.
    • Build: the main commit it built.
    • Checks: pass or fail for each Phase 6 test.
    • Split: the actual Luna and DeepSeek counts.
    • Demo script: copy-paste commands for every beat.
    • Inventory: a new entry in inventory/hosts.toml, shown as a diff and not committed.
    • Repo issues: anything that fought the agent, written up to file.

    Teardown, for you to run later

    # Copyright 2026 Metrum AI
    doctl compute droplet delete demo325-for-poweredge-mi350p
    doctl compute firewall delete <firewall-id>
    rm -f ~/src/metrum-ai/chetan-infra-agent/tmp/demo325/admin-password
    ssh-keygen -R <ip>

    The GPU bills by the hour while the droplet exists, so run this as soon as the demo is over.