Deploying Small Language Models

Running a fine-tuned small language model in production — llama.cpp, vLLM and Ollama, quantization formats, VRAM requirements, and on-device inference.

The reason to train a small model is usually that you want to run it somewhere a frontier API cannot go: inside your own network, on a device, under a latency budget that a network round trip already blows. Deployment is where that pays off, and it is a genuinely different set of concerns from training.

Pick the runtime for the constraint

The three common runtimes solve different problems.

llama.cpp runs quantized models on CPU or GPU with minimal dependencies. It is the right answer for on-device, edge, and air-gapped deployments, and for anything that has to ship as a single binary.

Ollama wraps llama.cpp with model management and a local HTTP API. Best for local development and internal tools where convenience matters more than throughput.

vLLM is built for serving throughput — continuous batching, efficient KV cache handling, high concurrency. It is the right choice for a service handling real request volume, and overkill for a laptop.

The decision is usually made for you by where the model has to run rather than by preference.

Quantization is the main lever

Quantization reduces the numerical precision of the weights. A model stored at 4 bits per weight is roughly a quarter the size of the same model at 16 bits, and correspondingly faster to load and cheaper to keep in memory.

The trade is accuracy, and the shape of that trade is not linear. Dropping from FP16 to 8-bit is close to free on most tasks. Dropping to 4-bit costs something measurable but often acceptable, and it is what makes a 4B model fit on hardware that could not otherwise hold it. Below 4-bit the degradation becomes hard to ignore.

For a task-specific fine-tuned model the calculus is friendlier than for a general-purpose one: the model only has to do one thing, and quantization damage tends to show up first in capabilities you are not using.

Sizing

The rough working figure for VRAM is the parameter count times bytes per parameter, plus overhead for the KV cache, which grows with context length and batch size. A 1B model at 4-bit needs well under a gigabyte of weights; the same model at FP16 needs a couple. This is why the sub-1B students are interesting for device deployment — they leave room for everything else the device is doing.

CPU inference is viable for small models and genuinely useful when no GPU is available, with the understanding that throughput will be a fraction of GPU inference.

Latency is a product constraint, not just a cost

For anything interactive — a voice assistant, an autocomplete, an agent loop that makes several calls per user action — latency is the feature. A model that is accurate but takes two seconds fails a voice interaction regardless of its benchmark score. This is often the real reason to move off a frontier API, ahead of cost.

Where this cluster goes

The articles below cover each runtime with working commands, GGUF and the quantization formats, VRAM requirements by model size, realistic latency figures, the choice between self-hosted and managed inference, and air-gapped deployment.

How Much VRAM Does a 1B, 3B or 8B Model Need?

Working forwards from a chosen model size to the card that can serve it, including the KV cache term computed from published attention configs — the part that decides whether a model that loads will still run at your context length.

On-Device LLM Inference in 2026

Published throughput, footprint and accuracy figures for language models running on phones, embedded modules and commodity CPUs, each reported with the hardware and model it was measured on rather than as a general claim.

Q4 vs Q8 vs FP16 for Your SLM

A side-by-side of the three precisions you will actually choose between when serving a distilled model, with the documented bits-per-weight figures, the size arithmetic for real model tiers, and the case for each.

Self-Hosted vs Managed Inference

Comparing running your own SLM endpoint against paying someone to run it, across control, cost at volume, operational burden and data residency — with the published per-million-request figures for both sides.

What Latency Can You Expect from an SLM?

Every SLM latency figure distil labs has published, reported with the model, runtime, hardware and load it was measured under — plus why a single per-model number does not exist and what actually moves the value on your setup.

Deploy an SLM with Ollama

Loading a fine-tuned small language model into Ollama from a local GGUF or straight from Hugging Face, writing a Modelfile that preserves the training-time system prompt, and the chat-template trap specific to this runtime.

Deploy an SLM with vLLM

Serving a distilled small language model on a GPU with vLLM — environment setup, the tool-calling parser flags, querying the OpenAI-compatible endpoint, and the throughput and memory figures we measured on a single H100.

How to Deploy a Fine-Tuned Small Language Model

The four ways to put a trained SLM into service — managed endpoint, local llama.cpp, self-hosted vLLM, and an offline download — with the constraint that selects each one and the mistakes that quietly break accuracy.

Run a Fine-Tuned SLM with llama.cpp

Serving a distilled small language model through llama-server, including the exact flags the distil CLI passes, why the Jinja chat template matters, and how to confirm the endpoint is serving your model and not a default one.

Running a Small Language Model on CPU

CPU inference for a distilled SLM: how to size the model to available RAM, which quantization to run, how to set thread counts, and the published tokens-per-second figures that tell you whether your workload is realistic.

Air-Gapped and On-Premise LLM Deployment

Running a language model inside a network with no outbound internet access — why frontier APIs are structurally unavailable there, why a distilled small model fits the hardware that already exists, and what a working deployment contains.

What Is GGUF?

GGUF is the single-file binary format that packages a model's tensors and its metadata together for llama.cpp-family runtimes — what it stores, what its quantization type names mean in bits per weight, and when it is the wrong choice.

What Is Quantization?

Quantization stores model weights at lower numerical precision so the same architecture occupies less memory and streams faster — how the block-scale mechanism works, what each bit width costs, and where the damage shows up first.