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 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/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/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="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.00092 | $0.02638 |
| Opus 5.5 | $0.00037 | $0.01055 |
| Sonnet 5.5 | $0.00018 | $0.00528 |
| Haiku 4.5 | $0.00009 | $0.00264 |
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 27d 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 — 176 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;
0.9.0 as of 2026-10, which pins ai-edge-litert 2.2.0 on the host),
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. A blockwise recipe needs the quantized dimension divisible by the block (a 3-input linear fails block-32 with Quantized dimension 3 … is not divisible) |
| 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 |
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.
- 27d ago Changed · +2 lines 128df31e7990
- 2mo 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 (486 stars, last pushed yesterday), licensed Apache-2.0. It adds 92 tokens to every session and 2,638 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.
Other skills, from other repositories
adversarial-ml-evasion
Craft adversarial examples that cause trained ML classifiers to misclassify at inference time — image recognition, malware detectors, IDS, spam filters.
llm-redteam-overview
LLM red team category — full AATMF v3 tactic coverage (T01–T15). Routing skill: read this first to identify which tactic applies, then load the matching sub-skill. Maps to MITRE ATLAS where overlap exists.
misinformation
Hunt LLM misinformation / overreliance (OWASP LLM09:2025) — confident-but-wrong outputs that flow into downstream automated decisions, compliance reports, customer communications, or autonomous code commits without verification.
sensitive-information-disclosure
Hunt LLM sensitive-information disclosure (OWASP LLM02:2025) — leakage of PII, secrets, internal source, model details, and other-tenant data through model outputs, training-data extraction, or retrieval-side joins.
vector-and-embedding-weaknesses
Hunt vector / embedding weaknesses (OWASP LLM08:2025) — adversarial inputs against the RAG / similarity layer that cause cross-tenant leak, embedding-inversion privacy loss, semantic confusion, and retriever-driven prompt injection.
aatmf-t12-rag-poisoning
AATMF T12 — RAG & Knowledge Base Manipulation. PoisonedRAG, vector store flood, embedding collision, retrieval-bias attacks.