Quantization and On-Premise SLM Hosting: A Cost vs. Latency Benchmark
This SLM quantization benchmark shows that 4-bit methods such as AWQ and GGUF k-quant cut VRAM roughly in half versus 8-bit while moving perplexity by about 1 percent, which is why on-premise small language model hosting now beats many APIs on cost once a GPU stays busy. The tables below compare AWQ, GPTQ, GGUF k-quant, and FP8 across throughput, batch latency, quality loss, and cost per million tokens on consumer and server hardware.
SLM Quantization Benchmark: 4-Bit vs 8-Bit on Consumer and Server GPUs
Quantization compresses model weights from the 16-bit floating point format used in training down to 8-bit or 4-bit representations, trading a small amount of numeric precision for large cuts in VRAM footprint and memory bandwidth. For small language models in the 1B to 14B range that trade is almost always favorable: weights dominate memory, KV-cache headroom improves, and the quantized kernels often run faster than FP16 because bandwidth, not compute, is the bottleneck.
What each quantization method actually does
- AWQ (Activation-aware Weight Quantization) protects roughly 1 percent of salient weight channels identified from calibration activations, then packs the remaining weights to 4 bits. On NVIDIA GPUs it runs through Marlin kernels inside vLLM and posts the best 4-bit tokens-per-second in our illustrative runs.
- GPTQ quantizes layer by layer with error minimization against calibration data. Quality lands within a few tenths of a perplexity point of AWQ, and the format enjoys the widest historical tooling support across serving stacks.
- GGUF and k-quants are the llama.cpp ecosystem format. K-quant variants such as Q4_K_M and Q5_K_M scale importance per tensor type; Q4_K_M is the default quality-to-size balance and what Ollama pulls for most model tags.
- FP8 stores activations and weights in 8-bit floating point. On H100-class servers and supported RTX 40-series paths it stays close to FP16 quality while halving memory, but it never reaches the compression ratio of 4-bit methods.
Reproducible benchmark setup
All numbers in this article are illustrative and hardware-dependent. Rerun the harness on your own cards before making a purchase decision.
# vLLM serving a 4-bit AWQ model (adjust GPU ids and model path)
python -m venv .venv && source .venv/bin/activate
pip install "vllm[awq]==0.6.3"
vllm serve TheBloke/Llama-2-7B-Chat-AWQ \
--quantization awq_marlin \
--dtype float16 \
--max-model-len 4096 \
--gpu-memory-utilization 0.90
# Throughput probe: 256 prompts, 128 output tokens, concurrency 1 and 8
python bench.py --base http://localhost:8000/v1 --concurrency 1,8 \
--prompts 256 --max-tokens 128 --out results_awq_4bit.json
# GGUF path with llama.cpp for the same model class
llama-cli -m llama-2-7b-chat.Q4_K_M.gguf -c 4096 -ngl 99 \
-p "Summarize the refund policy in two sentences." -n 256
# Ollama equivalent (pulls a GGUF quant automatically)
ollama pull llama3.2:3b && ollama run llama3.2:3b
Key Takeaways
đĄ
- 4-bit AWQ fits a 7B model in about 4.6GB of VRAM versus 8.2GB at 8-bit and 15.5GB at FP16, which is roughly half the memory of 8-bit for about 0.8 percent perplexity drift (illustrative).
- Throughput roughly doubles from FP16 to 4-bit: about 110 versus 55 tokens per second at batch 1 on an RTX 4090 for a 7B model (illustrative).
- FP8 is the quality-first option on H100-class hardware, landing near FP16 quality at half the memory, but 4-bit still wins whenever VRAM is the binding constraint.
- Blended local cost lands between roughly 0.70 per million tokens depending on batching, while hosted APIs range from about 15.00 per million output tokens.
- Break-even versus a 0.60 budget API it is nearer 170 million.
- Match tooling to workload: Ollama or llama.cpp with GGUF for development, vLLM or TGI with AWQ or GPTQ for production batch serving.
VRAM Footprint and Quality Loss by Quant Method
The table crosses quant method with model size. VRAM includes weights plus a 4K-context KV cache on a single GPU, and the perplexity delta is measured against the FP16 baseline on held-out web text. Treat every cell as illustrative and hardware-dependent.
| Quant method | 3B VRAM | 7B VRAM | 14B VRAM | 7B perplexity delta |
|---|---|---|---|---|
| FP16 (baseline) | 6.5GB | 15.5GB | 29.0GB | baseline |
| FP8 | 3.4GB | 8.0GB | 15.2GB | +0.1% |
| AWQ int4 | 1.9GB | 4.6GB | 8.7GB | +0.8% |
| GPTQ int4 | 1.9GB | 4.5GB | 8.6GB | +1.0% |
| GGUF Q4_K_M | 2.0GB | 4.8GB | 9.1GB | +1.2% |
| GGUF Q5_K_M | 2.3GB | 5.5GB | 10.4GB | +0.7% |
| GGUF Q8_0 | 3.4GB | 8.5GB | 16.1GB | +0.2% |
Two patterns hold across hardware generations. First, quality loss per byte shrinks as you move from 4-bit to 5-bit: Q5_K_M recovers about half the perplexity gap of Q4_K_M for roughly 15 percent more memory. Second, 14B models at 4-bit fit comfortably on 24GB cards with long-context KV cache, while their 8-bit siblings need 16GB for weights alone plus cache headroom.
Throughput and Batch Latency Under Load
Illustrative results for a 7B model with 128-token completions on an RTX 4090 24GB unless noted. Tokens-per-second is output-only, and first-token latency includes prefill at 512 prompt tokens.
| Method | Serving tool | Batch 1 | Batch 8 | First-token P50 |
|---|---|---|---|---|
| FP16 | vLLM | 55 tok/s | 180 tok/s | 240ms |
| FP8 | vLLM | 95 tok/s | 320 tok/s | 180ms |
| AWQ int4 | vLLM | 110 tok/s | 380 tok/s | 160ms |
| GPTQ int4 | TGI | 100 tok/s | 340 tok/s | 170ms |
| GGUF Q4_K_M | llama.cpp | 85 tok/s | 240 tok/s | 150ms |
| AWQ int4 | vLLM on A100 80GB | 190 tok/s | 640 tok/s | 120ms |
Batch latency math is where 4-bit pays for itself twice. At batch 8 a 128-token completion finishes in roughly 340ms on AWQ versus 710ms on FP16, and interactive batch-1 requests still see first tokens in about 160ms. Continuous batching in vLLM and TGI holds per-request latency flat while packing more sequences, which is why server-class cards favor those runtimes over raw llama.cpp for multi-tenant endpoints.
Cost-per-Million-Tokens: On-Premise Math vs API Pricing
The arithmetic for one RTX 4090 serving a 7B 4-bit model over three years looks like this: hardware amortizes near 0.05 per hour at 0.03, for about 0.15 per million tokens; interactive batch-1 traffic closer to 0.20 million tokens per hour pushes the blended figure near 0.35 per million.
| Scenario | Illustrative cost per 1M output tokens | Fixed monthly cost | Notes |
|---|---|---|---|
| Local 7B, 4-bit, batch serving | 0.35 | about $75 | Needs steady load |
| Local 7B, 4-bit, interactive batch 1 | 0.70 | about $75 | Latency-friendly |
| Local 7B, 8-bit, batch serving | 0.50 | about $75 | When 4-bit fails evals |
| Budget hosted API (small model class) | 0.60 | none | Lowest entry cost |
| Mid-tier hosted API | 5.00 | none | Zero ops burden |
| Frontier hosted API | 15.00 | none | Quality ceiling |
Fixed cost near 0.15 marginal clears a 0.60 API at about 170 million tokens per month. For multi-GPU fleets and reserved-cloud comparisons, run the same amortization math in our GPU compute cost guide.
When On-Premise Small Language Model Hosting Beats APIs
Local hosting wins on three axes: data control, predictable cost at volume, and independence from provider rate limits.
- Regulated or sensitive traffic â prompts containing customer records, NDA-bound source code, or health data never cross your network boundary.
- Fixed, high-volume workloads â classification, PII redaction, document extraction, and autocomplete run the same distribution every day, so a small local model with tight evals replaces a per-token meter.
- Offline and air-gapped environments â factory floors, clinical workstations, and classified networks have no usable API path at all.
- Custom serving behavior â you keep control of sampling defaults, log retention, context-window sizing, and deployment cadence.
APIs keep the advantage when traffic is spiky, when the task needs frontier reasoning, or when monthly volume sits under the break-even point and nobody on the team wants to own GPU operations. Whichever side you land on, validate the switch with evaluation-driven development so perplexity deltas become task-level quality scores before you cut over.
Deployment Tooling: llama.cpp, vLLM, TGI, and Ollama
| Tool | Quant formats | Best fit | Throughput character |
|---|---|---|---|
| llama.cpp | GGUF k-quants | CPU, Mac, single-user GPU | Strong batch 1, moderate batch 8 |
| Ollama | GGUF via llama.cpp | Local dev and demos | llama.cpp performance with simple pulls |
| vLLM | AWQ, GPTQ, FP8, FP16 | Production continuous batching | Highest tokens per second on NVIDIA |
| TGI | AWQ, GPTQ, EETQ, FP8 | Containerized enterprise serving | Near-vLLM numbers with simpler ops |
The practical sequence is to prototype in Ollama, benchmark in llama.cpp when edge or CPU hardware matters, then move the winning quant into vLLM or TGI behind a gateway once concurrency arrives. Serving stacks that stream tokens into retrieval workloads pair naturally with streaming RAG pipelines.
Which Method When: A Decision Table
| Situation | Recommended method | Reason |
|---|---|---|
| 16GB GPU, 7B, interactive chat | GGUF Q4_K_M on llama.cpp or Ollama | Fits with context headroom, simple ops |
| 24GB GPU, batch throughput | AWQ int4 on vLLM | Marlin kernels lead tokens per second |
| Quality-sensitive 7B on 24GB | GPTQ int4 or GGUF Q5_K_M | Perplexity delta near 0.7 to 1.0 percent |
| H100 server, near-lossless 8B | FP8 on vLLM | Native hardware, delta near 0.1 percent |
| 14B model on 24GB | 4-bit AWQ or GPTQ | 8-bit needs 16GB for weights alone |
| CPU-only or ARM edge | GGUF Q4_K_M, or Q3_K_M under 12GB | llama.cpp quant path dominates CPU |
| Offline batch pipelines | AWQ or GPTQ on vLLM or TGI | Continuous batching wins cost per token |
Common Mistakes in On-Premise Quant Rollouts
Common Mistakes
Choosing a quant from VRAM fit alone and shipping it without a task-level eval
Fix: Perplexity drift near 1 percent can hide a 6-point drop on your extraction or code slice; score the quantized build against the FP16 baseline on your own held-out cases.
Sizing a card for weights only and discovering the KV cache does not fit at target context
Fix: Add the cache for your real context length plus runtime headroom â a 7B 4-bit model at 4.6GB still needs hundreds of megabytes per active sequence at 4K context.
Comparing local cost per million tokens against API list price using idle-hours math
Fix: Amortize hardware over three years at realistic utilization: a GPU that idles produces zero tokens, so the break-even only holds if batch load keeps it busy.
Frequently Asked Questions
What is SLM quantization?
SLM quantization is the conversion of a small language model's weights from 16-bit floating point into 8-bit or 4-bit formats so the model needs less VRAM and memory bandwidth. Done well with AWQ, GPTQ, or GGUF k-quants, it typically shrinks a 7B model from 15.5GB to a 4.5 to 4.8GB footprint while moving perplexity by roughly 1 percent.
Is 4-bit quantization quality loss noticeable?
For classification, extraction, summarization, and chat on a well-matched SLM, usually not: illustrative perplexity drift sits between 0.8 and 1.2 percent and task accuracy often moves under one point. Run held-out evals rather than trusting perplexity alone, because long-context reasoning and code generation degrade earlier than short-form tasks.
Should I use AWQ or GPTQ?
Choose AWQ for maximum throughput on vLLM in production, and GPTQ when you need per-model calibration or older serving stacks. At 4-bit, quality differences between the two usually stay under 0.3 perplexity points, so throughput and tooling support decide most bake-offs.
When is on-premise hosting cheaper than an API?
On-premise wins near 5 million tokens per month against a 0.60 budget API on a single RTX 4090, and it wins outright whenever data is not allowed to leave your network regardless of token volume.
Which tool should I use: llama.cpp, vLLM, TGI, or Ollama?
Use Ollama or llama.cpp with GGUF formats for development, CPU or edge targets, and single-user latency, and use vLLM or TGI with AWQ or GPTQ when you need production batching. In illustrative 7B runs, vLLM with AWQ reached about 380 tokens per second at batch 8 on an RTX 4090 versus 240 for llama.cpp at Q4_K_M.
Last updated: September 23, 2026