model-deployment
Skill2 starsChanged 12 days agoMITView on GitHub
Model Deployment. Serve a trained model in production - load a pickled pipeline safely, FastAPI prediction service (predict, batch, what-if, SHAP explanations, LLM narrative), Pydantic validation from schema.json, Docker multi-stage image, docker-compose with nginx, health checks, API keys, CORS, rate limits, JSON logging, Prometheus metrics, drift monitoring (PSI, KS), batch scoring, ONNX or PMML export and air-gapped installs. Use for deploy, serve, productionize, REST API, MLOps, model serving, monitoring or containerizing a model.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- awslabs/agent-pluginstheir own version, first seen Oct 13, 2026
- talhaMah56/claude_skillstheir own version, first seen Sep 12, 2026
- gmanch94/claude-code-aidlc-templatetheir own version, first seen Jul 11, 2026
- ScientiaCapital/unsloth-mcp-servertheir own version, first seen Feb 21, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- awslabs/agent-plugins★ 918same name
- gmanch94/claude-code-aidlc-template★ 2same name
- ScientiaCapital/unsloth-mcp-server★ 2same name
- talhaMah56/claude_skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- ai-prediction-explainerSkill
- data-mining-machine-learningSkill
- data-miningSkill
- data-preparationSkill
- data-profilingSkill
- data-storytellingSkill
- feature-engineeringSkill
- hyperparameter-tuningSkill
- ml-quality-guardSkill
- ml-web-applicationSkill
- model-evaluationSkill
- model-explainabilitySkill
- model-trainingSkill
- notebook-auditSkill
- problem-framingSkill
- statistical-analysisSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Verify the bundle: bin/data-mining-ml verify-model models/<version>.
- Very specific: line 14
Run tests: cd api && pytest (schema validation, predict, what-if additivity, explanations, narrative with the provider mocked, grounding, …
- Very specific: line 15
Run locally: uvicorn app.main:create_app --factory --port 8000 with MODEL_DIR=../models APP_ENV=development.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Model Deployment
Scaffold: templates/ml-service/ (becomes api/ via bin/data-mining-ml init). The pickled pipeline from model-training is the model of record.
Steps
- Verify the bundle:
bin/data-mining-ml verify-model models/<version>. - Copy the scaffold, install
src/<package>into the image, pinapi/requirements.txttometadata.jsonlibraries. - Run tests:
cd api && pytest(schema validation, predict, what-if additivity, explanations, narrative with the provider mocked, grounding, security limits, tamper detection). - Run locally:
uvicorn app.main:create_app --factory --port 8000withMODEL_DIR=../models APP_ENV=development. - Build and run:
docker compose up --build(API plus nginx serving the React app; nginx injects the API key). - Wire monitoring: scrape
/metrics; alert onfeature_drift_psiabove 0.2, risinginput_range_violations_total, and explainer fallbacks.
Endpoints
| Route | Purpose |
GET /health/live, GET /health/ready | Liveness; readiness means loaded and verified |
GET /v1/model, GET /v1/schema | Version, metrics with intervals, threshold, limits; predictor definitions for the UI |
POST /v1/predict, POST /v1/predict/batch | Probability or value, label at the stored threshold, version, request id, extrapolation flags |
POST /v1/whatif | Baseline versus scenario, delta, contributions for both |
POST /v1/explain/local, POST /v1/explain/counterfactuals | Shapley contributions; smallest threshold-crossing changes |
POST /v1/explain/narrative | Server-built RTCC context, LLM answer, grounding check, SSE stream |
Engineering rules
- Load once in the
lifespanhandler; keep it onapp.state; never load inside a route. - Inference is blocking: plain
defroutes (FastAPI threadpool) orrun_in_threadpool. - Pydantic models generated from
schema.json; unknown fields rejected; categories enumerated; out-of-range numerics needallow_extrapolationand come back flagged. - Column order and dtypes come from the schema, enforced before
predict. - The server recomputes everything it sends to the LLM; clients never send explanation values.
- API key dependency, explicit CORS allowlist without credentials, body size limit, rate limit, no upload endpoint.
- JSON logs with request id and no raw personal data;
/metricswith request counts, latency, prediction distribution, range violations and PSI drift. - Docker: multi-stage, slim base, pinned requirements, non-root user, no
--reload,HEALTHCHECK, model directory mounted read-only. Each worker holds its own model copy; size workers to memory. - Air-gapped: vendored wheels (
pip downloadthen--no-index --find-links),LLM_PROVIDER=nonemakes no external calls and uses template explanations.
Details, batch scoring, ONNX and PMML, Java and .NET: references/fastapi-serving.md.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

