Deploying Quantized Open Models (GGUF/AWQ) with Local ADK Runners
What GGUF and AWQ quantization actually trade away, choosing a quant level from VRAM and quality targets, running Ollama behind an OpenAI-compatible endpoint, and wiring the local model into an ADK agent with realistic expectations.
Published on • November 27, 2026
AI Assistant

Running your agent’s model on your own hardware changes the economics: no per-token bill, no data leaving the building, no shared-queue latency. The catch is quantization — the process that makes a 32-billion-parameter model fit in 20 GB of VRAM also decides how much of its capability arrives with it.
This tutorial covers the practical path: what GGUF and AWQ really do to a model, how to pick a quant level from your hardware budget, how to serve it with Ollama behind an OpenAI-compatible endpoint, and how to wire that endpoint into an ADK agent without fooling yourself about the quality delta.
What quantization does
Quantization stores each weight with fewer bits — from 16-bit floats down to 8, 5, 4, sometimes 3 or 2. The memory math is why people do it:
32B parameters × 16 bits ÷ 8 = 64 GB → needs multi-GPU or won't fit
32B parameters × 4 bits ÷ 8 = 16 GB → fits a single high-end consumer GPU
What you give up, roughly in this order:
- Precision on rare knowledge. Long-tail facts and exact phrasing degrade first — the model “almost remembers” things.
- Instruction-following edge cases. Subtle constraint adherence (exact formats, negative instructions) softens.
- Reasoning depth on hard problems. Multi-step logic gets shakier at very low bit widths.
- Calibration. Confidence and refusal behaviour drift; safety tuning is measured on the original weights.
Two families you’ll meet:
| Format | Runs on | Typical home | Best for |
|---|---|---|---|
| GGUF | CPU (llama.cpp/Ollama) + partial GPU offload | Laptops, edge boxes, mixed rigs | Flexibility, CPU inference, small deployments |
| AWQ / GPTQ | GPU (vLLM, TGI) | Server GPU | Throughput-oriented serving, larger batches |
Choosing a quant level
The general-purpose starting point is 4-bit with a mid-tier scheme (in GGUF terms, Q4_K_M-class; in AWQ terms, w4a16). Below that, quality drops become visible on tasks that matter:
| Quant | Quality | VRAM (32B model) | Choose when |
|---|---|---|---|
| 8-bit (Q8_0) | Near-reference | ~33 GB | Quality first, hardware allows |
| 4-bit (Q4_K_M) | Very good | ~17 GB | Default choice |
| 3-bit | Noticeable loss | ~13 GB | Memory-bound, quality-tolerant tasks |
| 2-bit | Degraded | ~9 GB | Draft/classifier roles only — never the main agent |
Benchmark your own workload, not a generic leaderboard: extraction accuracy, tool-selection accuracy, and instruction adherence on your 100 turns, at each quant you’re considering. If tool calling is your agent’s core skill, measure that first — it’s among the earliest things low-bit quants lose.
Serving with Ollama
ollama pull qwen3:32b-instruct-q4_K_M
ollama serve # OpenAI-compatible API at http://localhost:11434/v1
The OpenAI-compatible surface is what makes integration easy: /v1/chat/completions with streaming, so anything speaking that protocol can switch between local and hosted with a URL change.
Ops notes:
- Context length costs memory. KV cache scales with context; a model that fits at 8k can OOM at 32k. Set
num_ctxdeliberately. - Concurrency is throughput, not magic. Small VRAM means few simultaneous requests; size your ADK worker concurrency to the server, or requests queue and your TTFT collapses.
- Pin versions. Model file revisions change output; record the digest alongside your eval results.
Wiring it into ADK
ADK supports OpenAI-compatible and LiteLLM-backed model backends, so a local endpoint is a model string, not a fork of your agent:
from google.adk import Agent
from google.adk.models.litellm import LiteLlm
local_model = LiteLlm(
model='openai/qwen3:32b-instruct-q4_K_M',
api_base='http://localhost:11434/v1',
temperature=0.2,
)
agent = Agent(
name='local_assistant',
model=local_model,
instruction=SYSTEM_INSTRUCTION,
tools=[lookup_order, search_kb],
)
Because the agent definition is unchanged, you can run the same agent against a hosted model in dev and a local one in an air-gapped environment — which is exactly the configuration pattern described in local models with Ollama and ADK.
Things to verify before you trust it:
- Tool calling end to end. Confirm the local model emits well-formed calls for every tool in your set, with correct argument types. If the model’s chat template mishandles function schemas, your agent silently degrades to “answers questions about tools”.
- Streaming behaviour. Some local stacks buffer or chunk differently, which shows up as TTFT regressions (see TTFT optimization).
- Token accounting. Local inference has no per-token invoice, but it has a throughput budget — measure tokens/sec under your real concurrency.
- Failure semantics. What does the server return when the prompt exceeds context: a 400, a truncation, or a silent clip? Test it; silent truncation is the worst of the three.
Hybrid architectures: the usual end state
Most teams land on a hybrid rather than all-local:
- Local for the hot path — classification, extraction, summarisation of sensitive text that must not leave the premises.
- Hosted for the deep path — long reasoning, grounding, frontier-quality generation, with fallback chains routing between them.
- Local as the last resort — a breaker-open fallback so a provider outage degrades to slower rather than dead.
Design the seam once: a model abstraction plus routing config, so locality is a deployment decision, not a code change.
Takeaways
- Quantization buys fit and speed by spending long-tail knowledge, instruction edge cases, and reasoning depth — measure your own task, not a leaderboard.
- Start at 4-bit (
Q4_K_M/w4a16); treat 2-bit as a specialist, never as the primary agent. - GGUF favors CPU/flexible rigs; AWQ favors GPU throughput serving — the choice follows your hardware, not your model preference.
- Serve with an OpenAI-compatible endpoint and plug it into ADK via the LiteLLM wrapper; agent code stays identical.
- Validate tool calling, streaming, context limits, and concurrency explicitly — local servers fail in ways hosted ones don’t.
- Plan for hybrid: local for the sensitive hot path, hosted for depth, local again as last-resort fallback.