r/LocalLLM • u/karoudm • 17h ago
Discussion Is anyone else delegating Claude Code subtasks to local LLMs? Here's my setup and numbers
Claude Code (Opus) plans and reviews; routine coding and text subtasks run on local models on my M1 Max 64GB through a small MCP server. gemma-4-26B-A4B turned out to be the most reliable worker.
The idea: paid models burn a lot of tokens on grunt work. Opus hands bounded, checkable tasks (code, edits, tests, docstrings, summaries, translation, JSON extraction) to local models served by oMLX. It passes file paths instead of file contents, then verifies every result: runs the tests, reads the diff, checks the schema. If the local model fails, Opus does the task itself.
Routing comes from benchmarks, not model names (hidden unit tests and rubrics written before any run):
| Model | Gen tok/s | Hard code tests passed | Gets |
|---|---|---|---|
| Qwen3.6-35B-A3B | 95 | 61% | normal code, summaries, JSON |
| gemma-4-26B-A4B | 49 | 100% | hard code, edits, tests, translation |
| Qwen3.8-27B (dense) | 35 | 69% | fallback |
gemma did a great job: it passed every hard test in every run (an interval set, a TTL cache, an expression parser that must match Python exactly), made correct code edits, and gave the best translations. Half Qwen3.6's speed, but right the first time.
Two lessons: thinking mode hurt (every thinking run used its 10k-token budget without finishing), and models can't write valid diff hunks, so the server asks for the full file and computes the diff itself.
Has anyone else thought about this? Do you delegate from a paid agent to local models, and have you measured real token savings? Small sample (one Mac, two runs per hard task); happy to share the code.
24
u/tomz17 17h ago
#1. yes, it's a common pattern. So common, in fact, that it is built into many harnesses.
#2. there is likely something profoundly wrong with your setup (e.g. sampling, quantization, etc). Qwen3.6-35B-A3B should outperform gemma-4-26B-A4B on *most* coding tasks, while Qwen3.8 27b should thoroughly wallop gemma-4-26b-a4b in agentic coding tasks.
5
u/makkalot 15h ago
First time I see Gemma performing better than qwens for coding tasks, you sure you use the correct params ?
3
u/Future_AGI 7h ago
to measure the savings, compare Opus input and cache tokens per task with delegation on versus off, running the same task list both ways.
3
u/PeeAeMKay 13h ago
I have experimented with this idea recently, as well. I really like the idea, but in practicse, I couldn't get it to a point where it actually reliably saves Claude tokens.
The problem I am still running into is that Claude spends about as many tokens for guiding the local models and for checking their work afterwards as it would for doing the work itself.
For example, if Claude reads the code files produced by the local model directly, then their content ends up in Claude's context and will drive up token usage going forward.
Instead of doing that, Claude can also create scripts or unit tests that programmatically check if the resulting code from the local model fulfills predefined conditions. But that requires tokens, as well.
I might be missing something obvious, but I had much more success when it comes to saving Claude tokens by utilizing techniques to keep Claude's context low.
2
u/kriptojew 17h ago
Yes
1
u/Poprouter 9h ago
for the edits, could your worker return search and replace blocks instead? exact lines to remove plus a bit of surrounding context, then the server fuzzy matches the anchor and only falls back to a full file rewrite on a miss
1
u/UnheardNoise107 2h ago
Local is the future. Cloud offerings are too expensive. So, companies will use the cloud sparingly for hard problems and fall back on local open models for everything else. The local models are good enough. If your engineers can't function without AI, fire them.
1
u/Old_AI_Guy_ 1h ago
Both local and cheap cloud models, yes. I have 2 64GB Macs running versions of Qwen, for offloaded tasks. Deepseek through Ollama (harness is Claude Code) is a real workhorse for coding, and very cheap - hard to use more than $1/day, using it as the only coder for a simulated engine with a web front end. Got it working in one long day, now refining and even reworking as goals change. Fable 5.2 on Claude does checkpoint reviews, write dev plan.
Other projects using agent teams with all leads being Opus, Team architect Fable, and teams have a budget of local, cloud, and Anthropic models they can enlist for work, with preference going to local, then cloud, then Anthropic (cost hierarchy), but always when non-Claude models are appropriate. Extensive testing and benchmarking builds profiles that settle which model (and engine, if local) to use.
1
u/hyudryu LocalLLM 17h ago
That is what I’m working on right now for our coding harness. I’m personally running GLM 5.3 flash as the local worker/QA tester, and either fable 5.2 or opus 5.5 as the orchestrator in deterministic agent graphs. That way I don’t have to worry about wasting tokens having the agent do QA automation and testing/feedback/reiteration, and let it do the more “smart” work of planning/code reviews.
Plus also using JEV on our coding harness to reduce token consumption further on the cloud models.
1
u/ZeitgeistArchive 17h ago
How is inkling in this?
0
u/admajic 14h ago
How does qwen 3.8 27b and Inkling compare?
0
u/BackgroundRude4092 11h ago
I wonder if Claude Code just interfaces with gemma4 better.
How much context are you using, and does Claude start multiple requests at the same time?