How to Run an Open-Source Coding Model Locally with Ollama
A step-by-step guide to running Qwen2.5-Coder, Devstral or DeepSeek-Coder-V2 on your own machine with Ollama and connecting it to your editor.
● Conductor users: the cloud service shuts down November 20, 2026. Back up and switch to CoderBaba →
#local-ai · 2 posts
Everything about running AI coding models locally, including hardware, runtimes like Ollama, llama.cpp and vLLM, quantization, privacy and performance tips.
A step-by-step guide to running Qwen2.5-Coder, Devstral or DeepSeek-Coder-V2 on your own machine with Ollama and connecting it to your editor.
Parameters, MoE, context windows and licenses all matter when you choose an open coding model. A practical checklist for developers and teams.
Running a model on your own hardware turns AI from a metered service into a tool you own. The benefits compound the more you use it:
The single most important number is how much memory your accelerator can use. The whole model, plus its context cache, should fit in fast memory:
Token generation speed is mostly limited by how fast weights can be read from memory. That's why high-bandwidth GPUs and Apple's Max and Ultra chips generate much faster than CPUs with the same capacity.
Mixture-of-experts models such as Qwen3-Coder and DeepSeek-Coder-V2 compute only a fraction of their weights per token, so they generate quickly if you can fit them. Their total size still sets the memory requirement.
| Runtime | Best for | Notes |
|---|---|---|
| Ollama | Getting started, laptops, Macs | One-command install, model library, OpenAI-compatible API |
| llama.cpp | Maximum control, CPUs, edge devices | The engine many tools build on, using GGUF quantized models |
| LM Studio | A desktop GUI | Browse, download and chat with models, and serve a local API |
| vLLM | GPU servers, teams | High-throughput serving with batching, ideal for sharing one endpoint |
| SGLang | GPU servers, agent workloads | Fast serving with strong support for structured and multi-turn workloads |
Almost all of them expose an OpenAI-compatible API, so editors and agents that work with hosted APIs can usually be pointed at your local server by changing a base URL.
Quantization trades a little quality for a lot of memory. For coding:
If you have spare memory, moving from 4-bit to 5-bit or 8-bit is often a cheaper quality boost than moving to a bigger model.
localhost unless you deliberately want network access, and put authentication in front of anything exposed beyond your machine.New to local AI? Follow How to Run an Open-Source Coding Model Locally with Ollama, then browse the model directory to find a model that fits your hardware. Posts tagged #local-ai are listed above.
The laptop setup (16 GB). A small coding model of about 1.5B parameters handles autocomplete and a 7B model handles chat, both served by Ollama. It's enough for everyday completion, explanations and small refactors, and it works offline on a plane.
The workstation setup (24 GB GPU). A 14B to 24B model at 4-bit handles chat and agent tasks, and a small model stays loaded for autocomplete. This is the sweet spot for running an open-source agent on real tasks at a comfortable speed.
The team server (48 GB+ or multiple GPUs). vLLM serves a 32B dense model or a mixture-of-experts model to the whole team over an OpenAI-compatible API, with authentication in front. Developers point their editors and agents at the shared endpoint, and their code stays inside the company network.
All three setups use the same tools and the same API, so you can start on a laptop and move up without changing your workflow.
The software and models are free to download, and there are no per-token charges. You pay for hardware and electricity. If you already own a recent Mac or a gaming GPU, the extra cost of running coding models is small compared with a heavy-usage API bill.
Yes. A modern laptop with 16 GB of RAM runs 7B models well, which is plenty for autocomplete and everyday chat. A 32 GB or larger Apple Silicon laptop can run 20B to 30B models, including agent-capable ones like Devstral.
The best hosted models still lead on the hardest problems. For routine work, such as autocomplete, explanations, refactors, tests and well-scoped bug fixes, modern open models of 14B and up are often good enough. Many developers use local models by default and reach for a hosted model only when needed.
Yes. Run vLLM or SGLang on a GPU server inside your network and give everyone the endpoint URL. That keeps code inside the company while sharing the hardware cost.
llama.cpp is the low-level inference engine. Ollama builds on that kind of engine and adds a model library, simple commands and a background server. Start with Ollama for convenience, and use llama.cpp directly when you need fine-grained control or unusual hardware.