Quick Start (TL;DR)
For a standard production deployment on a Blackwell-class GPU with the language model only:
vllm serve unsloth/gemma-4-12b-it-awq \ --max-model-len 8192 \ --dtype auto --max-num-batched_tokens 8192Ollama (Simplest)
ollama run gemma:12bOllama works out of the box but doesn’t support the new Gemma 4 tool-calling template as reliably as llama.cpp yet. Use for quick testing, not production coding workflows.
Prompt Structure That Works
Community-tested system prompt for coding:
You are a coding assistant. Rules:1. Output ONLY code unless asked to explain.2. If the task is ambiguous, ask ONE clarifying question — do not guess.3. Include brief inline comments for non-obvious logic.4. Use the existing codebase style. If unsure, use PEP 8 / standard conventions.5. Never invent imports or APIs. If you need an import, state it explicitly.Key observations:
- “Ask one question” beats “don’t hallucinate” — the model actually uses it.
- Inline comments catch reasoning errors early.
- Style matching requires showing a code snippet in the prompt.
What Gemma 4 12B Does Well
- Small refactors: rename, extract function, split class — reliable
- Bug fixing with context: feed the error + the file, it usually nails it
- Boilerplate generation: CRUD endpoints, React components, test scaffolds
- Code explanation: “What does this function do?” — consistently accurate
- Single-file Python/JS/TS: Complete scripts under 200 lines work well
Where It Struggles
- Multi-file refactors: loses track of cross-file imports
- Complex algorithm design: tends to pick the simplest (sometimes wrong) approach
- Tool calling with >3 tools: gets confused by large tool schemas
- Framework-specific gotchas: Next.js hydration, Rust lifetime errors — needs context
Hardware Checklist
| GPU | VRAM | Verdict |
|---|---|---|
| RTX 4090 | 24 GB | Comfortable BF16 or Q4 + headroom |
| RTX 4070 / 4080 | 12-16 GB | Q4 QAT, 8K context |
| RTX 3060 / 4060 | 8-12 GB | Q4 QAT, 4K context |
| Mac M2/M3 | 16 GB | Q4 QAT via MLX, ~25 t/s |
| Mac M2/M3 | 24 GB | BF16 via MLX, ~15 t/s |
The Reliable Workflow (Summary)
- Load QAT or AWQ Q4 — never naive GGUF
- Use
--jinjain llama.cpp for tool calling - Chunk every task into <100-line outputs
- Show relevant code in the prompt (5-15 lines of context)
- Verify before proceeding — one broken step cascades
Gemma 4 12B is not the strongest coding model available — Qwen3.6 27B and Gemma 4 31B are objectively better. But it’s the smallest model that handles coding reliably at scale, and at 7 GB quantized, it runs on hardware most developers already own.

