← All guides

Local LLM Coding Setup on Windows + NVIDIA: The Guide Mac Tutorials Skip (July 2026)

Almost every local-LLM tutorial in circulation is written on a Mac. If you are on Windows with a gaming GPU — a 3060 12GB, a 4060 Ti 16GB, a 3090 or 4090 — the Apple Silicon guides tell you nothing useful, and the Linux ones assume you are happy to install WSL and Docker first. You do not need either. This is the Windows-native path: pick a runtime, confirm the GPU is actually being used, fit the model to gaming-class VRAM, and point a coding agent at it.

Stuck getting a local model running on Windows?

See our AI training options. We'll get a local model wired into OpenClaw on your Windows machine, free.

🎮 THE CARDS THIS GUIDE IS WRITTEN FOR

A gaming GPU you already own is a fine starting point. 12–16 GB runs 35B-class MoE models with expert offload; 24 GB holds them outright and gives you real context headroom.

Amazon affiliate links — we earn a small commission at no cost to you.

Bottom Line (July 2026)

  • You do not need WSL or Docker. Ollama, LM Studio, and llama.cpp all ship native Windows CUDA builds. Community WSL+Docker setups exist for specialized builds; they are optional.
  • Pick by how much control you want. Ollama is the fastest to a working model. LM Studio gives you a GUI to see what is happening. llama.cpp gives you the flags that make a small card punch above its weight.
  • Verify the GPU is engaged before you tune anything. Watch Dedicated GPU memory in Task Manager. Single-digit tokens/sec means you are silently on CPU.
  • 12–16GB cards are not shut out. MoE models like Qwen 3.6 35B-A3B run on them via expert offload — a 3060 12GB is community-reported at ~51–53 tok/s.
  • Match your KV cache types. Community gotcha: --cache-type-k and --cache-type-v set to different types can silently stop using the GPU.
  • Laptop 4090 is 16GB, not 24GB. Plan against the real number, and expect thermal drift on long runs.

Why Windows Users Keep Getting Lost

The complaint shows up constantly in local-LLM threads, and it is fair:

“bruh im on windows and idk what and how to setup it properly… with these tutorials im just lost”

“Please make a guide without vps/docker+wsl bs in windows”

Both are community-reported, and they describe a real gap. The people writing tutorials are largely on Apple Silicon, where unified memory changes the entire calculus. The people asking — the ones posting spec dumps hoping someone will tell them what to run — are overwhelmingly Windows gamers with an RTX 3060 12GB, a 4060 Ti or 5060 Ti 16GB, a 4090 laptop, or a 3090/4090 with 24GB.

Those are good machines for this. Nothing about the hardware is the problem. The problem is that the instructions were written for a different computer.

Step 1: Pick a Runtime

Three real options on Windows. All three are native — you install them like any other Windows app.

RuntimeBest forTrade-off
OllamaGetting a model answering in ten minutesFewer knobs; MoE offload control is limited
LM StudioSeeing VRAM, layers, and context in a GUIHeavier install; still a wrapper
llama.cppSqueezing a big model onto a small cardCommand line; you own the flags

Start with Ollama or LM Studio. Get any model generating text on your GPU first. That proves your driver, your CUDA path, and your VRAM budget all work. Only then move to llama.cpp, and only if you need the offload flags.

Ollama on Windows:

winget install Ollama.Ollama
ollama run qwen3.6:8b

llama.cpp on Windows: download the prebuilt CUDA release from the project’s GitHub releases page, unzip it somewhere without spaces in the path, and run llama-server.exe from a terminal in that folder. No build toolchain needed for the standard CUDA builds.

You will see community setups that run llama.cpp inside WSL with Docker — usually to reproduce a Linux-only build such as turboquant-style quantization pipelines. That is a legitimate reason to reach for WSL. It is not a requirement for running a model, and it is not where you should start.

Step 2: NVIDIA Specifics

Update the driver first. Not the one that shipped with the card. New model architectures and new CUDA builds routinely need a recent driver, and “it loads but crawls” is a common symptom of an old one.

Get a CUDA build, not a CPU build. llama.cpp publishes several Windows binaries per release. The CPU-only one will run your model perfectly well and use none of your GPU. This catches people constantly.

Then verify the GPU is actually engaged. This is the step that separates a working setup from three days of confusion. Open Task Manager → Performance → your GPU, and watch Dedicated GPU memory while the model loads. It should climb by roughly the size of the model file.

nvidia-smi --query-gpu=memory.used,memory.total,utilization.gpu --format=csv -l 1

The fastest tell is your tokens-per-second number. Single-digit tok/s on a modern NVIDIA card means you are on CPU, whatever the logs imply. A card in this class running a sane quant should be in the tens.

The KV cache gotcha. Community-reported and genuinely nasty: set --cache-type-k and --cache-type-v to the same type. Mixing them — a quantized K cache against an f16 V cache — can silently drop the GPU path and leave you CPU-bound with no error printed. If your speed collapsed immediately after you touched cache flags, that is the first thing to undo.

--cache-type-k q8_0 --cache-type-v q8_0

Also worth knowing before you reach for those flags at all: f16 KV cache is faster than q8_0 whenever it fits. Quantized cache is a memory feature, not a speed feature.

Step 3: Fit the Model to a Gaming Card

A 12GB or 16GB card cannot hold a 35B dense model. It can run a 35B Mixture-of-Experts model, because only a few billion parameters are active per token — the expert weights can sit in system RAM while attention stays on the GPU.

That is what makes Qwen 3.6 35B-A3B viable on a 3060 12GB. Community-reported config and result: 32GB of DDR5, IQ4_NL quant, 64K context, roughly 51–53 tokens/sec.

llama-server.exe ^
  -m .\qwen3.6-35b-a3b-IQ4_NL.gguf ^
  -ngl all ^
  --n-cpu-moe 25 ^
  --flash-attn on ^
  --no-mmap ^
  -c 65536 ^
  --host 127.0.0.1 --port 8080

On a 16GB card (4060 Ti 16GB, 5060 Ti 16GB, 4080, laptop 4090) start around --n-cpu-moe 20 and sweep downward. The rule is: lower the number until speed collapses, then step back up one. That collapse is a VRAM spill into system memory, and on Windows it usually arrives without an error message — just a sudden 2-3x slowdown.

Do not copy anyone’s number, including these. Your quant, RAM speed, and context length are not theirs. The full explanation of each flag and the sweep method is in llama.cpp MoE offload flags explained.

One more thing that bites Windows users specifically: set your context size to what you actually need before you tune. The KV cache lives in VRAM, so a context window you never use is expert layers you could have had on the card.

Step 4: Wire a Coding Agent to It

Both Ollama and llama.cpp’s llama-server expose an OpenAI-compatible endpoint. That is the universal adapter — most coding harnesses will accept a base URL and a model name.

:: llama-server
http://127.0.0.1:8080/v1

:: Ollama
http://127.0.0.1:11434/v1

In practice you set two environment variables and point the tool at your box:

setx OPENAI_BASE_URL "http://127.0.0.1:8080/v1"
setx OPENAI_API_KEY "local"

Open a new terminal after setx — it does not affect the one you typed it in.

For Claude-Code-style tools that speak the Anthropic message format rather than the OpenAI one, llama.cpp has a native Anthropic-style /v1/messages endpoint (community-reported). That removes the need for a translation proxy in the middle, which used to be the standard workaround and was a common source of tool-calling breakage.

Expect tool calling to be the shakiest part of a local setup regardless of runtime — it is the capability that degrades first at small sizes and low quants. Local LLM tool calling reliability covers which failures are the model’s fault and which are the harness’s.

Laptop GPU Caveats

Laptop cards carry the same names as desktop cards and different hardware.

  • A laptop RTX 4090 has 16GB, not 24GB. Plan your quant against 16.
  • Power limits are real. The same chip at 80W and at 150W are different products. Plug in, and set the Windows power mode to Best performance before benchmarking.
  • Thermals drift. Your first 30 seconds of generation is not your sustained speed. Run a long generation before you trust a number.
  • Hybrid graphics. Confirm the discrete GPU is the one doing the work, not the integrated one. Task Manager lists both.

Windows Troubleshooting

SymptomLikely causeFix
Model loads, generates at single-digit tok/sSilent CPU fallback — CPU-only build or stale driverCheck Dedicated GPU memory in Task Manager; reinstall the CUDA build; update the driver
Was fast, suddenly 2-3x slower, no errorVRAM spill into shared system memoryRaise --n-cpu-moe one step, or lower -c
Speed collapsed right after changing cache flagsMismatched K and V cache typesSet --cache-type-k and --cache-type-v to the same value, or drop both
Model file will not load or the path errorsSpaces in path, long-path limit, or backslash quotingMove the model to a short path like C:\models\ and quote it
Very slow first load, or the binary vanishesAntivirus scanning a multi-GB file or quarantining an unsigned binaryAdd the model folder and runtime folder to exclusions
Agent connects but tool calls failEndpoint format mismatch, or model too small for reliable tool useTry the native /v1/messages endpoint; step up a size or quant
System RAM pegged near 100%mmap double-counting a large CPU-resident expert setAdd --no-mmap

Not sure what your card can actually hold?

The local LLM calculator shows which models and quants fit your VRAM with context headroom, so you download once instead of three times.

Need OpenClaw fixed live?

Remote rescue sessions for gateway, auth, tunnel, VPS, and model access problems.

See Rescue Session

Read next

Context Window Traps (July 2026): Why Your Local Agent Breaks After 10 Prompts
Ollama's default context is far below what an agent harness needs. The system prompt and tool schemas alone eat 15-20K tokens, so a 4-8K window silently truncates your tools. How to check it, set it, and budget the KV cache VRAM.
llama.cpp MoE Offload Flags Explained (July 2026): Run 35B Models Fast on a Mid-Range GPU
What -ngl, --n-cpu-moe, --flash-attn, --no-mmap and KV cache quant actually do. Community-reported: Qwen 3.6 35B-A3B at ~51-53 tok/s on an RTX 3060 12GB, 60 tok/s on a 4080.
Ollama vs LM Studio vs llama.cpp vs oMLX: Which Local LLM Runtime in 2026
Four local LLM runtimes, four different users. Ollama is the easy default, LM Studio is the GUI, llama.cpp gets features first, MLX is fastest on Apple Silicon with model coverage gaps.
Can a Four-Bit Local Model Actually Ship a Feature? Pi Says Yes
I made a video testing Pi, the minimal coding agent people have been raving about, with a local model. A four-bit model running on a laptop sounds like it should struggle to edit a real file, but in my test it added a working dark-mode toggle without help. Here is the gist, the s