# how to make your local AI faster — the settings that actually boost tokens per second

If your local model feels sluggish, it's usually one of a few fixable things. Here's how to speed up local LLM inference, from the one change that matters most to the fine-tuning.

Updated Nov 21, 2026 · By Ari Vale

This page has referral links: we earn a commission if you buy, at no cost to you.

Our Vast referral code: 623346 (link: https://cloud.vast.ai/?ref_id=623346). New users get no bonus from it; we earn 3% of what referred users spend (Vast's referral program docs: https://docs.vast.ai/guides/reference/referral-program?ref_id=623346).

## How do you make a local LLM run faster?

The single biggest thing: **make sure the whole model fits in VRAM.** If any of it spills to [system RAM](https://aliteq.com/how-much-ram-do-you-need-for-local-ai), generation slows to a crawl — this is the #1 cause of slow local AI, and fixing it (by using a smaller model or more aggressive [quantization](https://aliteq.com/what-is-quantization-llm-explained)) can take you from a few tokens per second to dozens. After that, the wins are: run **4-bit quantization**, enable **flash attention**, and for maximum speed on NVIDIA, switch to a faster engine like **[EXL2](https://aliteq.com/gguf-vs-exl2-quantization-explained) or vLLM**. Here's the practical, ordered checklist to boost your **tokens per second**.

## The short answer

Local LLMs are fast when the whole model fits in your GPU's VRAM and slow when part of it spills into system RAM. Fix that first with a smaller model, 4-bit quantization or a shorter context, then enable flash attention and use a faster engine.

- **Biggest factor:** the whole model in VRAM, or speed drops from dozens of tokens per second to single digits
- **Quantize:** 4-bit Q4_K_M is smaller and faster with near-zero quality loss
- **Flash attention:** faster generation and lower memory, usually one setting
- **Engine:** EXL2 on NVIDIA or vLLM for serving beat llama.cpp on raw speed

## The speed checklist (in order of impact)

- **1. Fit the whole model in VRAM** — the biggest factor. Spilling to system RAM is what makes local AI slow.
- **2. Use 4-bit quantization** (Q4_K_M) — smaller model, more fits in VRAM, faster.
- **3. Enable flash attention** — a more efficient attention algorithm, faster and lower memory.
- **4. Use a faster engine** — [EXL2](https://aliteq.com/gguf-vs-exl2-quantization-explained) (NVIDIA) or vLLM beat llama.cpp on raw speed.
- **5. Shorten your context** — long context uses more memory and slows generation.
- **6. Or just get more VRAM** — a [faster GPU with enough memory](https://aliteq.com/best-gpu-for-local-ai) is the hardware fix.

## The one fix that matters most

Before any tweak, check the thing that dominates everything else: **is the entire model loaded into VRAM?** When a model fits fully on the GPU, it runs fast. When it doesn't, part of it lives in system RAM and the GPU has to shuttle data across the slow PCIe bus for every token — and speed falls off a cliff, from dozens of tokens per second to single digits. So if your model feels sluggish, the first question isn't 'what setting do I change', it's **'does this model actually fit my [VRAM](https://aliteq.com/how-much-vram-do-you-need-to-run-ai-models)?'** The fix is to either run a **smaller model**, use **more aggressive [quantization](https://aliteq.com/what-is-quantization-llm-explained)** (drop from Q5/Q8 to Q4 to shrink it), or **shorten your context** (which frees VRAM). Getting the model fully on the GPU is worth more than every other speed trick combined — check what fits in the [VRAM calculator](https://aliteq.com/tools/vram-calculator) first.

![Motion and speed visualization](https://media.aliteq.com/media/2026/07/b20-speed-body.jpg)
The #1 speed fix: get the whole model into VRAM. Spilling to system RAM is what makes local AI crawl. · Unsplash

## The rest of the speed toolkit

Once the model fits, these stack on top. **Quantization**: running at [4-bit (Q4_K_M)](https://aliteq.com/what-is-quantization-llm-explained) is both smaller and faster than higher precision, with near-zero quality loss — it's the default for a reason. **Flash attention**: a more efficient way to compute attention that speeds up generation and reduces memory use; most tools ([Ollama, LM Studio, llama.cpp](https://aliteq.com/ollama-vs-lm-studio-which-should-you-use)) support enabling it, and it's usually a simple flag or setting. **A faster engine**: [llama.cpp](https://aliteq.com/n-cpu-moe-llama-cpp-what-it-actually-does)/Ollama are the easy, universal choice, but if you have an NVIDIA card and want maximum speed, **[EXL2 via ExLlamaV2](https://aliteq.com/gguf-vs-exl2-quantization-explained)** is meaningfully faster, and **vLLM** is the throughput king for serving. **Shorter context**: since a long [context window](https://aliteq.com/what-is-a-context-window) uses more memory and compute per token, keeping context tight helps speed. And the honest hardware truth: if you've done all this and still want more, the answer is a **[faster GPU with enough VRAM](https://aliteq.com/best-gpu-for-local-ai)** — memory bandwidth and compute set the ceiling, and a [used RTX 3090](https://aliteq.com/used-rtx-3090-buying-guide-local-ai) or newer card raises it.

Two smaller levers people miss. A [power limit on your GPU](https://aliteq.com/power-limit-your-gpu-for-local-ai) costs surprisingly little speed while cutting heat and noise, and your [CPU matters less than you'd think](https://aliteq.com/does-your-cpu-matter-for-local-ai-ryzen-9800x3d) once the model is fully on the GPU. Mixture-of-experts models are the exception to "it must all fit": only a few billion parameters work per token, which is why [MoE models run fast even when part of them sits in RAM](https://aliteq.com/moe-vs-dense-ai-models-explained). Your operating system can also shift results a little, covered in [Windows vs Linux for local AI](https://aliteq.com/windows-vs-linux-for-local-ai).

First, know which speed is slow. If the answer takes ages to *start*, that is prefill, the model reading your prompt; if it starts quickly but types slowly, that is decode. They have different fixes. On hardware-corner.net's llama.cpp table for an RTX 3090, Qwen3 14B at Q4_K reads a prompt at 2,459 tokens a second at 4K of context but writes at 70, and both fall as the context grows (734 and 25.4 at 64K). Our [prefill vs decode explainer](https://aliteq.com/prefill-vs-decode-local-llm) shows the wait by GPU and how to keep the prompt cache working, and if speed drops over a long session, [the KV cache guide](https://aliteq.com/kv-cache-quantization-explained) explains the spill to system RAM.

**Your model still doesn't fit in VRAM?** If the model you want spills out of your card no matter how you quantize it, no setting will fix that. Rent a 24GB card by the hour on Vast.ai's marketplace, pick a verified host, and run the same model fully in VRAM. [Rent a 24GB RTX 4090 by the hour](https://cloud.vast.ai/?ref_id=623346) (Referral link: we earn a commission if you buy.) Live RTX 4090 prices on Vast.ai, from and typical: https://aliteq.com/vast-ai-pricing

How much does a card that fits cost? A 24GB [RTX 4090](https://aliteq.com/gpus/rtx-4090) started at $0.27 an hour on Vast.ai and a 24GB [RTX 3090](https://aliteq.com/gpus/rtx-3090) at $0.12 (Nov 17, 2026). Live prices for every card are on our [cloud GPU price page](https://aliteq.com/cloud-gpu), and [rent vs buy a GPU for AI](https://aliteq.com/rent-vs-buy-gpu-ai-cloud-vs-local) shows when buying wins.

**Want fast serving without the setup** Want vLLM speed without setting up a server? Runpod runs GPUs in Secure Cloud datacenters with one-click templates, and its serverless option fits apps that need an always-on endpoint. [Run a 24GB RTX 4090 on Runpod](https://console.runpod.io/signup?ref=nuninlts) (Referral link: we earn a commission if you buy.) Live RTX 4090 prices on Runpod, from and typical: https://aliteq.com/runpod-pricing

## Quick answers

**Q: Why is my local AI so slow?**

A: The most common reason is that the model doesn't fully fit in your GPU's VRAM. When part of a model spills into system RAM, the GPU must shuttle data across the slow PCIe bus for every token, and generation speed collapses from dozens of tokens per second to single digits. Fix it by running a smaller model, using more aggressive quantization (Q4 instead of Q5/Q8) to shrink it, or shortening your context to free VRAM. Getting the entire model onto the GPU is by far the biggest speed factor — check what fits before changing other settings.

**Q: How do I increase tokens per second on a local LLM?**

A: In order of impact: first, make sure the whole model fits in VRAM (the biggest factor). Then use 4-bit quantization (Q4_K_M), which is smaller and faster with minimal quality loss. Enable flash attention, a more efficient attention algorithm most tools support. For maximum speed on NVIDIA, switch from llama.cpp to EXL2 (via ExLlamaV2) or use vLLM for serving. Keep your context length tight, since long context slows generation. If you've done all that, a faster GPU with more VRAM is the hardware upgrade that raises the ceiling.

**Q: Does quantization make local AI faster?**

A: Yes. Quantization (like 4-bit Q4_K_M) shrinks the model, so more of it fits in VRAM and less data moves around, which speeds up inference — while keeping quality nearly identical to the full-precision model. It's both a memory and a speed win, and it's the standard for local AI. If a model is slow because it barely fits or spills to system RAM, dropping to a more aggressive quantization (e.g. from Q5 or Q8 to Q4) often provides a large speed boost by getting the whole model onto the GPU.

The local-AI speed formula: fit the model in VRAM first, then quantize to Q4, enable flash attention, and use a fast engine. Check what fits in the [VRAM calculator](https://aliteq.com/tools/vram-calculator), understand [quantization](https://aliteq.com/what-is-quantization-llm-explained) and [formats](https://aliteq.com/gguf-vs-exl2-quantization-explained), and if hardware is the limit, see the [best GPU for local AI](https://aliteq.com/best-gpu-for-local-ai).

Want the canonical details? OpenAI's tiktoken tokenizer is the authoritative reference — [OpenAI — tiktoken](https://github.com/openai/tiktoken).

## Sources

- [Aliteq — GGUF vs EXL2](https://aliteq.com/gguf-vs-exl2-quantization-explained-2026)
- [Aliteq VRAM calculator](https://aliteq.com/tools/vram-calculator)
- [OpenAI — tiktoken](https://github.com/openai/tiktoken)
- [hardware-corner.net, RTX 3090 LLM benchmarks, Qwen3 14B Q4_K prompt processing and token generation by context ("Updated Benchmarks: March 2026", read Nov 21, 2026)](https://www.hardware-corner.net/gpu-llm-benchmarks/rtx-3090/)

---

Canonical: https://aliteq.com/how-to-speed-up-local-llm-inference

This page has referral links: we earn a commission if you buy, at no cost to you.
