Local-Splitter: A Measurement Study of Seven Tactics for Reducing Cloud LLM Token Usage on Coding-Agent Workloads
Organizations: Sperix Labs · VIA Cybersecurity Lab, KNUST · Quantum and Assistive Technologies Lab, KNUST
Abstract
We present a systematic measurement study of seven tactics for reducing cloud LLM token usage when a small local model can act as a triage layer in front of a frontier cloud model. The tactics are: (1) local routing, (2) prompt compression, (3) semantic caching, (4) local drafting with cloud review, (5) minimal-diff edits, (6) structured intent extraction, and (7) batching with vendor prompt caching. We implement all seven in an open-source shim that speaks both MCP and the OpenAI-compatible HTTP surface, supporting any local model via Ollama and any cloud model via an OpenAI-compatible endpoint. We evaluate each tactic individually, in pairs, and in a greedy-additive subset across four coding-agent workload classes (edit-heavy, explanation-heavy, general chat, RAG-heavy). We measure tokens saved, dollar cost, latency, and routing accuracy. Our headline finding is that T1 (local routing) combined with T2 (prompt compression) achieves 45-79% cloud token savings on edit-heavy and explanation-heavy workloads, while on RAG-heavy workloads the full tactic set including T4 (draft-review) achieves 51% savings. We observe that the optimal tactic subset is workload-dependent, which we believe is the most actionable finding for practitioners deploying coding agents today.
Figures & tables
| Tactic | WL1 (edit) | WL2 (explain) | WL3 (chat) | WL4 (RAG) |
|---|---|---|---|---|
| T1 route | 29.2% | 68.8% | 58.9% | 38.0% |
| T2 compress | 22.4% | 19.3% | 2.6% | 18.9% |
| T3 cache | 9.6% | 1.0% | 3.8% | 2.4% |
| T4 draft | 35.0% | 40.5% | 12.6% | 31.1% |
| T5 diff | 5.1% | 3.4% | 4.4% | 39.3% |
| T6 intent | 5.0% | 5.5% | 0.3% | 1.7% |
| Subset | WL1 (edit) | WL2 (explain) | WL3 (chat) | WL4 (RAG) |
|---|---|---|---|---|
| T1+T3 | 33.7% | 70.4% | 57.4% | 36.2% |
| T1+T2 | 45.0% | 79.0% | 57.4% | 44.3% |
| T1+T2+T3 | 42.6% | 79.6% | 59.6% | 43.8% |
| all | 29.4% | 71.6% | 59.1% | 51.1% |
| Subset | Baseline | Treatment | Tie | Incon. | Errors |
|---|---|---|---|---|---|
| T1 | 15 | 5 | 0 | 17 | 3 |
| T1+T2 | 15 | 6 | 1 | 17 | 1 |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Workload | Subset | Cloud tok. | Local tok. | Saved (%) | Cost ($) | Latency (ms) |
|---|---|---|---|---|---|---|
| WL1 | baseline | 11,007 | 0 | — | 0.0043 | 6,933 |
| WL1 | T1 | 7,675 | 2,618 | 30.3 | 0.0031 | 17,218 |
| WL1 | T2 | 8,355 | 0 | 24.1 | 0.0037 | 17,481 |
| WL1 | T5 | 10,074 | 0 | 2.3 | 0.0042 | 11,358 |
| WL1 | T6 | 10,500 | 0 | 1.8 | 0.0040 | 10,288 |
| WL1 | T7 | 10,833 | 0 | 5.0 | 0.0041 | 10,187 |
LLM Agent Workflow Optimization
LLM agent workflow optimization studies how to design and run multi-step agents for better task success, reliability, latency, and cost.
See all 256 papers