llm-model-quantization

llm-model-quantization is a skill for Claude Code, Codex from j4flmao/agent-skills. It costs 110 tokens per session (2,104 once invoked), scanned A, original, MIT.

Guidance for making an AI model smaller by storing its weights with fewer numerical bits, such as INT4 or INT8 instead of FP16 or BF16. Model weights are the numbers the model uses to produce answers.

In plain words
What is it for?
Use it to understand or plan model quantization, including scaling values, grouping weights, and algorithms such as GPTQ.
Why use it?
Lower-precision weights can reduce storage and memory needs, though the document focuses on the methods and their effect on accuracy.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to understand or plan model quantization, including scaling values, grouping weights, and algorithms such as GPTQ.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/j4flmao/agent-skills/model-quantization
Install

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.

Any agent
npx skills add j4flmao/agent-skills --skill model-quantization
Clone the repo
git clone --depth 1 https://github.com/j4flmao/agent-skills

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for llm-model-quantization

README.md
[![agentmods](https://agentmods.dev/badge/skills/j4flmao/agent-skills/model-quantization/github.svg)](https://agentmods.dev/skills/j4flmao/agent-skills/model-quantization)
Your own site
<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.

agentmods 80×15 button for llm-model-quantization

Your own site · 80×15
<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>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,104 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 17d ago against content hash 6a40fcf9851a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

skills/ai/llm-engineering/model-quantization/SKILL.md · 157 lines

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.

Read the full file on GitHub · 157 lines

Changes

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.

  1. 17d ago Changed · +4 lines · -61 tokens per session 6a40fcf9851a
  2. 1mo ago Changed · +96 lines · +171 tokens per session a4f07c3b0295
  3. 3mo ago First seen · 57 lines · 0 tokens per session scan A 52f110ac1d73

Subscribe to this mod's changes

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.

Related

llm-model-quantization compared with skills from other repositories

llm-model-quantization next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
llm-model-quantizationj4flmao/agent-skillsSkill4717d agoMITA110Claude Code, Codex
hqq-quantizationsynthetic-sciences/openscienceSkill4.5kyesterdayApache-2.0A58Claude Code, Codex
sglang-diffusion-performancesgl-project/sglangSkill39ktodayApache-2.0A29Claude Code, Codex
sglang-diffusion-cache-ditsgl-project/sglangSkill39ktodayApache-2.0A161Claude Code
sglang-diffusion-modelopt-quantsgl-project/sglangSkill39ktodayApache-2.0A49Claude Code, Codex
add-diffusion-modelsgl-project/sglangSkill39ktodayApache-2.0A30Claude Code, Codex
groq-inferencesynthetic-sciences/openscienceSkill4.5kyesterdayApache-2.0A77Claude Code, Codex