run AI agents locallyMagnitude local inferencelocal AI coding agents

How to Run AI Coding Agents Locally with Magnitude

Learn how to run Claude Code, Codex, or Cline locally with Magnitude in three steps, plus DeepSeek vs OpenAI cost math and the tool's alpha limits.

Portrait of Luis Chavez-Mattos
Edited by Luis Chavez-Mattos, Director, Product··RSS
A small open module with a visible grid of uniform internal processing blocks sits in the foreground, contrasted with a large sealed opaque sphere floating distantly in the background, illustrating local AI inference versus a remote cloud system.

How do you run AI coding agents locally with Magnitude?

Running AI coding agents on your own hardware with Magnitude takes three steps: install the open-source desktop app or CLI, let it profile your machine and recommend a tuned model, then point an existing agent like Claude Code, Codex, or Cline at its local API. No cloud account, no per-token invoice, no data leaving your machine. That's the whole pitch, and it's working well enough that a YC-backed company built a business around it.

TL;DR

  • Running agents locally with Magnitude takes three steps: install the app or CLI, let it profile your machine and recommend a tuned model, then connect Claude Code, Codex, or Cline to its local API.
  • On a standardized monthly workload of 30 million input and 30 million output tokens, OpenAI's flagship model runs about $1,050 versus $39.15 on DeepSeek V4 Pro, a 27x gap on the high end.
  • A 2026 Cloudera and Wakefield Research survey found that 66% of organizations moved AI workloads from public cloud back to on-premises or private infrastructure in the prior year.
  • Open-weight models now carry 80 to 90% of enterprise AI token volume while commanding only 10 to 20% of AI budgets, driven almost entirely by cost.
  • Magnitude profiles your exact hardware and compiles and tunes its own kernels for that specific machine instead of shipping one precompiled binary.
  • Magnitude is alpha software that listens only on localhost, so it is not yet a drop-in Ollama replacement or a shared team server.

What is the cloud tax developers are trying to escape?

Per-token pricing looks cheap until an agent reads a codebase, calls tools, and iterates for twenty minutes straight. On a standardized workload of 30 million input and 30 million output tokens a month, OpenAI's flagship model runs about $1,050. The same workload on DeepSeek V4 Pro costs $39.15; DeepSeek's cheaper Flash tier runs $12.60. That's a 27x gap on the high end, the kind of math that makes a finance person ask why the AI bill looks like a SaaS subscription nobody budgeted for.

This isn't a fringe complaint. A 2026 Cloudera and Wakefield Research survey of 1,500 enterprise architects and cloud leaders found that 66% of organizations moved AI workloads from public cloud back to on-premises or private infrastructure in the prior year. Eighty-four percent said AI workloads had driven up infrastructure costs, and 95% reported delaying or canceling AI projects over governance and compliance friction. Our practical guide to running AI workflows locally covers the break-even math in more detail. Short version: the cloud tax is real, and "run AI locally" has become one of the most common questions in developer forums this year.

Figure 1
Monthly cost of a 30M input / 30M output token workload
OpenAI flagship (gpt-5.6-sol)$1,050DeepSeek V4 Pro$39.15DeepSeek V4 Flash$12.60
Illustrative figure. Constructed for explanation, not a measured source.

What is Magnitude, actually?

Magnitude is an open-source, Apache 2.0 licensed inference engine backed by Y Combinator's Summer 2025 batch, built by a two-person team, Tom Greenwald and Anders Lie, out of San Francisco. It ships as a desktop app that profiles your exact hardware, Apple Silicon, NVIDIA, AMD, or CPU-only, and compiles and tunes its own kernels for that specific machine instead of shipping one precompiled binary for a broad hardware class.

That distinction matters more than it sounds. Ollama and LM Studio are excellent at running models you already picked. Magnitude's harder claim is that it helps you pick the right model in the first place. An independent review found Magnitude measures the memory bandwidth your machine actually achieves, not the number on the spec sheet, and ranks full configurations, model plus quantization plus context size plus a predicted speed range, instead of just listing files to download. On a 16GB Apple M5, it recommended Gemma 4 E2B at 4-bit quantization and predicted 43 to 51 tokens per second. That's a meaningfully different product than "here are some files to download."

Figure 2
Enterprises are pulling AI workloads back from the cloud
66%
Moved AI workloads from public cloud back to on-prem/private infra in the prior year
84%
Said AI workloads drove up infrastructure costs
95%
Delayed or canceled AI projects over governance/compliance friction
Illustrative figure. Constructed for explanation, not a measured source.

How do you set up Magnitude to run AI agents locally?

The setup is short:

  1. Install Magnitude. Download the desktop app or CLI for your platform.
  2. Download a tuned model. Open the Discover tab, where Magnitude recommends a configuration based on your hardware profile. A Fast-to-Smart slider biases the recommendation toward speed or capability; start with Balanced.
  3. Connect your agent. Open the Connections tab and link an installed coding agent, including Claude Code, Codex, and Cline, through an OpenAI- or Anthropic-compatible local API.

Once connected, Magnitude runs in the background and loads the model only when the agent calls it. Everything, including prompts and files, stays on the machine. If you're already building a self-hosted agent stack, this slots in as the inference layer underneath it; our guide to self-hosting AI coding agents covers the rest, from sandboxing to orchestration.

Figure 3
Magnitude's reported speedup vs. llama.cpp (Qwen 3.6 35B A3B, 4-bit)
Decode speedupPrefill speedup
speed increase over llama.cpp (%)
0%50%100%Apple M4 ProNVIDIA DGX Spark
Hardware platform
Vendor-reported benchmark figures from Magnitude's own testing as described in the article; not independently verified against llama.cpp by a third party.
Illustrative figure. Constructed for explanation, not a measured source.

How much faster is Magnitude than running models the normal way?

Magnitude's own benchmarks, run against Qwen 3.6 35B A3B at 4-bit quantization, claim up to 2x faster inference than llama.cpp. On an Apple M4 Pro, that's 92% faster decode and 9% faster prefill. On an NVIDIA DGX Spark, it's 19% faster decode and 23% faster prefill. Decode speed matters most for an agent waiting on a response, so the Apple Silicon result is the headline figure, but treat vendor-reported benchmarks as a starting point, not a verdict.

Independent testing backs up the general direction without matching every number exactly. The hands-on review that examined Magnitude's internals confirmed the hardware-profiling behavior and configuration-ranking approach actually work as advertised, which is a different and arguably more useful claim than raw speed. It also comes with a caveat worth repeating: Magnitude is young. The CLI was at version 0.0.11 with daily breaking changes at the time of that review, the repository had roughly 3,370 GitHub stars but only about 21 watchers, and the contributor base is still small and centered on the founders. This is alpha software, not a drop-in Ollama replacement yet.

How do DeepSeek and the open-weight stack make local viable?

None of this works without models worth running. DeepSeek is the reason the economics flipped. Its reported training-run cost for V3 was $5.576 million, calculated at an assumed $2 per GPU-hour across 2.788 million H800 GPU-hours. That figure excludes prior research, failed experiments, and the cost of the GPU clusters themselves; Stanford's Freeman Spogli Institute and SemiAnalysis both estimate DeepSeek's actual hardware investment at $500 million or more. The famous "cheap to build" number is a narrow training-run figure, not DeepSeek's total cost base, and that distinction matters when deciding whether the open-weight ecosystem is sustainable or a subsidized anomaly.

Figure 4
DeepSeek's training cost vs. its actual hardware investment
$5.6M
Reported DeepSeek V3 training-run cost
$500M+
Estimated actual DeepSeek hardware investment (Stanford FSI / SemiAnalysis)
Illustrative figure. Constructed for explanation, not a measured source.

What's not in dispute is that the weights are open and cheap to run. Ollama supports DeepSeek's R1 line from 1.5B parameters up to 70B, though the bigger versions need real GPU power to be useful. That gives developers a second, Magnitude-independent path to the same local-inference destination, and it's part of why models like Qwen and GLM have also become credible options; our break-even math on local models versus API cost walks through where that threshold actually sits.

Why is this bigger than one tool?

This isn't a story about one scrappy YC startup. Ollama's CEO Jeffrey Morgan has said open-weight models now carry 80 to 90% of enterprise AI token volume while commanding only 10 to 20% of AI budgets, driven almost entirely by cost. Ollama Cloud's token usage grew 150x since the start of 2026, and AT&T alone has shifted 40% of its token consumption to open models. Chinese-origin models, DeepSeek chief among them, dominate that cloud-hosted open-model consumption. Combined with the Cloudera repatriation numbers above, the picture is an industry quietly re-architecting around infrastructure it owns instead of rents, the same shift our Software Ownership and SaaS Economics coverage keeps tracking across every layer of the stack, not just AI inference.

Figure 5
Open-weight models are already winning on enterprise token volume
85%
Enterprise AI token volume on open-weight models (reported range: 80-90%)
150×
Growth in Ollama Cloud token usage since start of 2026
40%
AT&T's token consumption shifted to open models
Illustrative figure. Constructed for explanation, not a measured source.

What are the real limitations and risks?

Local inference solves the cost and exfiltration problem. It doesn't solve every problem.

  • Magnitude is alpha software. Daily breaking commits, a tiny maintainer team, and a backend limited to GGUF/llama.cpp with no vLLM or native MLX support mean it isn't yet a production serving layer.
  • It's single-machine only. Magnitude listens only on localhost with no documented way to serve it to other machines on a network, so it's built for one developer on one machine, not a shared team server.
  • Hardware is a real ceiling. Even a tuned local setup won't match frontier cloud models on the hardest reasoning tasks; you're trading some capability for cost and control.
  • DeepSeek carries documented governance risk. Its privacy policy discloses storing user data on servers in China, Wiz Research found an exposed DeepSeek database leaking over a million lines of chat logs, and Enkrypt AI's red-teaming found DeepSeek-R1 roughly four times more likely to generate insecure code or malware than OpenAI's o1. Running the weights locally removes the data-transmission risk but not the question of what's baked into the model itself without a code audit.
Figure 6
Local inference options compared
Local inference options compared
Ongoing CostData Stays On-DeviceProduction MaturityAuto Hardware ProfilingMulti-User / Network Serving
RecommendedMagnitudeA single developer who wants a model auto-matched to their exact hardwareLowHighLowYesNo
OllamaStable local serving once you already know which model you wantLowHighHighNoYes
Cloud APILow-volume or genuinely frontier-capability tasksHighLowHighNoYes
Ratings are relative across these three options, not absolute scores.
Illustrative figure. Constructed for explanation, not a measured source.

Should you switch, and what is a practical decision framework?

Local inference pays off fastest in a few specific situations:

  1. You're running agentic workloads at volume. If an agent is making dozens of tool calls per task, token costs compound fast, and the DeepSeek-versus-OpenAI pricing gap turns into real monthly savings.
  2. Data residency or exfiltration risk is a real constraint. Code, customer data, or anything you can't send to a third-party API is a strong local-first case.
  3. Your hardware is already sufficient. A modern Apple Silicon Mac or a decent NVIDIA card gets you most of the way; Magnitude's value is specifically in matching the right model to that hardware without guesswork.
  4. You can tolerate alpha-grade tooling. If a breaking change every few days would derail your team, wait, or run a steadier stack like Ollama with DeepSeek's open weights in the meantime.
Figure 7
The cloud tax, in one comparison
27×
Cost multiple: OpenAI flagship vs. DeepSeek V4 Pro
$1,050
OpenAI flagship monthly cost (30M in / 30M out tokens)
$39.2
DeepSeek V4 Pro cost, same workload
Illustrative figure. Constructed for explanation, not a measured source.

If none of those fit, cloud APIs still make sense for low-volume, latency-tolerant, or genuinely frontier-capability work. The point isn't that local wins every time. It's that for the first time, the comparison is a real spreadsheet decision instead of a hobbyist's side project.

Frequently Asked Questions

5 questions

What is Magnitude and how is it different from Ollama or LM Studio?

Magnitude is an open-source, Apache 2.0, YC-backed inference engine that profiles your exact hardware and compiles tuned kernels for it, rather than shipping precompiled kernels for broad hardware classes like Ollama and LM Studio do. It also ranks full configurations (model, quantization, context size, predicted speed) instead of just listing models to download.

How do I connect Claude Code or Codex to a local model with Magnitude?

After installing Magnitude and downloading a recommended model through its Discover flow, open the Connections tab and link your installed agent (Claude Code, Codex, Cline, OpenCode, and others are supported). Magnitude exposes an OpenAI- or Anthropic-compatible local API at 127.0.0.1:10100 that the agent talks to directly.

Is Magnitude actually faster than llama.cpp?

Magnitude's own benchmarks on an Apple M4 Pro show 92% faster decode and 9% faster prefill versus llama.cpp, and on an NVIDIA DGX Spark, 19% faster decode and 23% faster prefill, measured on Qwen 3.6 35B A3B at 4-bit with 64k context. These are vendor-reported numbers; independent review confirms the general approach but the tool is still alpha-stage with frequent breaking changes.

Is it safe to run DeepSeek models locally instead of using DeepSeek's API?

Running DeepSeek's open weights locally removes the risk of your prompts and data being sent to DeepSeek's servers in China. It does not remove risks baked into the model itself: independent red-teaming found DeepSeek-R1 roughly four times more likely to generate insecure code or malware than OpenAI's o1, so a local deployment still warrants scrutiny of generated code.

When does local AI inference actually save money compared to cloud APIs?

It pays off fastest for high-volume agentic workloads with many tool calls, for data that can't leave your environment, and when you already own capable hardware. On a standardized 30M-token workload, DeepSeek V4 Pro runs about $39.15 a month versus roughly $1,050 for OpenAI's flagship tier, a gap that compounds quickly at agent-level usage.

How we source, write, and correct our articles. Editorial standards

Related articles

Straight to your inbox.
New pieces as they publish. No noise.