optimize-model-precision

A workflow for testing FP16, BF16, and supported quantization formats in TensorRT-Model-Connect. These are lower-precision number formats that can reduce resource use or improve speed, but may affect model accuracy.

In plain words
What is it for?
Use it to evaluate precision or quantization choices for a model, detect settings that have no real effect, compare results with the baseline, and retain evidence for the selected configuration.
Why use it?
It establishes a correctness baseline before changing precision and tests one effective build option at a time. This makes it possible to compare accuracy, memory, package size, setup time, and runtime performance fairly.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/nvidia/tensorrt-model-connect/optimize-model-precision
Any agent
npx skills add NVIDIA/TensorRT-Model-Connect --skill optimize-model-precision
Clone the repo
git clone --depth 1 https://github.com/NVIDIA/TensorRT-Model-Connect

Made for: Claude Code, Codex.

Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,488 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00064 $0.01488
Opus 5 $0.00032 $0.00744
Sonnet 5 $0.00013 $0.00298
Haiku 4.5 $0.00006 $0.00149

Measured 3d ago against content hash 6a53f3dc414b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

optimize-model-precision 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 3d 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.

plugins/trtmc-agent-skills/skills/optimize-model-precision/SKILL.md · 190 lines

How it starts

The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Optimize Model Precision

Objective

Find the lowest-cost configuration that satisfies the model's existing correctness contract and improves a named resource or performance metric. “Best” must name the objective: bundle size, device memory, setup time, prefill, decode, throughput, or another model-owned metric.

Do not weaken an oracle, threshold, sample set, or pass criterion to make a configuration qualify. If a test appears wrong, stop and escalate it to a maintainer.

Establish The Owned Baseline

Resolve the model through all relevant descriptors:

  • Python family MODEL.toml and plugin;
  • C++ model MODEL.toml and runtime strategy;
  • E2E family MODEL.toml, manifest, testcases, thresholds, and perf_validation.json when present;
  • model-first binding in tests/validation/model_workloads.yaml;
  • optimized implementation/profile/qualification descriptors when selected.

List and dry-run the reference-consistency workload:

PYTHONPATH=python:. python3 tools/trtmc_validate.py --list
PYTHONPATH=python:. python3 tools/trtmc_validate.py \
  <model> <workload> \
  --dry-run \
  --output <baseline-plan-dir>

Build and validate the existing configuration before optimizing it. Record: repository SHA, exact model revision, target/hardware, runtime path, effective build options, bundle hash, workload and sample limit, seed/sampling, artifact paths, correctness metrics, and the performance protocol.

Build Matrix

Try only formats supported by the current CLI and owning family:

./build/trtmc build <model> -o <bundle>.bundle \
  --precision fp16 \
  --max-cache-length <N>

./build/trtmc build <model> -o <bundle>.bundle \
  --precision fp16 \
  --quantize <supported-format> \
  --quant-calibration-samples <N> \
  --max-cache-length <N>

The current quantization core resolves a QuantPlan; family hooks own calibration data, adapters, exclusion patterns, and FP8 scales. Use the current CLI help and website/docs/features/quantization.md for supported options. Use --quant-scales for a reviewed generic scale artifact and the dedicated FP8 scale flags only for their documented compatibility path. Do not bypass the plan with ad hoc family Q/DQ code.

Read the full file on GitHub · 190 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 190 lines · 64 tokens per session scan A 6a53f3dc414b

Subscribe to this mod's changes

optimize-model-precision is a skill published in the GitHub repository NVIDIA/TensorRT-Model-Connect (188 stars, last pushed 3d ago), licensed Apache-2.0. It adds 64 tokens to every session and 1,488 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

graphsignal-profiler

Set up the Graphsignal Profiler for inference workloads — vLLM, SGLang, PyTorch, and dstack services. Use when the user wants GPU profiling, tracing, or monitoring for inference, asks about graphsignal-run or graphsignal.watch(), or asks about CUPTI / Prometheus / OTLP setup.

graphsignal/graphsignal-profiler · 74 tokens

weights-and-biases

Track ML experiments with automatic logging, visualize training in real-time, optimize hyperparameters with sweeps, and manage model registry with W&B - collaborative MLOps platform.

Orchestra-Research/AI-Research-SKILLs · 39 tokens

huggingface-accelerate

Simplest distributed training API. 4 lines to add distributed support to any PyTorch script. Unified API for DeepSpeed/FSDP/Megatron/DDP. Automatic device placement, mixed precision (FP16/BF16/FP8). Interactive config, single launch command. HuggingFace ecosystem standard.

Orchestra-Research/AI-Research-SKILLs · 69 tokens

mlflow

Track ML experiments, manage model registry with versioning, deploy models to production, and reproduce experiments with MLflow - framework-agnostic ML lifecycle platform.

Orchestra-Research/AI-Research-SKILLs · 33 tokens

huggingface-hub

Hugging Face Hub — model discovery, download, inference, and upload.

furkangonel/cowrangler · 22 tokens

ml-training

Machine learning model training authority — classifier and regressor training with scikit-learn and PyTorch, feature engineering, cross-validation, hyperparameter tuning, fine-tuning transformer models with HuggingFace, dataset splits, loss functions, learning rate schedules, and reproducible training runs.

LuuOW/meridian-mcp · 58 tokens