deployment-explainability

A guide for putting trained models into apps or inference functions, while adding explanations suited to the model and task. Explainability means showing which parts of an input influenced a prediction.

In plain words
What is it for?
Use it to share preprocessing between training and inference, deploy models, and create heatmaps, attention views, predicted boxes, segmentation overlays, or similar task-specific explanations.
Why use it?
It prevents deployment errors caused by processing user input differently from training data and avoids using an unsuitable explanation method.

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/mxslr/mlcraft/deployment-explainability
Any agent
npx skills add mxslr/mlcraft --skill deployment-explainability
Clone the repo
git clone --depth 1 https://github.com/mxslr/mlcraft

Made for: Claude Code, Codex.

Per session 159 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 828 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.00159 $0.00828
Opus 5 $0.00079 $0.00414
Sonnet 5 $0.00032 $0.00166
Haiku 4.5 $0.00016 $0.00083

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

Security

Grade A, and why

deployment-explainability 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 2d 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/deployment-explainability/SKILL.md · 41 lines

How it starts

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

Deployment and Explainability

Preprocessing PARITY (the bug that silently ruins deployments)

The raw input a user uploads MUST pass through exactly the same pipeline as training (resize, crop, enhancement like CLAHE, normalization). Package it as one shared function reused by both training and inference. A mismatch produces confident but wrong predictions.

Pick the explainability method that fits the model and task

Grad-CAM is only for convolutional image classifiers. It is not meaningful for detection, embeddings, tabular, or text. Choose by problem:

Model or task Explainability Notes
CNN image classification Grad-CAM, Grad-CAM++, Score-CAM heatmap over the regions that drove the predicted class. Good for medical scans and single-object classification.
Vision Transformer classification attention rollout, attention maps more natural than Grad-CAM for pure ViTs.
Object detection (faces, vehicles, objects) draw predicted boxes with class and confidence; optional D-RISE saliency Grad-CAM is not standard for detectors. The boxes are the explanation.
Segmentation overlay the predicted mask on the image, plus per-class confidence
Face recognition or verification nearest-neighbor example faces, embedding similarity score, t-SNE or UMAP of embeddings Grad-CAM is not meaningful for metric-learning embeddings.
Tabular SHAP (global summary and per-prediction), permutation importance the standard for stakeholder trust.
Text or NLP Integrated Gradients, token attributions, attention, SHAP for text highlight the tokens that drove the decision.
LLM or RAG output show the retrieved sources and the rationale; token logprobs for confidence grounding is the explanation.
Time-series feature and lag importance, temporal attention, SHAP on features which past steps drove the forecast.

Caption any saliency honestly: it shows where the model looked, not a ground-truth region.

Present the result well

  • Show the calibrated probability or score and the operating threshold, not just a label.
  • For an ensemble, serve the single best model for a coherent prediction and explanation; show the ensemble score as a second opinion.

Read the full file on GitHub · 41 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. 2d ago First seen · 41 lines · 159 tokens per session scan A 6dbc0e0a16f7

Subscribe to this mod's changes

deployment-explainability is a skill published in the GitHub repository mxslr/mlcraft (8 stars, last pushed 1mo ago), licensed MIT. It adds 159 tokens to every session and 828 once invoked, about $0.0008 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-31.

Related

Other skills, from other repositories

albucore-benchmarks

Running Albucore micro-benchmarks under benchmarks/, synthetic router timings, and comparing PyPI releases with uv --no-project. Use when adding benchmarks, comparing performance across versions, or documenting benchmark workflow.

albumentations-team/albucore · 48 tokens

albucore-conventions

Albucore image processing conventions - shapes (H,W,C), dtypes (uint8/float32), benchmark-driven backend routing (OpenCV, NumPy, Torch CPU, LUT, NumKong), tests, and lockfile discipline. Use when implementing or modifying albucore modules, writing tests, or reviewing image-processing code.

albumentations-team/albucore · 74 tokens

performance-optimization

Systematic performance audit for Albucore runtime code. Use whenever implementing, reviewing, profiling, or optimizing atomic image operations, backend routing, reductions, label maps, LUTs, random generation, dtype conversions, allocation-heavy paths, batch or volume kernels, or in-place behavior.

albumentations-team/albucore · 60 tokens

torch-performance-optimization

Optimize or review eager CPU-only Albucore PyTorch runtime paths with benchmark-backed decisions. Use when adding or changing Torch CPU kernels, Tensor/NumPy bridges, Torch backend routing, tensor layouts, allocations, threading, profiling, memory-format candidates, or Torch performance benchmarks.

albumentations-team/albucore · 60 tokens

albucore-public-api

Albucore star-exported API (all), routers vs albucore.functions shims, and dependents such as Albumentations. Use when changing exports, documenting API, or deciding what belongs in package all.

albumentations-team/albucore · 51 tokens

ml-for-aec

Computer vision for buildings, image-to-floorplan, generative ML models, performance prediction, structural analysis ML, energy prediction, natural language to design, and point cloud ML for AEC computational design.

Abhinavbwj/Claude-skills-for-Computational-Designers · 39 tokens