Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add j4flmao/agent-skills --skill model-quantizationgit clone --depth 1 https://github.com/j4flmao/agent-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/j4flmao/agent-skills/model-quantization)<a href="https://agentmods.dev/skills/j4flmao/agent-skills/model-quantization"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/model-quantization/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/j4flmao/agent-skills/model-quantization"><img src="https://agentmods.dev/badge/skills/j4flmao/agent-skills/model-quantization.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00110 | $0.02104 |
| Opus 5.5 | $0.00044 | $0.00842 |
| Sonnet 5.5 | $0.00022 | $0.00421 |
| Haiku 4.5 | $0.00011 | $0.00210 |
Grade A, and why
llm-model-quantization scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 17d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 157 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Model Quantization
Purpose
Quantization stores weights (and optionally activations) in fewer bits so a model fits in less memory and decodes faster, since decoding is usually memory-bandwidth bound. The cost is a quality loss that depends on bit width, method, calibration data, and model. Pick the format your inference engine runs fastest, quantize with a calibration-aware method, and gate the result on your own evals.
Agent Protocol
Trigger
"quantize", "GPTQ", "AWQ", "GGUF", "k-quants", "Q4_K_M", "INT4", "INT8", "FP8", "NF4", "bitsandbytes", "fit model in VRAM".
Input Context
- Model and size; target hardware (NVIDIA generation, Apple Silicon, CPU).
- Inference engine (vLLM, TensorRT-LLM, llama.cpp/Ollama, transformers).
- Quality tolerance and the eval set that measures it.
Output Artifact
Recommended format and bit width, quantization commands, memory estimate, eval comparison plan.
Response Format
Target: {hardware} via {engine}
Format: {fp8|awq-w4a16|gptq-w4a16|gguf Q4_K_M|nf4}
Memory: weights ≈ params × bits/8 (+ scales) = {GB}
Steps: {commands}
Eval gate: {metric} drop ≤ {x}% vs bf16 baseline
Completion Criteria
- Format supported natively by the target engine/hardware.
- Calibration data resembles production inputs.
- Baseline vs quantized evaluated on task metrics, not only perplexity.
- Throughput/latency measured, not assumed.
How It Works
Affine (asymmetric) quantization of a group of weights:
scale s = (max(W) - min(W)) / (2^b - 1)
zero z = round(-min(W) / s)
q = clamp(round(W / s) + z, 0, 2^b - 1)
W_hat = s · (q - z)
Symmetric quantization fixes z = 0 and uses a signed range. Group-wise quantization (e.g. group size 128) keeps a separate scale (and zero point) per group, limiting the damage from outliers at a cost of extra bits per weight (a 16-bit scale per 128 weights adds 0.125 bits/weight).
Weight-only schemes (W4A16, W8A16) dequantize inside the matmul kernel; they help most in the memory-bound decode phase. Weight+activation schemes (W8A8 INT8/FP8) also speed up compute-bound prefill on hardware with matching tensor-core support.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 17d ago Changed · +4 lines · -61 tokens per session 6a40fcf9851a
- 1mo ago Changed · +96 lines · +171 tokens per session a4f07c3b0295
- 3mo ago First seen · 57 lines · 0 tokens per session scan A 52f110ac1d73
llm-model-quantization is a skill published in the GitHub repository j4flmao/agent-skills (47 stars, last pushed 17d ago), licensed MIT. It adds 110 tokens to every session and 2,104 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
llm-model-quantization compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| llm-model-quantizationj4flmao/agent-skills | Skill | 47 | 17d ago | MIT | A | 110 | Claude Code, Codex |
| hqq-quantizationsynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 58 | Claude Code, Codex |
| sglang-diffusion-performancesgl-project/sglang | Skill | 39k | today | Apache-2.0 | A | 29 | Claude Code, Codex |
| sglang-diffusion-cache-ditsgl-project/sglang | Skill | 39k | today | Apache-2.0 | A | 161 | Claude Code |
| sglang-diffusion-modelopt-quantsgl-project/sglang | Skill | 39k | today | Apache-2.0 | A | 49 | Claude Code, Codex |
| add-diffusion-modelsgl-project/sglang | Skill | 39k | today | Apache-2.0 | A | 30 | Claude Code, Codex |
| groq-inferencesynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 77 | Claude Code, Codex |