# AI agent swarm cost optimization

## Summary

Cursor ran an agent swarm experiment rebuilding SQLite from scratch in Rust, testing different model combinations for planning versus implementation. The winning formula paired frontier models as planners with cheaper models as workers, cutting costs by 7.9x and code volume by 6.5x while hitting 100% test pass rates.


## Core ideas

- Planner versus worker split: Frontier models decompose goals into instructions but never write code, so their context stays clean. Cheap models execute narrow tasks without needing to plan, so all their context goes to implementation.

- Cost varies wildly by model mix: Fable 5 alone cost $20,000 to rebuild SQLite. Opus 4.8 plus Composer 2.5 split across planning and worker roles came in near LEET score, just $2 off, at a fraction of that cost.

- Token burn differs by model: GPT 5.5 alone used 14.7 billion tokens. Fable 5 alone used 12.2 billion tokens. Mixing frontier planning with cheap execution beat both while costing far less.

- Code efficiency jumped: The new swarm architecture produced 9,908 lines of code for 100% test pass, compared to 64,000 lines from the old swarm. That's about six and a half times less code for the same result.

- Model choice depends on task shape: Fable 5 shines on unbound, creative planning. Opus 4.8 does well on bounded tasks with a fixed spec. Using Fable for a bounded task is overkill since there's no creative ceiling to push against.

- Personal workflow mirrors the finding: The speaker already uses Fable 5 as a planner and GPT 5.6 Sol for implementation, even though it's not the cheapest setup, because Fable's creative planning strength justifies the cost there.

- A gap in the experiment: Cursor didn't test Composer 2.5 alone as both planner and worker, leaving open whether it's simply not suited for orchestration tasks.


## Quotes

> a planner doesn't implement, so its context never fills with low-level detail

@therobertta

> Worker never plans, so it can spend all its context on one narrow piece of work

@therobertta

> Once a frontier planner has collapsed the ambiguity into a detailed explicit instruction, less expensive models simply have to follow it.

@therobertta

> I think Opus 4.8 on a bounded task, like we create something with a fixed spec is actually a pretty good model to do that.

@therobertta

> There's not enough creativity needed where Fable can really show its value.

@therobertta


## Resources

[Claude Opus 4.8](https://www.anthropic.com/news/claude-opus-4-8): Frontier planner model in the swarm split, Anthropic’s official model page.

[Amazon Bedrock](https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-opus-4-8.html): AWS’s managed home for Claude Opus 4.8 access and deployment.


Source: https://www.instagram.com/reel/Db08WMRlZc5/?igsh=bDB0bmZwanBzNGZ3

Canonical: https://drop.rizzgroup.org/ledger/ai-agent-swarm-cost-optimization-dpdqrp
