Layered micro-execution using cheap models to achieve deep reasoning at 75% lower cost.
Quantized Execution
Quantized execution distributes expensive reasoning across layers of cheap model calls. Instead of one $0.50 deep reasoning call, run 50 cheap scans + 10 synthesis passes + 1 focused deep call — same depth, 75% less cost.
The Problem
Deep reasoning models are powerful but expensive. A single complex task might cost 10,000+ tokens with a frontier model. If you need 100 agents working in parallel, the cost explodes.
Most of that cost is wasted on context-gathering. The model spends 80% of its tokens understanding the problem and 20% actually reasoning about it.
The Insight
What if cheap models did the context-gathering and only the expensive model did the reasoning?
Layer 1: 50 seed agents × 10 tokens = 500 tokens
Layer 2: 10 synthesizers × 100 tokens = 1,000 tokens
Layer 3: 1 deep reasoner × 1,000 tokens = 1,000 tokens
Total = 2,500 tokens
vs. one unquantized call: 10,000+ tokensSame depth of understanding. 75% less cost. The seed agents scan, the synthesizers combine, and the deep reasoner decides.
How It Works
Layer 1: Seeds
Cheap, fast, disposable. Each seed agent gets a narrow slice of the problem:
// 50 seed agents, each scanning one aspect
const seedSprint = sprints.create({
goal: 'Scan codebase for authentication patterns',
minAgents: 50,
maxAgents: 50,
consensusThreshold: 0.5,
});
// Each seed uses ~10 tokens
const seed = new AgentParticipant(mesh, sprints, {
identity: { agentId: 'seed-0', name: 'Scanner', role: 'researcher', capabilities: ['shallow-scan'] },
socketId: 'sock-seed-0',
onExecuteTask: async (task) => {
const result = await cheapModel.complete(task.description, { maxTokens: 10 });
return { output: result, tokensUsed: 10, artifacts: [{ type: 'review', content: result }] };
},
});Seeds produce raw signal: "found JWT usage in 3 files", "session middleware is in /src/auth", "tests exist for login flow". They don't reason — they report.
Layer 2: Synthesizers
Mid-tier models that combine seed outputs into structured understanding:
// 10 synthesizers, each combining 5 seed outputs
const synthSprint = sprints.create({
goal: 'Combine seed scan results into migration plan',
minAgents: 10,
maxAgents: 10,
consensusThreshold: 0.5,
});
// Each synthesizer uses ~100 tokens
const synth = new AgentParticipant(mesh, sprints, {
identity: { agentId: 'synth-0', name: 'Combiner', role: 'planner', capabilities: ['synthesis'] },
socketId: 'sock-synth-0',
onExecuteTask: async (task) => {
const seedOutputs = getSeedResults(); // from previous sprint's artifacts
const plan = await midModel.complete({ seedOutputs, task: task.description }, { maxTokens: 100 });
return { output: plan, tokensUsed: 100, artifacts: [{ type: 'plan', content: plan }] };
},
});Synthesizers produce structured knowledge: "these 12 files need changes, in this order, with these dependencies". They connect dots but don't make final decisions.
Layer 3: Deep Reasoner
One frontier model call with full context from the synthesizers:
// 1 deep reasoner with all the synthesis
const deepSprint = sprints.create({
goal: 'Make final implementation decision',
minAgents: 1,
maxAgents: 1,
consensusThreshold: 1,
});
const deep = new AgentParticipant(mesh, sprints, {
identity: { agentId: 'deep-0', name: 'Architect', role: 'coordinator', capabilities: ['deep-reasoning'] },
socketId: 'sock-deep-0',
onExecuteTask: async (task) => {
const synthPlan = getSynthResults();
const decision = await frontierModel.complete({ plan: synthPlan, task: task.description }, { maxTokens: 1000 });
return { output: decision, tokensUsed: 1000, artifacts: [{ type: 'decision', content: decision }] };
},
});The deep reasoner gets a pre-digested context. It doesn't waste tokens scanning files or understanding structure — that work is already done. It focuses purely on the hard reasoning.
Cost Comparison
| Approach | Agents | Tokens | Cost Factor |
|---|---|---|---|
| Single deep call | 1 | 10,000+ | 1.0x |
| Quantized 3-layer | 61 | 2,500 | 0.25x |
| Quantized with 100 seeds | 111 | 3,500 | 0.35x |
The savings compound as tasks get more complex. A task requiring 50,000 tokens unquantized might need only 8,000 tokens quantized — because most of the context-gathering is done by 10-token seed agents.
Token Tiers
The sprint system tracks per-agent token usage, making it easy to audit quantized spending:
// After sprint completes
const seedTokens = seeds.reduce((sum, s) => sum + s.getTotalTokensUsed(), 0);
const synthTokens = synths.reduce((sum, s) => sum + s.getTotalTokensUsed(), 0);
const deepTokens = deep.getTotalTokensUsed();
console.log({ seedTokens, synthTokens, deepTokens });
// { seedTokens: 500, synthTokens: 1000, deepTokens: 1000 }When to Use Quantized Execution
Good fit:
- Codebase analysis and migration planning
- Large-scale code review (seeds scan, synths categorize, deep prioritizes)
- Documentation generation from existing code
- Security audits (seeds scan for patterns, synths classify, deep assesses risk)
- Test generation (seeds analyze functions, synths identify edge cases, deep writes tests)
Not a good fit:
- Tasks requiring a single coherent chain of thought
- Creative writing where consistency matters
- Tasks where the "scanning" phase is trivial (small inputs)
Integration with Sprint Protocol
Each layer runs as its own sprint. The output artifacts from one sprint feed into the next:
Sprint 1 (Seeds) → artifacts: raw scan results
Sprint 2 (Synths) → reads Sprint 1 artifacts → artifacts: structured plans
Sprint 3 (Deep) → reads Sprint 2 artifacts → artifacts: final decisionThe mesh scratchpad can pass data between sprints, or artifacts can be read directly from the sprint outcome.
Next Steps
- Sprint Protocol — the phase-based execution that drives each layer
- Agent Mesh — the communication fabric connecting all agents
- Multi-Provider AI — route seed/synth/deep tiers to different providers