# REPOMIND v3 (ACT II) - two-tier coding agent: on-prem router + AMD deep tier, with a measured −92% token-cost cut

**URL:** <https://devcommunity.amd.com/t/repomind-v3-act-ii-two-tier-coding-agent-on-prem-router-amd-deep-tier-with-a-measured-92-token-cost-cut/692>\
**Category:** Showcase\
**Tags:** ai, rocm, gpu, amd, developer-program\
**Created:** [July 8, 2026, 8:38pm UTC](https://devcommunity.amd.com/t/repomind-v3-act-ii-two-tier-coding-agent-on-prem-router-amd-deep-tier-with-a-measured-92-token-cost-cut/692 "2026-07-08T20:38:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sardor\_Razikov](https://dub1.discourse-cdn.com/amd/user_avatar/devcommunity.amd.com/sardor_razikov/32/499_2.png) [@Sardor\_Razikov](https://devcommunity.amd.com/u/Sardor_Razikov)\
**Post date:** [July 8, 2026, 8:38pm UTC](https://devcommunity.amd.com/t/repomind-v3-act-ii-two-tier-coding-agent-on-prem-router-amd-deep-tier-with-a-measured-92-token-cost-cut/692/1 "2026-07-08T20:38:43Z")

</div>

Hi AMD Developer Community,

Follow-up to my May post (REPOMIND on a single MI300X - 256K, FP8, 31.31× concurrency, verified - `https://devcommunity.amd.com/t/repomind-open-source-repo-scale-coding-agent-on-a-single-mi300x-256k-context-fp8-31-31x-concurrency-verified/505`).

That was ACT I. This is **REPOMIND v3** for the AMD Developer Hackathon ACT II - same open-weight, 100%-AMD philosophy, but this round the focus is **token economics** , where agent workloads actually bleed.

**What’s new vs v1:** v1 proved a big model _fits and serves_ on one MI300X. v3 attacks the _cost per session_ with a two-tier design and a measured cost layer.

## Architecture (two tiers, both open-weight)

- **Router / local tier** - a small Gemma-class model classifies each query and answers most of them without ever calling the expensive model. On-prem this runs on the customer’s **own AMD GPU** (dev: local / AMD **Lemonade** server) → **$0 per token** , code never leaves.
- **Deep tier** — GLM 5.2 (open-weight) for the hard minority. Cloud/burst path is served by **Fireworks (AMD-Instinct-powered)**; on-prem it’s the same weights on the enterprise’s own Instinct → still $0/token.

## The cost layer - measured, reproducible

Numbers below are **measured** on MacBook + AMD-hosted Fireworks (GLM 5.2 rates), reproducible from the repo — not projected:

| Technique | Effect (measured) |
| --- | --- |
| AST skeleton (send structure, not full files) | **−88.6% tokens** (13,881 → 1,582 on a real backend file) |
| Prompt caching (cached input) | **−90%** on repeated context |
| Confidence cascade (skip the deep call when the router is sure) | removes the deep-tier call entirely on the easy majority |
| **Net per session** | naive **$0.2163 → $0.0165 = −92.4%** |

Reproduce it yourself:

git clone [GitHub - SRKRZ23/repomind-v3: On-prem AI coding agent + LLM cost-router for regulated enterprises — 100% AMD, open-weight, air-gapped, Ed25519 tamper-evident audit. AMD ACT I 1st-place winner. · GitHub](https://github.com/SRKRZ23/repomind-v3)  
cd repomind-v3 && docker compose up # or: make demo-offline (no GPU, no keys)  
cd backend && python demo\_cost\_contrast.py # prints the NAIVE vs REPOMIND table  
make test # 38 passing tests

**Measured floor (prior, ACT I on a real MI300X x1):** a 256K-token repo served for **$4.12** (~31 devs/GPU). v3 stacks the cost layer on top of that floor.

## Trust layer

Every agent action is written to an **Ed25519-signed, hash-chained JSONL** (“Flight Recorder”) — tamper-evident audit for regulated/air-gapped deployments (`backend/data/repomind_audit.jsonl`).

## Feedback for the AMD Developer Cloud / ROCm team

1. The Qwen3-Coder Quick Start image (last event) was excellent. A **preconfigured `GLM-5.2-MXFP4` vLLM template** (weights pre-pulled) would be the natural default for a “deep tier on Instinct” this round.
2. **Lemonade** is a great fit for the small local-router tier - a one-click “small-model router” template would round out the two-tier story.
3. Genuine question for anyone who’s run it: AMD’s `GLM-5.2-MXFP4` model card suggests **MXFP4 needs TP4 while FP8 runs fine at TP8**. Has anyone benchmarked deep-tier **throughput / accuracy tradeoffs of MXFP4@TP4 vs FP8@TP8 on MI300X**? That’s the config decision I’d want data on before recommending an on-prem deep tier.
4. The “one MI300X serves ~31 devs at 256K” economics is still, IMO, undersold on the Dev Cloud landing page - clearest single-GPU value story for 2026.

Repo (MIT): [GitHub - SRKRZ23/repomind-v3: On-prem AI coding agent + LLM cost-router for regulated enterprises — 100% AMD, open-weight, air-gapped, Ed25519 tamper-evident audit. AMD ACT I 1st-place winner. · GitHub](http://github.com/SRKRZ23/repomind-v3) · sourced references in `BUSINESS_CASE.md`.

Happy to go deep on the router classifier, the cascade thresholds, or the 256K config — reply here.

- Sardor Razikov, Independent ML Engineer, Tashkent
