Applied AI and evaluationDaily driver
Claude Code on a laptop-local model
Ran Anthropic's coding agent against an open-weights model on an M4 Max, with Receipt Verified 2026-10-09Cut Claude Code's per-request prompt from about 35.4k to about 6.1k tokens with a 5-tool context-budget proxy.Period2026-10-09MethodSame captured 28-tool request before and after; tokens estimated as characters / 4.SourceSession capture prompt tokens per request.
- Role
- Builder
- Period
- Oct 7 to 9, 2026
- Team
- Solo, with Claude Code
- Stack
- llama.cppQwen3-CoderPythonaiderEvalPlus
Receipt Verified 2026-10-09Cut Claude Code's per-request prompt from about 35.4k to about 6.1k tokens with a 5-tool context-budget proxy.Period2026-10-09MethodSame captured 28-tool request before and after; tokens estimated as characters / 4.SourceSession captureprompt tokens per request
Receipt Verified 2026-10-09The chosen open-weights model scored 87.2% on HumanEval+ (143/164) and 70.4% on MBPP+ (266/378).Period2026-10-09MethodGreedy decoding; scored by my subprocess scorer, cross-checked by an independent harness.SourceBenchmark resultsHumanEval+ (MBPP+ 70.4%)
Receipt Verified 2026-10-09Decoded at 70.4 tokens per second on an Apple M4 Max.Period2026-10-09Methodllama-bench tg128, Q6_K, flash attention.SourceBenchmark outputdecode on an M4 Max
Goal
A private, offline coding agent that keeps Claude Code's workflow.
Obstacles
- Claude Code's 28-tool prompt (about 35k tokens) overflowed the local model's 32k context.
- The model's chat template crashed on multi-block system prompts.
- The standard benchmark evaluator scored every task 0 on macOS.
Approach
- A context-budget proxy that keeps 5 tools with full schemas and swaps in a compact system prompt.
- Patched chat template and cache-safe headers, so repeat turns reuse the prefix cache.
- Benchmarked a mixture-of-experts model against a dense one: quality tied within 2.5 points, the MoE decoded about 7x faster, so it became the daily driver.
- Replaced the broken evaluator with a subprocess scorer, cross-checked by an independent harness.
- SHA-256-verified model downloads.
Lift (results)
- Receipt Verified 2026-10-09Cut Claude Code's per-request prompt from about 35.4k to about 6.1k tokens with a 5-tool context-budget proxy.Period2026-10-09MethodSame captured 28-tool request before and after; tokens estimated as characters / 4.SourceSession capture prompt tokens per request.
- HumanEval+ Receipt Verified 2026-10-09The chosen open-weights model scored 87.2% on HumanEval+ (143/164) and 70.4% on MBPP+ (266/378).Period2026-10-09MethodGreedy decoding; scored by my subprocess scorer, cross-checked by an independent harness.SourceBenchmark results on the chosen model; MBPP+ 70.4%.
- Receipt Verified 2026-10-09Decoded at 70.4 tokens per second on an Apple M4 Max.Period2026-10-09Methodllama-bench tg128, Q6_K, flash attention.SourceBenchmark output decode and Receipt Verified 2026-10-09A Claude Code tool call through the proxy took 2.7 seconds (33.4 s on the dense fallback).Period2026-10-09MethodTimed live probe.SourceSession capture per tool call on an M4 Max.
Next
- Speculative decoding with a small draft model.
- Open-source the context-budget proxy.