Why Start from Quantization Tiers
Local deployment is not zero-cost; it shifts cost from per-token billing to VRAM and electricity. On the same GPU, a Q4-quantized model usually produces several times more tokens than FP16, which means your marginal cost per token is set directly by the quantization tier. As of 2026, Ollama ships built-in pull and resident management for GGUF quantized models, and vLLM stably supports AWQ, GPTQ, and FP8 with continuous batching. Together they form a token supply line that depends on no external quota.
Steps
Step 1: Pick a quantization tier from your VRAM budget
Check available VRAM (nvidia-smi), then estimate from rules of thumb:
- 7B–9B models: Q4_K_M needs roughly 5–7 GB, Q8 roughly 9–11 GB, FP16 roughly 16–18 GB.
- 13B–14B models: Q4_K_M roughly 9–11 GB, Q8 roughly 15–17 GB.
- 30B-class models: Q4_K_M typically needs 20 GB or more; a single consumer GPU often forces a lower tier or a small-active-parameter MoE model.
Rule: leave about 1–2 GB for KV cache and context. Longer context means larger KV cache; do not skip this.
Step 2: Build a local model cache with Ollama (daily inference)
- After installing Ollama, use
ollama pullwith a quantized tag, e.g. a model tag suffixed:q4_K_M. - Use
ollama listto confirm the local cache; model files live under Ollama's models directory and can be reused offline or copied to other machines. - To expose an OpenAI-compatible endpoint, start the Ollama service (default port 11434) and point your client's base_url at
http://localhost:11434/v1. - Run a smoke test with
ollama runto confirm first-token latency and generation speed.
Applies to: single machine, low concurrency, interactive use. Limits: Ollama's concurrent scheduling is limited and unsuitable for high-concurrency batch jobs.
Step 3: Load quantized weights with vLLM (batch throughput)
- Install vLLM (prefer the official container image to avoid CUDA version mismatches).
- Specify quantization at launch, e.g.
--quantization awqor--quantization gptq, and set--max-model-lento control context length. - Use
--gpu-memory-utilization(commonly 0.85–0.92) to cap VRAM usage and leave headroom. - vLLM enables continuous batching by default, good for feeding offline jobs in bulk; it also exposes an OpenAI-compatible
/v1/chat/completions. - Benchmark with
vllm benchor a simple concurrency script, recording throughput (tokens/s) and P99 latency.
Applies to: many requests, offline batch processing, stable throughput. Limits: it fails to start when VRAM is insufficient, and the quantization format must match the weights; do not mix them.
Step 4: Convert 'free tokens' into comparable metrics
Record three numbers: throughput per GB of VRAM (tokens/s/GB), energy per thousand tokens (sampled via a power meter or nvidia-smi), and first-token latency. Compare quantization tiers by these, not by parameter count alone.
Step 5: Layered scheduling
Route interactive requests to Ollama and batch jobs to vLLM, sharing the same model cache directory (or at least the same downloaded weights) to avoid duplicate downloads. On the client side you only switch base_url and model name.
Caveats
- Quantization loses quality. Q4 is usable for most tasks, but for strict math and code reasoning prefer at least Q8 or a larger model at a small tier.
- vLLM's quantization support is tightly coupled to model architecture; some new architectures may not be adapted yet. Check the docs for your version before launching.
- VRAM estimates are rules of thumb; trust startup logs and benchmark results.
- 'Free' local deployment still includes electricity and hardware depreciation; account for this under sustained load.
- Check model licenses; some weights are research-only or restrict commercial use.
Use Cases
- Internal Q&A, document summarization, and code completion at low-to-medium concurrency.
- Compliance scenarios where data must not leave the intranet.
- Queueable jobs such as batch data cleaning, labeling assistance, and offline evaluation.
- A fallback for external APIs when the primary key is unavailable.