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 agentmods add skills/google-ai-edge/litert-samples/accuracy-safe-quantizationnpx skills add google-ai-edge/litert-samples --skill accuracy-safe-quantizationgit clone --depth 1 https://github.com/google-ai-edge/litert-samplesWrote 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/google-ai-edge/litert-samples/accuracy-safe-quantization)<a href="https://agentmods.dev/skills/google-ai-edge/litert-samples/accuracy-safe-quantization"><img src="https://agentmods.dev/badge/skills/google-ai-edge/litert-samples/accuracy-safe-quantization.svg" alt="Measured on agentmods" height="20"></a>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 | $0.00092 | $0.02541 |
| Opus 5 | $0.00046 | $0.01270 |
| Sonnet 5 | $0.00018 | $0.00508 |
| Haiku 4.5 | $0.00009 | $0.00254 |
Grade A, and why
accuracy-safe-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 5d 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 — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Accuracy-safe quantization
A quantization is done when three things hold, in this order:
- it exports and the file shrinks by what the recipe predicts,
- output parity with the float source holds on a task-level check, not just a smoke test,
- the quantized model still passes the deployment check on the target runtime and device.
Quantization rewrites the graph, so step 3 is a fresh obligation every time:
re-run the same CompiledModel verification you used to accept the float
conversion (see the gpu-clean-conversion skill), then the on-device
numerical check.
All recipes below are ai-edge-quantizer (pip install ai-edge-quantizer),
plain Python, no build step. Worked examples live in this repo under
models/bonsai/bonsai_image_4b/converted/ and
models/qwen/qwen3_tts/converted/.
Choosing a lane
Start with the lightest recipe that meets the size budget, and move down only on evidence:
| Budget / model | Recipe |
|---|---|
| ~2× smaller, zero risk | fp16 float-casting. Weights cast to fp16, compute stays float. On a GPU that already computes in fp16 this is close to free numerically — verify anyway |
| ~4× smaller — encoders, conv nets, diffusion blocks | Dynamic-range int8 channelwise. int8 weights, float activations; this shape rides the GPU delegate |
| Dynamic int8 lost quality (conditioning, embeddings) | Weight-only, same bits. Inserts an explicit DEQUANTIZE so the matmul runs in float and activations are never quantized — more quality, some latency |
| ~7× smaller — LLM / autoregressive decoders | int4 blockwise-32 + OCTAV, embeddings int8. Never channelwise for a decoder: it looks fine on short outputs and degenerates over long generations |
| Data-free int4 still fails the task gate | Calibrated ingest. Take a GPTQ checkpoint and preserve its grid with DEQUANTIZED_WEIGHT_RECOVERY — see the routing table |
Full-integer static quantization (static_wi8_ai8 — quantized activations,
calibration data required) is a different lane aimed at NPU/AOT targets and
is not covered here.
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.
- 5d ago First seen · 174 lines · 92 tokens per session scan A 8dad72da9177
accuracy-safe-quantization is a skill published in the GitHub repository google-ai-edge/litert-samples (416 stars, last pushed yesterday), licensed Apache-2.0. It adds 92 tokens to every session and 2,541 once invoked, about $0.0005 per session on Opus 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.
Other skills, from other repositories
repomix-explorer
Analyze or explore a codebase (remote or local repository) by packing it with the Repomix CLI, then reading and searching the generated output. Use when the user wants a high-level understanding of an unfamiliar or large repo, not a targeted edit. Trigger for: Structure/overview: "analyze this repo", "what's the…
repomix
Pack and analyze codebases into AI-friendly single files using Repomix. Use when the user wants to explore repositories, analyze code structure, find patterns, check token counts, or prepare codebase context for AI analysis. Supports both local directories and remote GitHub repositories.
agent-carnet
Use this skill when the user asks to save, recall, find, or organize notes. Triggers on: 'remember this', 'save this', 'note this', 'what did we discuss about...', 'check the notebook', 'find in carnet'. Also use proactively when discovering findings worth preserving across sessions.
google-agents-cli-scaffold
This skill should be used when the user wants to "create an agent project", "start a new ADK project", "build me a new agent", "add CI/CD to my project", "add deployment", "enhance my project", or "upgrade my project". Part of the agents-cli skills suite. Covers agents-cli scaffold create, scaffold enhance, and…
graph-mutation-plan
Cookbook for composing an applygraphmutations plan — stable entitykey patterns, the canonical label/edge vocabulary, evidence/invalidation/confidence discipline, and a worked example. Load this when building a non-trivial mutation plan.
opsec
Operational security management — traffic shaping, scan rate limiting, source IP management, tool signature avoidance, evidence handling, anti-detection patterns.