model-serving-and-monitoring

model-serving-and-monitoring is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 54 tokens per session (2,102 once invoked), scanned A, original, Apache-2.0.

A guide to putting a machine-learning model into an online service or scheduled batch job and watching its behaviour over time. It treats the serving code as a regular backend service with typed inputs, health checks, versioned model files, and monitoring.

In plain words
What is it for?
Use it when adding or changing model APIs, batch scoring, model files, drift checks, quality monitoring, or rollout plans. It helps keep training and serving transformations consistent and record which model produced each prediction.
Why use it?
A model can work in a notebook but fail in production when preprocessing differs, the wrong file loads, inputs change, or CPU work blocks a web service. Shared versions and monitoring help detect these problems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding or changing model APIs, batch scoring, model files, drift checks, quality monitoring, or rollout plans. It helps keep training and serving transformations consistent and record which model produced each prediction.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/model-serving-and-monitoring
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.

Any agent
npx skills add makifbaysal/tasktrooper --skill model-serving-and-monitoring
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

Made for: Claude Code, Codex.

Wrote 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.

agentmods badge for model-serving-and-monitoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/model-serving-and-monitoring/github.svg)](https://agentmods.dev/skills/makifbaysal/tasktrooper/model-serving-and-monitoring)
Your own site
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/model-serving-and-monitoring"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/model-serving-and-monitoring/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.

agentmods 80×15 button for model-serving-and-monitoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/model-serving-and-monitoring"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/model-serving-and-monitoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,102 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00054 $0.02102
Opus 5.5 $0.00022 $0.00841
Sonnet 5.5 $0.00011 $0.00420
Haiku 4.5 $0.00005 $0.00210

Measured 4d ago against content hash bea7bea9353a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

model-serving-and-monitoring 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 4d 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.

catalog/agents/data-scientist/skills/model-serving-and-monitoring/SKILL.md · 168 lines

How it starts

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

Model Serving and Monitoring

Overview

A model in production fails in ways a notebook never shows: the API re-implements preprocessing slightly differently, the artifact loaded is not the one evaluated, inputs drift away from the training data, or an async endpoint blocks on CPU work and the service stalls. Serving code is ordinary backend code with typed inputs, tests and a health check — plus a version on every prediction.

Core principle: serve the exact fitted pipeline you evaluated, identified by an immutable version, and log enough with every prediction to notice when the world stops looking like the training data.

1. Batch or online?

Need Choose
Scores consumed on a schedule (daily campaign, nightly risk list) batch scoring as a pipeline stage (data-pipeline-orchestration)
A decision inside a user request (fraud check, ranking) online endpoint with a latency budget
Both one fitted pipeline, two thin callers — never two feature implementations

Batch is simpler to operate, test and roll back; choose online only when the decision needs it.

2. Online endpoint (FastAPI)

class Features(BaseModel):
    model_config = ConfigDict(extra="forbid")
    days_since_order: int = Field(ge=0, le=3650)
    orders_90d: int = Field(ge=0)
    plan: Literal["free", "pro", "team"]

class ScoreRequest(BaseModel):
    model_config = ConfigDict(extra="forbid")
    rows: list[Features] = Field(min_length=1, max_length=1000)

class ScoreResponse(BaseModel):
    model_version: str
    scores: list[float]

def create_app(settings: Settings) -> FastAPI:
    @asynccontextmanager
    async def lifespan(app: FastAPI):
        app.state.model = load_model(settings.model_path, settings.trusted_types)
        app.state.model_version = settings.model_version
        yield

    app = FastAPI(lifespan=lifespan)

    @app.get("/health")
    def health() -> dict[str, str]:
        return {"status": "ok"}

    @app.get("/ready")
    def ready(request: Request) -> dict[str, str]:
        if getattr(request.app.state, "model", None) is None:
            raise HTTPException(status_code=503, detail="model not loaded")
        return {"status": "ready", "model_version": request.app.state.model_version}

    @app.post("/score")
    def score(body: ScoreRequest, request: Request) -> ScoreResponse:
        frame = pd.DataFrame([row.model_dump() for row in body.rows])
        proba = request.app.state.model.predict_proba(frame)[:, 1]
        return ScoreResponse(model_version=request.app.state.model_version, scores=proba.tolist())

    return app

Read the full file on GitHub · 168 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. 4d ago First seen · 168 lines · 54 tokens per session scan A bea7bea9353a

Subscribe to this mod's changes

model-serving-and-monitoring is a skill published in the GitHub repository makifbaysal/tasktrooper (113 stars, last pushed yesterday), licensed Apache-2.0. It adds 54 tokens to every session and 2,102 once invoked, about $0.0002 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-10-09.