A model is not an agent
A language model answers. It does not open your repo, run the tests, or apply the diff. The piece that turns answers into work is the harness: tools, sessions, permissions, and the loop that keeps going until the job is done.
DeepSeek put that equation on the box when it shipped DeepSeek Harness in August 2026: model plus harness equals agent. OpenCode is the same idea from the terminal side. Claude Code is the same idea with Anthropic’s models behind a subscription. The hardware question only matters after you decide which harness is doing the work.
If you are still evaluating local inference as a chat app, you are solving yesterday’s problem. The useful question is which local stack sits behind a coding harness, and when you should still pay Claude Code.
The three-layer stack
Stop shopping for “an AI coding tool.” Buy three parts and wire them.
Runtime. Something that loads weights and exposes an OpenAI-compatible API on localhost. For Hugging Face discovery, LM Studio is the simplest path: search the Hub in the app, pick a quant, load the model, start the local server. Default endpoint is http://localhost:1234/v1. Ollama is simpler as an always-on daemon for agents, but it pulls from its own registry first. Direct transformers is the most native Hugging Face path and the most setup.
Model. Prefer coding-tuned open weights that actually emit tool calls. Dense models usually feel better than MoE for interactive agent work. Raise context past Ollama’s or LM Studio’s small defaults. System prompts and tool schemas alone will eat a 4K window.
Harness. OpenCode or DeepSeek Harness (dsh). Both treat the model as a plug. Neither is the model. Claude Code is the cloud version of this layer.
Get the wiring wrong and you will blame the model for a harness problem, or the harness for a context problem. Measure each layer separately.
How LM Studio talks to OpenCode and DeepSeek Harness
LM Studio does not embed inside the harness. It hosts the model and serves HTTP.
Turn on the local server in LM Studio (Developer tab, Start Server). Confirm it answers:
curl -s http://localhost:1234/v1/models
Point OpenCode at that base URL in opencode.json, using the model id LM Studio shows. Some OpenCode builds also auto-discover LM Studio on port 1234. Explicit config is what you put in a team runbook.
For DeepSeek Harness, add a custom provider with api: openai-completions, the same base URL, and the exact model id. The schema often wants an API key even when the local server ignores it, so a dummy value is fine. DeepSeek Harness is still a developer preview. Pin a version. Do not hang an unattended production pipeline on the latest tag.
The flow is Hugging Face model, load in LM Studio, start the server, harness calls localhost. Keep the model loaded or the harness gets connection errors.
What to run on an M5 MacBook Pro
Published LM Studio runs on M5 MacBooks (JMLab, March 2026) are the cleanest public table I have seen for this exact app. Memory tier decides the model class more than marketing names do. Reserve 8 to 16GB for macOS and your IDE before you pick a quant.
| Unified memory | Model | Format | Size | tok/s | Role |
|---|---|---|---|---|---|
| 16GB | Qwen2.5 VL 7B | GGUF Q4_K_M | 4.8GB | ~70 | Efficiency / thin machines |
| 16GB (code) | Qwen2.5 Coder 7B | MLX 8-bit | 8.1GB | ~54 | Tight coding fit |
| 32 to 64GB (accuracy) | Qwen2.5 Coder 32B | MLX 4-bit | 18.3GB | ~19 | Best accuracy in tier |
| 32 to 64GB (speed) | Mistral Small 24B | MLX 4-bit | 14.1GB | ~28 | Everyday multitask |
| 48 to 64GB | Llama 3.3 70B | MLX 4-bit | 39.7GB | ~9 | Usable, slow |
| 128GB M5 Max | Qwen3.5 122B MoE | MLX 4-bit | 69.6GB | ~44 | Large MoE headroom |
Prefer MLX in LM Studio when both formats exist. It was faster on most models in that test, with gains up to about 38% on high-bandwidth chips. One exception: Qwen2.5 VL 7B ran faster as GGUF. Bandwidth matters. An M5 Max near 614GB/s will outrun a base M5 or Air near 153GB/s on the same weights.
For OpenCode or DeepSeek Harness on a 32 to 64GB machine, start with Qwen2.5 Coder 32B MLX for quality or Mistral Small 24B MLX for speed. Prove tool calls in a throwaway repo before you chase a bigger parameter count.
M5 Pro vs M5 Max: where the money goes
For local LLMs, Pro to Max is not a few percent. Decode is memory-bandwidth bound. Full M5 Max sits near 614GB/s. M5 Pro sits near 307GB/s. Same model, same quant, expect roughly 1.8 to 2x tokens per second, not a rounding error.
Diminishing returns show up elsewhere. On 7B to 14B models, Pro is already fast enough that Max is hard to feel in daily chat. The bigger Max reasons are the 128GB ceiling Pro cannot buy, and consistently faster 32B to 70B decode. The mid Max with a 32-core GPU lands around 460GB/s, so read the SKU before you pay for the badge. Max also draws more under load, so sustained laptop decode can thermally soften the sticker gap.
Practical call: stay under roughly 32B with 32 to 64GB and Pro is the better dollar. Buy Max when you need 128GB or you will live in 32B to 70B local agents.
Local tok/s vs Claude Code
Anthropic does not publish first-party Claude Code tokens per second. Third-party API measurements put Sonnet-class models roughly in the 40 to 120+ tok/s band and Opus-class roughly 50 to 100, with Haiku faster still. Those numbers move with load and version.
A well-tuned local 7B to 14B on an M5 can match or beat Claude’s streaming rate. A local 32B often sits near Sonnet’s lower end. A local 70B is usually slower than Claude Code feels.
That comparison is incomplete. Tokens per second is the wrong contest for a coding agent. Claude Code wins on tool-call reliability, multi-file edits, and one pass that works. Local can stream fifty tokens a second of wrong patches. Claude at sixty tokens a second of correct ones finishes the job sooner.
Local wins on privacy, no meter, and no queue once the model is resident. Claude Code adds network latency and session or usage limits on a subscription. Reasoning modes can sit for seconds before the first answer token. That feels slow even when decode speed looks fine on paper.
Hybrid is the rational stack. Claude Code for hard reasoning and delicate refactors. Local LM Studio behind OpenCode or DeepSeek Harness for private code and boilerplate volume. Put both under the audit of your AI tool stack so neither becomes an unmanaged dependency.
What to measure
Do not measure tokens per second in the abstract. Measure the job.
Tool-call reliability matters more than stream speed. Context that survives a real session matters more than a leaderboard prompt. Time to first useful edit beats time to first token. Memory headroom with your IDE and Docker still open decides whether the stack is a daily driver. Permission policy in the harness decides whether speed becomes accidental file damage.
If those numbers do not move in two weeks, change the harness or the model size before you buy more silicon. Same test as when to hire before automating: fix the workflow before you scale the tool.
A starter path that works
- Install LM Studio. Download a coding model from Hugging Face inside the app. Prefer MLX on Apple Silicon when available. Chat once to prove the machine.
- Start the local server on port 1234. Confirm
/v1/modelswith curl. - Install OpenCode or DeepSeek Harness, not both on day one. Point it at
http://localhost:1234/v1and the LM Studio model id. - Run one bounded task in a throwaway repo: add a test, fix a lint, write a README section. Watch tool calls fail. That is the real onboarding.
- Keep Claude Code for the hard lane. Route private and repetitive work local. Revisit the split after two weeks of measured jobs, not after one benchmark screenshot.
FAQ
Is LM Studio enough without Ollama? Yes for a single-user harness on a laptop. LM Studio’s OpenAI-compatible server is the interface. Move to Ollama when you want a headless daemon that survives closing the GUI.
OpenCode or DeepSeek Harness? OpenCode if you live in the terminal and want stable provider switching. DeepSeek Harness if you want a Web UI, plugin composition, and MCP as first-class citizens. Same LM Studio runtime either way.
Do I need an M5 Max? Only if you need 128GB or you will run 32B to 70B local agents hard enough to care about roughly 2x bandwidth. For 7B to 24B daily work, M5 Pro is enough.
Will local replace Claude Code? No. Local can match streaming feel on small and mid models. It does not match frontier coding-agent quality at the same speed. Use both on purpose.
Which model should I start with on 32GB? Mistral Small 24B MLX 4-bit for speed, or Qwen2.5 Coder 32B MLX 4-bit if you can spare the memory and want the stronger coding scores from the LM Studio M5 tables.


