Deterministic-first agent routing · v0.1
Scale down before you scale up.
GrokMax is a deterministic-first execution pipeline for GrokBot-heavy teams. It routes every task to the cheapest capable executor, slims context to what matters, and caches the result across five layers — so nothing is paid for twice.
- $0
- cost to answer a math task
- 5
- cache layers
- 33
- benchmark fixtures at 100%
- 109
- tests, all passing
Fixtures and tests measured on our machine with the deterministic resolver only — zero spend, no model in the loop. Savings on GrokBot usage are router-level proxies, honestly labeled as such.
$ grokmax route "Calculate 7*8 and return the integer result"
ROUTE DETERMINISTIC
CACHE MISS (cold)
7*8 = 56 (zero cost, cached for the next identical ask)
$ grokmax optimize "Calculate 7*8 and return the integer result"
ROUTE NONE
CACHE L0 hit — exact cache hit (canonical hash)
served from cache in 0ms · GrokBot not invoked
How it works
Most tasks are not GrokBot-only tasks.
GrokMax catches cheap work before it becomes an expensive invocation. The pipeline treats GrokBot as the last resort, not the default.
Slice context
Send ~1,500 relevant tokens instead of 20,000. The reduction is a proxy for token cost — never a billed measurement.
Compile the micro-prompt
Hard constraints survive verbatim. validatePreservation fails loudly if a constraint token is ever lost in compression.
Route to the cheapest worker
deterministic > api > chatgpt > opencode > grokbot. GrokBot is the most capable and the most expensive — so it is always last.
Execute responsibly
Zero-cost local resolvers handle math, hashing, file counts, and git. Over-budget GrokBot routes refuse rather than pretend.
Cache across five layers
L1 exact, L2 normalized, L3 semantic, L4 artifact, L5 durable knowledge. Identical and near-identical tasks cost nothing twice.
Ledger everything
Every run is recorded with honest labels: measured, estimated, or proxy. No number gets to pretend it is something it is not.
| Route | Cost | Handles | Preferred |
|---|---|---|---|
| deterministic | $0 | math · hash · file-count · git | always |
| api | $ | direct tools and endpoints | always |
| chatgpt | $$ | research & cheap generation | always |
| opencode | $$ | repository modification | always |
| grokbot | $$$$ | persistent · authed · unavailable | only when nothing else can |
Why the honesty matters
Integrity is the product.
Every number GrokMax reports is labeled. Savings are proxies unless they were manually imported from live observation — because that is the only honest way to talk about a platform we cannot see into.
| Claim | Figure | Honest label |
|---|---|---|
| Benchmark fixtures | 33 tasks · 5 suites · 100% resolve · 100% outcome | measured on our machine, deterministic resolver only |
| Automated tests | 109 tests across 12 files | locally verified, reproducible via pnpm vitest run |
| Math task | $0.00 — local evaluator, no model in the loop | measured |
| Savings on GrokBot usage | router-level avoided-GrokBot counts | proxy — GrokBot platform usage is not directly observable |
| Context reduction | proportion of tokens trimmed | proxy for token cost, not a billed measurement |
We never claim to measure GrokBot’s platform usage. We also never release a version whose doctor, tests, or performance gates are red. If GrokMax cannot prove it, GrokMax does not claim it.
CLI
One binary. Honest answers.
Install locally with pnpm, run the doctor, and let the pipeline decide who pays for what.
$ grokmax doctor STATUS: 17 healthy, 1 warning, 0 failure ✓ node Node 26.5.0 ✓ sqlite SQLite read/write verified ✓ exact-cache L1 round-trip verified ✓ semantic-cache reachable, cold miss as expected ✓ routing router works; sample route=opencode ✓ prompt-compiler constraints preserved verbatim ✓ opencode-cli OpenCode CLI detected ! grokbot-bridge GROKMAX_GROKBOT_BRIDGE unset; deemed unavailable
Commands
grokmax optimize "<goal>"Full pipeline: plan + outcomegrokmax route "<goal>"Routing decision only — never executesgrokmax dry-run "<goal>"Skip execution, show what would happengrokmax doctorHealth checks across every subsystemgrokmax benchmarkRun the fixture suites, measured locallygrokmax savingsHonest report — proxies labeled as suchgrokmax cache stats | prune | clearCache health and maintenancegrokmax statusOne-view aggregate across everything
Get started
Scale down before you scale up.
Clone the repo, install with pnpm, and run the doctor on your own workspace. See what stops being expensive.