{"slug": "token-arbitrage-use-sol-for-coding-luna-for-compaction-save-84", "title": "Token Arbitrage: Use Sol for coding, Luna for compaction, save 84%", "summary": "OpenAI's price drop for Luna unlocked a cost-saving technique: using Luna for context compaction instead of Sol reduces compaction costs by 84.5%, from $0.40 to $0.062 per compaction event, according to a developer who implemented the feature in Dirac. The savings stem from Luna's lower input and output token prices, and the approach is now supported in Dirac via a new 'Utility model' concept.", "body_md": "The recent [Luna price drop](https://openai.com/api/pricing/) unlocked some neat uses for OpenAI users such as\nscout, test writer, test maintainer, trigger executor, and many more. We will specifically focus on context\ncompression in this post.\n\nSuppose you are running a fairly long agentic loop that has a compaction threshold around 200k tokens and compaction triggers 5 times during the full loop. Each time, let’s say the compaction generates ~10k tokens (20:1 compaction ratio). Somewhere between 8 to 12% of the total cost of such a loop will be solely from compaction, easily making it the most expensive tool call per invocation, largely due to the large token output that necessarily has to be generated each time.\n\nCondense operations are essentially summarization operations with some trivial constraints. They primarily need to\npreserve task state: the objective, repository findings, files changed, commands and tests run, failures\nencountered, decisions made, and unresolved work. Once a model reliably extracts those fields, additional general\nreasoning capability is unlikely to produce any measurable improvement in the summary. ([source: arXiv 2606.02875](https://arxiv.org/html/2606.02875v1) + many similar results)\n\n**Scenario A: Sol condenses its own context**\n\n200k × $0.50/M (cached input price) + 10k × $30/M (output + reasoning tokens emitted for condense) = $0.10 +\n$0.30 = **$0.40**\n\n**Scenario B:** The harness detects the condense threshold and hands the work over to Luna.\n\n200k × $0.25/M (cache write price; Luna does not benefit from read cache) + 10k × $1.20/M (output + reasoning\ntokens emitted for condense) = $0.05 + $0.012 = **$0.062**\n\nCompared to Sol, just swapping in Luna for compaction saves:\n\n1 − ($0.062 / $0.40) = **84.5%**\n\nThis is a comparison solely between Sol and Luna; if you use something like DeepSeek V4 Flash, the savings would be even larger.\n\nIf you work exclusively in long-context loops, assuming context compaction is a 10% overhead cost, this change alone reduces your overall bill (or saves usage limit) by 8.4% with no regressions.\n\n## Now supported in Dirac\n\nDirac already supported a separate model for Plan mode and Act mode. This was a special case since this is neither plan nor act, so I added a new concept of Utility model (well, the concept itself is not new; multiple agents out there already support a similar concept). Then, when the compaction is triggered at the configured context limit, the harness routes this through the utility model and the main model starts its next response with condensed context.\n\nAnother advantage, of course, was to start reusing this in multiple other things such as task creation tooling, generating the commit message automatically, and so forth.\n\n## If you want to push it to the limits\n\nNotice that we used $0.25/M input price earlier for Luna, which is a cache write price. This content is strictly one-off, so it can be called with cache writes disabled, saving you one whole cent per call!", "url": "https://wpnews.pro/news/token-arbitrage-use-sol-for-coding-luna-for-compaction-save-84", "canonical_source": "https://dirac.run/posts/token-arbitrage-sol-vs-luna", "published_at": "2026-08-03 12:27:38+00:00", "updated_at": "2026-08-03 12:54:40.998712+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-tools", "ai-infrastructure"], "entities": ["OpenAI", "Luna", "Sol", "Dirac", "DeepSeek V4 Flash"], "alternates": {"html": "https://wpnews.pro/news/token-arbitrage-use-sol-for-coding-luna-for-compaction-save-84", "markdown": "https://wpnews.pro/news/token-arbitrage-use-sol-for-coding-luna-for-compaction-save-84.md", "text": "https://wpnews.pro/news/token-arbitrage-use-sol-for-coding-luna-for-compaction-save-84.txt", "jsonld": "https://wpnews.pro/news/token-arbitrage-use-sol-for-coding-luna-for-compaction-save-84.jsonld"}}