Skip to content

Run DeepSeek Locally With Ollama on Windows + Claude Code

Run a DeepSeek model locally with Ollama on Windows and connect it to Claude Code via Claude Code Router. Install, model pull, config, hardware needs, and fixes.

MGMCSA Guru Team August 8, 2026 3 min read
DeepSeek running locally via Ollama connected to Claude Code on Windows

Running a DeepSeek model locally with Ollama gives you something the cloud can’t: zero API bill and complete privacy — your code never leaves the machine. Connect it to Claude Code through Claude Code Router and you keep the agent workflow while everything runs offline. It’s the setup to reach for when privacy matters or you want no per-token cost at all.

This covers the install, model choice for your hardware, and the router config. For the trade-offs versus hosted models, read on — they’re real. For hosted DeepSeek, see run DeepSeek V4 with Claude Code.

Step 1: Install Ollama

Download and install Ollama for Windows from its site (it also runs in WSL). Ollama serves models on a local OpenAI-compatible endpoint at http://localhost:11434/v1.

Step 2: Pull a DeepSeek model that fits your hardware

ollama pull deepseek-r1:8b

Test it directly first:

ollama run deepseek-r1:8b

Step 3: Route Claude Code to Ollama

Ollama speaks the OpenAI format, so use Claude Code Router to connect Claude Code:

{
  "Providers": [
    {
      "name": "ollama",
      "api_base_url": "http://localhost:11434/v1/chat/completions",
      "api_key": "ollama",
      "models": ["deepseek-r1:8b"]
    }
  ],
  "Router": { "default": "ollama,deepseek-r1:8b" }
}

Then run:

ccr code

Claude Code now runs on your local DeepSeek model, fully offline.

The honest trade-offs

Local DeepSeek vs hosted DeepSeek API

Cost Local: no API bill · Hosted: cheap pay-per-token
Privacy Local: fully private · Hosted: sent to provider
Quality Local: lower (smaller model) · Hosted: full model
Speed Local: limited by your GPU · Hosted: fast

Be realistic: a model that fits your PC is smaller than the hosted DeepSeek, so quality and speed are lower. Local wins decisively on privacy and zero API cost; it doesn’t win on raw capability. For the hardest tasks, the hosted API is cheap enough that many people use local for sensitive work and hosted for everything else.

WSL or native?

Ollama runs on native Windows and in WSL. If your GPU drivers are set up for WSL, either works; native Windows is the simplest for GPU access on most setups. The router config is identical.

Troubleshooting

  • Slow or out of memory — the model is too big for your hardware; pull a smaller/quantized variant.
  • Claude Code can’t connect — Ollama isn’t running, or the port/URL is wrong.
  • Poor results — expected with small local models; escalate hard tasks to the hosted API.
  • Config not applied — run ccr restart.

Local DeepSeek + Claude Code checklist

  • Ollama installed and running
  • A DeepSeek model pulled that fits your hardware
  • Claude Code Router provider pointed at localhost:11434
  • Launched with ccr code
  • Hard tasks optionally routed to the hosted API

Wrapping up

Running DeepSeek locally with Ollama and Claude Code gives you private, offline coding with no API bill: install Ollama, pull a model that fits your hardware, and route Claude Code to localhost:11434 via Claude Code Router. The trade-off is honest — local quality is lower than the hosted model — so it shines for privacy and free background work, with the cheap hosted API there for hard tasks.

For another local route, see run Qwen3-Coder locally with LM Studio and self-hosted coding agent on Windows.

Frequently asked questions

Can I run DeepSeek locally and use it with Claude Code?

Yes. Run a DeepSeek (or DeepSeek-distilled) model in Ollama, which exposes an OpenAI-compatible endpoint, then route Claude Code to it with Claude Code Router. Everything stays on your machine — no API bill and full privacy.

What hardware do I need?

It depends on the model size. Smaller distilled models run on a decent CPU or modest GPU; the full large DeepSeek models need a strong GPU or lots of RAM. Pick a model size that fits your machine — Ollama lists quantized variants to help.

Is a local model as good as the DeepSeek API?

Usually not — the full hosted DeepSeek models are larger than what most local machines can run, so local quality is lower. Local is about privacy and zero API cost, not matching the hosted model's top-end capability.

Why route through Claude Code Router?

Ollama speaks the OpenAI format, not Anthropic's. Claude Code Router translates, so you add Ollama as a provider in its config and Claude Code talks to your local model normally.

Does it cost anything?

No API bill — you pay only in hardware and electricity. The tools (Ollama, Claude Code, the router) are free. That's the appeal: private, offline-capable coding with no per-token cost.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.