Ollama, LM Studio, and llama.cpp: Which Software for Local Models

A local model is not just a file with weights; it is also the engine that runs it. The engine determines how many flags you can tweak, how fast generation runs, and how many users the service can take. Practitioners work with three layers of software: Ollama for a quick start, LM Studio for those who prefer an interface, and llama.cpp for full control. Above them sit server-grade engines such as vLLM, built for multi-user load. We break down which tool suits which case, with real commands and flags from hands-on practice. The software state described here is current as of fall 2026.

Ollama: A Start in Five Minutes

Ollama is a wrapper around llama.cpp: it installs with a single command, registers itself as a service, and survives a reboot. The installer tells you on its own whether a GPU has been detected, so you will not have to diagnose the system before the first launch. Two lines are enough to download a model and open it in a chat:

ollama pull deepseek-r1:8b
ollama run qwen3:8b

The first line pulls the weights from the catalog, the second opens a conversation. The service listens on port 11434, but only on localhost — to expose it you put a proxy in front: in practice this is nginx, which forwards requests from port 80 to the local address, after which the model can be reached by hostname. If you connect the Open WebUI web interface to the service, add the machine’s address and port manually in the connection settings — automatic discovery does not always work.

A practical rule for estimating size: the “size” of a model in Ollama is roughly the amount of RAM it will occupy, plus 1–2 GB of headroom for the system and buffers. A live check matches: an 8B model weighs a little over 5 GB, a 14B model about 9 GB. How to compute the upper bound for your amount of memory before buying hardware is covered in the RAM formula for model sizing.

The downside of this approach: important settings are hidden under the hood. When you need to understand why a model is slow — how many layers went to the GPU, how many threads are busy, which quant is actually loaded — the wrapper gets in the way: individual flags are out of reach. For a first acquaintance this is not a problem; for performance tuning it already is.

llama.cpp: Control Over Every Parameter

When speed matters, people go to the original: cloning the repository with Git and building from source is the standard path in CPU-server practice — for example, a build on two Xeon E5-2680v4 CPUs with 128 GB of DDR4, which we described in the article on a 128 GB CPU server. The server starts with the flags in plain view:

./llama-server -m model-Q4_K_M.gguf -ngl 99 --threads 28 --numa

Here -ngl sets how many model layers go to the GPU, –threads is the number of CPU threads, and –numa enables work with a multi-socket board. One detail people trip over: NUMA mode itself is enabled in the BIOS, it is off by default, and without that step the flag is pointless. Data travels between sockets over a separate bus, and access to “foreign” memory is slower — on a dual-socket system, plan how the model is laid out across the processors in advance.

There are two metrics: PP (prompt processing — how fast the prompt is processed) and TG (token generation — generation speed). The standard measurement is done with llama-bench, an average of three runs on a synthetic workload of 512 prompt tokens and 128 expected generation tokens. Test hyper-threading separately on your own hardware: in practice it barely moved generation, and for the Qwen Coder coding model it made generation worse, while prompt processing improved. Another tip from the same experience: if you have enough RAM, run the model on a dedicated socket — for smaller models this is optimal, and several models can be spread across different sockets.

GGUF Quantization: Q4_K_M as the Compromise

Models in GGUF format come in quants, and choosing a quant is the first way to fit a model into the available memory. Reference points from practice: Q8 is nearly lossless in quality; Q6_K suits heavy dense models; Q4 and Q4_K_M are for fitting a dense model of about 30B into 32 GB of VRAM with headroom for context. With Q4_K_M, one parameter takes roughly 0.6 bytes — about 5 bits per weight; Q8 is almost a full byte.

But “a 30B in Q4 is always smarter than a 14B in Q8” does not hold in every case: the result depends on the architecture and the task, so a quant choice is verified on your own prompts, not on paper. A reference measurement from practice: in llama-bench on a single V100, Qwen3 14B in Q4 delivered about 41 tokens/s. A separate note on compute: BF16 is a compute format, not a weight storage format, and the absence of native BF16 in older architectures does not rule out Q4–Q8 quants — the engine uses suitable kernels and intermediate formats.

LM Studio and OneCat vLLM

LM Studio is the desktop option with an interface: a catalog of GGUF models, a chat, and a local server in one window. This is the path for those who do not get along with the command line: you pick a model from a list and adjust settings without a terminal. Small models pair well with LM Studio — we described which tasks they can handle in the article on small models and real jobs.

When one machine and one user are not the end of the story, people turn to vLLM-compatible servers: several requests in parallel and a compatible API for external applications. OneCat vLLM is a fork of vLLM (version 1.5.1): it installs into a conda environment with Python 3.12, requires CUDA 12.8, glibc 2.38 or newer, and a compiler with a build system — the engine compiles some operators right at runtime. The package ships with a checksum file: do not skip the integrity check, it takes seconds.

The chat connects through Open WebUI: via localhost if the interface runs on the same server, otherwise via the server’s IP — the connection is added in the settings. Two operational quirks: the first request after startup (a “cold start”) is noticeably slower than the rest, and only one model lives in memory at a time — switching requires time to load the weights. Parallel requests, however, look good: small MoE models serve several users at once, at the cost of a shorter context per user.

MoE Models: Expert Offload, a Community Technique

In MoE models only a small share of the experts works on each token — in Qwen3-30B-A3B about 3.3 billion of the 30 billion parameters are active — so the unused experts do not have to sit on the GPU. In llama.cpp the mechanism arrived through community patches: #29887 adds an expert cache in VRAM (off by default, enabled with a separate parameter; on an RTX 5090 it raised speed from 38.8 to 67.8 tokens/s), and #30966 handles part of the cache misses directly on the CPU. The second technique has a limit of applicability: with a cache of about 6 GB the speedup went from 24 to 47.6 tokens/s, but with a cache of about 19 GB the processor started to interfere — 65.5 tokens/s without CPU handling versus 54.1 with it. Tune the share of load given to the CPU for your own system: every machine has its own inflection point.

In current builds, expert offload to the CPU is available through the -cmoe flag; check the exact form in the help of your build — the technique evolves fast, and parameter names change. Projects like TANDEM.CPP push this line further by adding an expert cache over an SSD as well: we have a separate breakdown of hybrid VRAM and RAM schemes. If you are choosing a model for MoE scenarios, start with the Qwen 3.8 family guide — it covers the full and active parameter counts of the entire lineup.

Frequently Asked Questions

What should you install first? Ollama — to find out whether local models are for you at all: two commands, and you have a working chat. llama.cpp — when you hit the limits of its settings or its speed. If you are still deciding whether to keep models locally in the first place, start with the beginner’s guide to local LLMs.

Is Ollama slower than llama.cpp? The engine under the hood is the same; the difference lies in the available flags and the level of control, not in magic. With default settings the numbers will be close, but squeezing the maximum out of specific hardware is only possible through the original.

Which quant should you take? Q4_K_M as the working compromise; Q8 for small models and tasks where quality is critical. Extreme quants save memory, but the price is quality — check aggressive cuts on your own prompts.

What about a server for a team? vLLM-compatible engines: several requests in parallel and a compatible API. On small-class MoE models, one such server serves several users at the same time — provided the context per user is shortened.

The bottom line: Ollama is the start, LM Studio is the interface, llama.cpp is control, and vLLM forks are server-grade load. These layers are not competitors but steps on a ladder: some practitioners go through all of them within a year. Action: install Ollama, download an 8B model, then measure speed with llama-bench on your own hardware — those numbers will become the baseline for every decision about memory and cards. The software state described is current as of fall 2026.

Like this post? Please share to your friends:
11AI - Your Free LLM
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: