Deploying a Small LLM Locally: Quantization, RAM and Speed Trade-Offs
A small LLM runs on a laptop once quantized: an 8B model drops from about 15 GB to 4.6 GB at Q4_K_M. This guide covers levels, RAM, speed and Ollama setup.
By Galactic News Editorial · Published 2026-11-23T10:41:23+00:00 · Updated 2026-11-23T10:41:23+00:00
Deploying a Small LLM Locally: Quantization, RAM and Speed Trade-Offs
A small language model can run on an ordinary laptop. No cloud account, no API key and no data leaving the machine. The trick is quantization. It shrinks a model from 16-bit weights down to 4-bit weights, so an 8 billion parameter model drops from about 15 GB to about 4.6 GB. At that size it fits in laptop RAM and runs at usable speed. This guide explains the trade-offs, the tools to use, and the exact steps to get a model running locally.
What quantization does to a model
A language model is mostly numbers called weights. In full precision, each weight is a 16-bit float. An 8 billion parameter model then needs about 15 GB of memory just for the weights. Quantization stores each weight with fewer bits. A 4-bit version of the same model needs roughly a quarter of the space. The cost is precision. Some detail is lost when a 16-bit number is rounded to 4 bits. In practice the quality loss is small at moderate levels. The community standard is Q4_K_M, a 4-bit format that keeps most of the model's quality while cutting the size to about a quarter. The llama.cpp project publishes a size table for Llama 3.1 8B that shows the ladder clearly. Full precision F16 is 14.96 GiB. Q8_0 is 7.95 GiB. Q6_K is 6.14 GiB. Q5_K_M is 5.33 GiB. Q4_K_M is 4.58 GiB. Lower levels exist, such as Q3_K_M and Q2_K, but quality drops faster below 4 bits. The file size is roughly the parameter count times the bits per weight, divided by eight. An 8B model at 4 bits is about 4 GB. A 70B model at 4 bits is about 40 GB. That simple maths decides what fits on your machine before you download anything.
Deploying small LLM locally quantization: picking a runner
Two tools cover nearly every local deployment. Ollama is the easy path. It is built on llama.cpp and adds downloading, model management and a local API. Install it, run one command, and the model downloads and starts. The Ollama model library lists ready-to-run models such as Llama 3.1 8B at 4.7 GB, Gemma 2 9B at 5.5 GB and Mistral 7B at 4.1 GB. Ollama serves an OpenAI-compatible API on port 11434, so any tool that speaks that API can use the local model. It also reads GGUF files directly from Hugging Face, and a Modelfile can point at a local GGUF file to create a custom model. Llama.cpp is the deeper path. It is the C and C++ inference engine underneath Ollama, and it gives full control over GPU offload, context length and sampling. Its llama-server binary serves a chat interface and an OpenAI-compatible endpoint. The flag -ngl 99 pushes layers onto the GPU. The flag -c sets the context window. Llama.cpp also converts models from Hugging Face format to GGUF and quantizes them with its quantize tool. Choose Ollama when you want a model running in minutes. Choose llama.cpp when you need to tune offload, run a server with exact settings, or quantize your own models.
Quantization levels compared
| Quantization | Bits per weight | Size for an 8B model | Quality | Speed | When to use it |
|---|---|---|---|---|---|
| F16 | 16 | 14.96 GiB | Full | Slowest, most memory | Quality baseline or GPU with plenty of VRAM |
| Q8_0 | 8.5 | 7.95 GiB | Near full precision | Slower | When RAM allows and quality matters most |
| Q6_K | 6.6 | 6.14 GiB | High | Moderate | A step up from Q4 when memory allows |
| Q5_K_M | 5.7 | 5.33 GiB | Better than Q4 | Moderate | Good balance on machines with 16 GB RAM |
| Q4_K_M | 4.9 | 4.58 GiB | Good, close to full precision | Balanced | Default choice for laptops and small servers |
| Q3_K_M | 3.5 | About 3.3 GiB | Noticeable loss | Fast | Very low memory machines, casual use |
| Q2_K | 2.6 | About 2.8 GiB | Low | Fastest | Only when nothing else fits |
Bottom line: start with Q4_K_M. It is the default for a reason. Move up to Q5_K_M or Q8_0 if you have spare memory and want more quality. Move down only when the model will not fit otherwise.
RAM and speed: what actually limits you
Memory decides what runs. Speed decides whether it is pleasant. Ollama's own guidance is a good starting point. Allow at least 8 GB of RAM for 7B models, 16 GB for 13B models and 32 GB for 33B models. That is the whole machine, not just the model file. The operating system, the context window and the generation cache all need memory too. Context length adds up. Ollama sets default context windows by available VRAM: 4k tokens under 24 GiB, 32k from 24 to 48 GiB, and 256k at 48 GiB or more. Required RAM scales with the number of parallel requests times the context length. A long context on a small machine is the most common cause of slow output. GPU offload changes the speed picture completely. A model that fits fully in GPU memory generates far faster than one split between GPU and CPU. Run ollama ps to see the split. If the processor column shows a CPU share, the model does not fully fit in VRAM, and a smaller quantization will help. On CPU alone, a 7B model at Q4_K_M runs, but slowly. Expect single-digit tokens per second on an older laptop CPU, which feels sluggish for long answers but is fine for short ones. Apple Silicon machines do well because their unified memory lets the GPU use system RAM. A Mac with 16 GB of unified memory runs a 7B Q4 model comfortably. Models also unload. Ollama keeps a model loaded for five minutes by default, then unloads it to free memory. The next request reloads it, which takes a few seconds.
Deploying a small LLM locally in six steps
- Check your memory. Find your free RAM or VRAM. Pick a model size that fits with room to spare. A 7B or 8B model at Q4_K_M is the safe first pick on most machines.
- Install Ollama. On Linux, run the install script from the Ollama site. On macOS, download the app. On Windows, use the installer. Verify with ollama --version.
- Run your first model. Run ollama run llama3.1 for an 8B model, or ollama run gemma2 for a 9B model. Ollama downloads the model and opens a chat. Type a question to confirm it works.
- Try a GGUF file from Hugging Face. Run ollama run hf.co/bartowski/gemma-2-9b-it-GGUF:Q4_K_M to pull a specific quantization. The tag after the colon picks the file inside the repository.
- Call the API. Send a request to http://localhost:11434/api/chat with a model name and a message. Any tool that speaks the OpenAI-compatible API can point at this endpoint.
- Lock the server down. Ollama listens on localhost by default, which is what you want. Do not expose port 11434 to a network unless you add authentication in front of it. An open model server is an open compute bill.
When local wins, and when it does not
Local deployment wins on privacy, cost and offline use. Prompts never leave the machine, which matters for personal notes, client data and anything under a confidentiality duty. The cost is the hardware you already own. There is no per-token bill. And the model works on a plane, in a basement or during an outage. The cloud wins on capability and convenience. The largest models are far beyond what a laptop can run. A 70B model at Q4 needs about 40 GB of memory. A 405B model needs about 231 GB. Those run on servers, not laptops. The cloud also handles updates, scaling and uptime. A sensible split is common. Use a local small model for drafting, summarising and private data. Use a cloud model for the hardest reasoning and the longest documents. The local model does not need to be the best model. It needs to be good enough for the task, private, and always available.
Bottom line
Deploying a small LLM locally is a weekend project, not a research project. Pick Q4_K_M as the default quantization. It cuts an 8B model to about 4.6 GB with little quality loss. Run it with Ollama for the easy path, or llama.cpp when you want full control. Size the model to your memory, keep the context window modest, and check the GPU offload with ollama ps. Keep the server on localhost. The result is a private model that answers in seconds, costs nothing per token, and works anywhere. Start with a 7B or 8B model, and scale up only when the hardware allows.