batch-inference

batch-inference is a skill for Claude Code, Codex from DuqueOM/ML-MLOps-Portfolio. It costs 35 tokens per session (1,740 once invoked), scanned A, original, MIT.

A workflow for scheduled batch predictions that scores many rows using the same model and feature code as a live prediction API. It creates a Kubernetes CronJob and writes the results as Parquet files.

In plain words
What is it for?
Use it for recurring bulk scoring, such as running predictions over large datasets on a schedule. It is intended for Kubernetes CronJobs, not one-off scripts or predictions needed immediately during a user action.
Why use it?
It prevents the feature logic used for batch jobs from drifting away from the logic used in training or live predictions. It also avoids sending millions of records through a one-request-at-a-time API.

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/duqueom/ml-mlops-portfolio/batch-inference
Any agent
npx skills add DuqueOM/ML-MLOps-Portfolio --skill batch-inference
Clone the repo
git clone --depth 1 https://github.com/DuqueOM/ML-MLOps-Portfolio

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 batch-inference

README.md
[![agentmods](https://agentmods.dev/badge/skills/duqueom/ml-mlops-portfolio/batch-inference.svg)](https://agentmods.dev/skills/duqueom/ml-mlops-portfolio/batch-inference)
Your own site
<a href="https://agentmods.dev/skills/duqueom/ml-mlops-portfolio/batch-inference"><img src="https://agentmods.dev/badge/skills/duqueom/ml-mlops-portfolio/batch-inference.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,740 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.00035 $0.01740
Opus 5 $0.00017 $0.00870
Sonnet 5 $0.00007 $0.00348
Haiku 4.5 $0.00003 $0.00174

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

Security

Grade A, and why

batch-inference 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.

.devin/skills/batch-inference/SKILL.md · 201 lines

How it starts

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

Batch Inference — scheduled scoring jobs

Real-time /predict serves one request at a time. Batch scoring reuses the SAME feature engineering + model artifact but runs over millions of rows in one process. Sharing the code path prevents training/serving skew AND training/batch skew — the classic silent-ML-failure mode.

When NOT to use this skill

  • Intermittent one-offs — script + argparse inside the service repo suffices; no need for a K8s CronJob.
  • Scoring must happen inline (form submission, checkout flow) — that is real-time; use /predict.
  • Training-adjacent batch (e.g., feature backfill for re-training) — that belongs in the training pipeline, not a batch scoring job.

Architecture

templates/service/
├── app/                 # real-time API (unchanged)
├── src/{service}/
│   ├── predictor.py     # EXISTING: shared predict() — used by both paths
│   └── batch.py         # NEW: batch runner — main() entry
└── k8s/base/
    └── cronjob-batch.yaml   # NEW: scheduled execution

Key principle: both paths import predictor.predict(). Never duplicate feature engineering. Any change to prediction logic auto- propagates to both.

Execution flow

Step 1 — Confirm intent (AUTO, 30s)

Agent confirms:

  • service name + code path exists
  • business cadence (hourly / daily / weekly / monthly)
  • input source (BigQuery table, S3 parquet, GCS folder)
  • output sink (parquet partitioned by date, BigQuery table, RDS)
  • expected row count per run (sizes the K8s resources)

Step 2 — Scaffold src/{service}/batch.py (AUTO)

The scaffolded module MUST:

  1. Read input via a PANDAS/Polars DataFrame
  2. Validate via the SAME Pandera schema used in training (rule 08)
  3. Call predictor.predict_batch(df) — same code as /predict
  4. Emit predictions as partitioned parquet with prediction_id, entity_id, model_version, prediction_score, timestamp
  5. Also call log_prediction() for each row — the closed-loop flywheel works for batch too (ADR-006, D-20/D-22)
  6. Emit metrics:
    • {service}_batch_rows_processed_total
    • {service}_batch_duration_seconds
    • {service}_batch_errors_total

Read the full file on GitHub · 201 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 · 201 lines · 35 tokens per session scan A eca3c605241f

Subscribe to this mod's changes

batch-inference is a skill published in the GitHub repository DuqueOM/ML-MLOps-Portfolio (5 stars, last pushed 3d ago), licensed MIT. It adds 35 tokens to every session and 1,740 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.

Related

Other skills, from other repositories

Cloud Security & Container Hardening

AWS/Azure/GCP security auditing, container and Kubernetes hardening, Infrastructure as Code scanning, and cloud compliance assessment.

Masriyan/Claude-Code-CyberSecurity-Skill · 30 tokens

ecspresso

ECS deployment tool - deploy, manage, and troubleshoot ECS services.

kayac/ecspresso · 17 tokens

awesome-kubernetes-ops

This skill documents the local verification, editing, and deployment procedures for the Antigravity AI Agent when pair-programming with the repository maintainer.

nubenetes/awesome-kubernetes · 0 tokens

geoserver-cloud

Use when deploying GeoServer on Kubernetes as cloud-native microservices with auto-scaling, service discovery, and centralized configuration. GeoServer Cloud: break monolithic GeoServer into independently scalable WMS/WFS/WCS services.

znlgis/opengis-skills · 49 tokens

container-manager-kubernetes-operations

Full operational Kubernetes surface via the container-manager-mcp MCP server — workloads (pods/rollouts/StatefulSets/DaemonSets/ReplicaSets/Jobs/CronJobs), config (ConfigMaps/Secrets/Namespaces/CRDs/patch), networking (Ingress/native Services/NetworkPolicy/DNS), storage (PV/PVC/StorageClass/snapshots/CSI), RBAC…

Knuckles-Team/container-manager-mcp · 189 tokens

eks-security

EKS security and compliance assessment — 7-layer hardening stack, CIS/HIPAA/PCI/FedRAMP/SOC2/GDPR audit prep, and 30/60/90 roadmap. Covers OS/AMI selection (Bottlerocket, AL2023, RHEL, Ubuntu), identity (EKS Pod Identity vs IRSA, Access Entries vs aws-auth), workload security (Pod Security Admission, Kyverno/OPA…

aws-samples/sample-apex-skills · 221 tokens