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/param087/agent-ml-skills/model-servingnpx skills add param087/agent-ml-skills --skill model-servinggit clone --depth 1 https://github.com/param087/agent-ml-skillsWrote 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/param087/agent-ml-skills/model-serving)<a href="https://agentmods.dev/skills/param087/agent-ml-skills/model-serving"><img src="https://agentmods.dev/badge/skills/param087/agent-ml-skills/model-serving.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.00042 | $0.00718 |
| Opus 5 | $0.00021 | $0.00359 |
| Sonnet 5 | $0.00008 | $0.00144 |
| Haiku 4.5 | $0.00004 | $0.00072 |
Grade A, and why
model-serving 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.
How it starts
The opening of the file, as written. The whole thing — 85 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Model Serving
Overview
Serving turns a saved model into a reliable, low-latency API. The concerns shift from accuracy to latency, throughput, robustness, and observability. The model artifact and its preprocessing must travel together (use the pipeline from sklearn-pipelines).
When to use
- A validated model needs to be callable by other systems.
- Moving from notebook to production.
Minimal FastAPI service
from fastapi import FastAPI
from pydantic import BaseModel
import joblib, numpy as np
app = FastAPI()
model = joblib.load("model.joblib") # full pipeline: preprocessing + estimator
class Features(BaseModel):
age: float
income: float
country: str
plan: str
@app.get("/health")
def health():
return {"status": "ok"}
@app.post("/predict")
def predict(f: Features):
import pandas as pd
X = pd.DataFrame([f.model_dump()])
proba = float(model.predict_proba(X)[0, 1])
return {"probability": proba, "label": int(proba >= 0.5)}
Run: uvicorn app:app --host 0.0.0.0 --port 8000 --workers 4.
Production checklist
- Load the model once at startup, not per request.
- Validate inputs with Pydantic; return 422 on bad payloads.
- Health/readiness endpoints for orchestrators (k8s).
- Batch requests where possible to raise throughput.
- Timeouts + graceful degradation for downstream calls.
- Version the model in the response (
model_version) for traceability. - Pin the artifact's training env — preprocessing must match training exactly.
Speed: ONNX + quantization
# Export sklearn/torch model to ONNX, then serve with onnxruntime
import onnxruntime as ort
sess = ort.InferenceSession("model.onnx", providers=["CPUExecutionProvider"])
out = sess.run(None, {"input": X.astype(np.float32)})
ONNX runtime + dynamic quantization often gives 2-4x CPU speedups. For LLMs, use vLLM/TGI rather than rolling your own.
Monitoring (don't deploy blind)
- Operational: latency p50/p95/p99, error rate, throughput.
- ML-specific: input feature drift, prediction distribution shift, and (when labels arrive) live metric decay.
- Alert on drift — a silently degrading model is worse than a down one.
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.
- 3d ago First seen · 85 lines · 42 tokens per session scan A 389cc7559425
model-serving is a skill published in the GitHub repository param087/agent-ml-skills (9 stars, last pushed 2mo ago), licensed MIT. It adds 42 tokens to every session and 718 once invoked, about $0.0002 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.
Other skills, from other repositories
stock-data-fetch
Fetch multi-market financial data — US (FMP→Finnhub), A/HK (Tencent→Sina), crypto (OKX→Hyperliquid), commodities (Hyperliquid+Finnhub), news (Marketaux), backup (Longbridge). Battle-tested in restricted network environments.
data-scientist
数据分析全流程:数据画像、统计检验、可视化、报告生成。三阶段流程(数据摄入→分析执行→报告生成),单 agent 完成,无需多 agent 编排。当用户提到 CSV/Excel/Parquet 数据分析、假设检验、统计报告、制造业分析(良率/SPC/Cpk)、A/B 测试、或数据质量问题诊断时使用。.
auth-web-cloudbase
CloudBase Web Authentication Quick Guide for frontend integration after auth-tool has already been checked. Provides concise and practical Web authentication solutions with multiple login methods and complete user management.
browse-and-evaluate
Use when exploring the ai-agent-skills catalog to find, compare, and evaluate skills before installing. Always use --fields to limit output size and --dry-run before committing to an install.
loop-engineering
Shared loop-engineering reference for COG skills - the agent loop, deterministic verifiers, termination conditions, in-loop context management, and named patterns. Invoke when designing or debugging a skill that iterates (search-verify-retry, scan-until-dry, fetch-retry-gate).
telnyx-messaging-hosted-curl
Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when migrating numbers or enabling rich messaging features. This skill provides REST API (curl) examples.