/vibe:skill-quantizationfrom vibe
Guides selection of quantization strategies (FP8, INT4, GGUF) for LLM deployment based on hardware, latency, and quality constraints.
Ships in vibe. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
When deploying a language model, use this framework to select the right number format, quantization method, and quality validation strategy.
Provide:
| Your Situation | Format | Method | Expected Quality Loss |
|---|---|---|---|
| H100 GPU, maximum throughput | FP8 E4M3 | Native H100 casting | < 0.1% |
| A100/A10, need 2x throughput | INT8 | LLM.int8() or SmoothQuant | < 0.5% |
| Single 24GB GPU, 70B model | INT4 | AWQ or GPTQ | 1-3% |
| MacBook / Apple Silicon | INT4 GGUF | Q4_K_M via llama.cpp | 1-2% |
| Mobile / edge device | INT4 or INT3 | QAT + device-specific | 2-5% |
| Maximum compression, some loss OK | INT2 | QuIP# or AQLM | 5-15% |
| Training (mixed precision) | BF16 + FP32 accum | Native framework support | 0% |
Not all tensors should get the same treatment.
| Component | Safe Minimum | Recommended | Avoid |
|---|---|---|---|
| FFN weights | INT4 | INT4 (AWQ/GPTQ) | INT2 without QAT |
| Attention weights | INT4 | INT8 or FP8 | INT2 |
| Embedding layer | INT8 | FP16 (keep original) | INT4 |
| Output head | INT8 | FP16 (keep original) | INT4 |
| KV cache | FP8 | FP8 or INT8 | INT4 at long context |
| Attention logits | FP16 | FP16 or BF16 | INT8 |
| Activations (inference) | INT8 | FP8 or INT8 | INT4 |
auto-gptq, exllama, exllamav2autoawq, vLLM (native support)llama.cpp, ollama, LM Studiosmoothquant, TensorRT-LLMAfter quantizing, validate before deploying:
Perplexity test. Compute on WikiText-2 or your domain corpus. Delta < 0.5 is excellent, 0.5-1.0 is good, > 2.0 is a problem.
Benchmark sweep. Run MMLU (general), GSM8K (math), HumanEval (code). Math and code are most sensitive to precision loss.
Output comparison. Generate 100 responses from both original and quantized model. Use LLM-as-judge to compute win rate. Target: quantized model wins or ties on > 90% of prompts.
Latency measurement. Measure tokens/second at batch size 1 and your target batch size. Verify the speedup justifies the quality cost.
Long-context test. If serving long contexts (> 4K tokens), test at your maximum context length. KV cache quantization errors compound with sequence length.
Weight memory (GB) = parameters (B) * bits / 8 / 1.073741824
KV cache per token (MB) = 2 * num_layers * d_model * bits / 8 / 1048576
KV cache for context (GB) = kv_per_token * max_context_length / 1024
Activation memory (GB) ~ 1-4 GB (relatively constant, depends on batch size)
Total = weight_memory + kv_cache + activation_memory + overhead (10-20%)
Example for Llama 3 70B at INT4, 32K context:
| Mistake | Why It Fails | Fix |
|---|---|---|
| Quantizing the embedding layer to INT4 | First layer amplifies errors through entire model | Keep embeddings at FP16 or INT8 |
| Using per-tensor scales for INT4 | One outlier row destroys precision for all rows | Use per-channel or per-group scales |
| Not calibrating GPTQ/AWQ | Scale factors are wrong without representative data | Use 128 examples from your domain |
| Same bit-width for all layers | First/last layers are more sensitive | Mixed precision: higher bits for first/last |
| Quantizing KV cache at very long context | Errors compound quadratically with sequence length | Use FP8 for KV cache, not INT4 |
| Skipping quality validation | Some models quantize poorly (especially at boundaries) | Always run perplexity + task evals |
pip install vllm autoawq
vllm serve model-awq --quantization awq --dtype half --max-model-len 8192
./llama-server -m model.Q4_K_M.gguf -c 4096 -ngl 99
trtllm-build --model_dir model --output_dir engine --dtype float16 --use_fp8
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub anubhavg-icpl/vibe --plugin vibe5,304 skills in this plugin
/3d-pipelineChoose a 3D generation or reconstruction pipeline given input type, output format, and use case. Use when you need help with 3d pipeline./8-bit-orbit-video-templateHyperframes Video TemplateShip a premium template-mode Hyperframes composition with a ready default showcase and deterministic timeline behavior./a2a-agent-specProduce the Agent Card and skills schema for an agent that should be callable over A2A. Use when you need help with a2a agent spec.Other plugins' skills for the same job