Senior ml engineer

ML engineering skill for productionizing models, building MLOps pipelines, and integrating LLMs.

How to use it

Claude Code
  1. Run the line below. It pulls the whole folder into ~/.claude/skills/senior-ml-engineer, including the files SKILL.md points to.
  2. Describe your job in plain words. Claude Code follows the skill from there.
Claude Code — installs the whole folder, not just SKILL.md
npx degit alirezarezvani/claude-skills/engineering-team/skills/senior-ml-engineer#main ~/.claude/skills/senior-ml-engineer

For one project only, change the path to .claude/skills/senior-ml-engineer. This skill also uses requirements.txt, rag_config.yaml, monitoring.yaml — copying SKILL.md alone won't be enough. See the folder on GitHub.

Claude (web or desktop app)
  1. On this page open ⋯ → Download .md.
  2. Save it as SKILL.md in a folder, zip the folder, then Customize → Skills → + → Create skill → Upload a skill.
  3. Pick the file and Save. Claude shows the name and description and runs a security scan.
  4. Check the skill is switched on.
  5. Start a new chat and describe your job in plain words. The AI follows the skill from there.
ChatGPT or another app
  1. ChatGPT: make a Project and paste it into Instructions.
  2. Neither? Paste it at the top of a new chat — it works for that chat.
Not working?
  • Check which app you pasted it into — the steps above name the right one.
  • Some skills need the paid tier of Claude or ChatGPT.
Step-by-step guide with screenshots · Ask in the forum

Paste into Claude, ChatGPT or Cursor.

Source of Senior ml engineer

Show the full text316 lines
namedescriptiontriggers
senior-ml-engineerML engineering skill for productionizing models, building MLOps pipelines, and integrating LLMs. Covers model deployment, feature stores, drift monitoring, RAG systems, and cost optimization. Use when the user asks about deploying ML models to production, setting up MLOps infrastructure (MLflow, Kubeflow, Kubernetes, Docker), monitoring model performance or drift, building RAG pipelines, or integrating LLM APIs with retry logic and cost controls. Focused on production and operational concerns rather than model research or initial training. - MLOps pipeline - model deployment - feature store - model monitoring - drift detection - RAG system - LLM integration - model serving - A/B testing ML - automated retraining

Senior ML Engineer

Production ML engineering patterns for model deployment, MLOps infrastructure, and LLM integration.


Table of Contents


Model Deployment Workflow

Deploy a trained model to production with monitoring:

  1. Export model to standardized format (ONNX, TorchScript, SavedModel)
  2. Package model with dependencies in Docker container
  3. Deploy to staging environment
  4. Run integration tests against staging
  5. Deploy canary (5% traffic) to production
  6. Monitor latency and error rates for 1 hour
  7. Promote to full production if metrics pass
  8. Validation: p95 latency < 100ms, error rate < 0.1%
Container Template
FROM python:3.11-slim

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY model/ /app/model/
COPY src/ /app/src/

HEALTHCHECK CMD curl -f http://localhost:8080/health || exit 1

EXPOSE 8080
CMD ["uvicorn", "src.server:app", "--host", "0.0.0.0", "--port", "8080"]
Serving Options
Option Latency Throughput Use Case
FastAPI + Uvicorn Low Medium REST APIs, small models
Triton Inference Server Very Low Very High GPU inference, batching
TensorFlow Serving Low High TensorFlow models
TorchServe Low High PyTorch models
Ray Serve Medium High Complex pipelines, multi-model

MLOps Pipeline Setup

Establish automated training and deployment:

  1. Configure feature store (Feast, Tecton) for training data
  2. Set up experiment tracking (MLflow, Weights & Biases)
  3. Create training pipeline with hyperparameter logging
  4. Register model in model registry with version metadata
  5. Configure staging deployment triggered by registry events
  6. Set up A/B testing infrastructure for model comparison
  7. Enable drift monitoring with alerting
  8. Validation: New models automatically evaluated against baseline
Feature Store Pattern
from feast import Entity, Feature, FeatureView, FileSource

user = Entity(name="user_id", value_type=ValueType.INT64)

user_features = FeatureView(
    name="user_features",
    entities=["user_id"],
    ttl=timedelta(days=1),
    features=[
        Feature(name="purchase_count_30d", dtype=ValueType.INT64),
        Feature(name="avg_order_value", dtype=ValueType.FLOAT),
    ],
    online=True,
    source=FileSource(path="data/user_features.parquet"),
)
Retraining Triggers
Trigger Detection Action
Scheduled Cron (weekly/monthly) Full retrain
Performance drop Accuracy < threshold Immediate retrain
Data drift PSI > 0.2 Evaluate, then retrain
New data volume X new samples Incremental update

LLM Integration Workflow

Integrate LLM APIs into production applications:

  1. Create provider abstraction layer for vendor flexibility
  2. Implement retry logic with exponential backoff
  3. Configure fallback to secondary provider
  4. Set up token counting and context truncation
  5. Add response caching for repeated queries
  6. Implement cost tracking per request
  7. Add structured output validation with Pydantic
  8. Validation: Response parses correctly, cost within budget
Provider Abstraction
from abc import ABC, abstractmethod
from tenacity import retry, stop_after_attempt, wait_exponential

class LLMProvider(ABC):
    @abstractmethod
    def complete(self, prompt: str, **kwargs) -> str:
        pass

@retry(stop=stop_after_attempt(3), wait=wait_exponential(min=1, max=10))
def call_llm_with_retry(provider: LLMProvider, prompt: str) -> str:
    return provider.complete(prompt)
Cost Management

Do not hardcode prices, and do not trust a price table you find in a document (including this one). Providers reprice several times a year, and a stale figure produces a confidently wrong business case.

Work in tiers and look the current numbers up at request time:

Tier Typical use Relative cost
Small Classification, extraction, routing, short output 1x baseline
Mid Summarisation, structured output, moderate reasoning ~10-25x small
Large Multi-step reasoning, code generation, long context ~50-100x small

Read the live rate from your provider's pricing page and pass it in, the way engineering-team/skills/senior-prompt-engineer/scripts/prompt_optimizer.py takes --price-per-mtok. The ratios between tiers are far more stable than the absolute prices, so build the model-routing decision on the ratio.


RAG System Implementation

Build retrieval-augmented generation pipeline:

  1. Choose vector database (Pinecone, Qdrant, Weaviate)
  2. Select embedding model based on quality/cost tradeoff
  3. Implement document chunking strategy
  4. Create ingestion pipeline with metadata extraction
  5. Build retrieval with query embedding
  6. Add reranking for relevance improvement
  7. Format context and send to LLM
  8. Validation: Response references retrieved context, no hallucinations
Vector Database Selection
Database Hosting Scale Latency Best For
Pinecone Managed High Low Production, managed
Qdrant Both High Very Low Performance-critical
Weaviate Both High Low Hybrid search
Chroma Self-hosted Medium Low Prototyping
pgvector Self-hosted Medium Medium Existing Postgres
Chunking Strategies
Strategy Chunk Size Overlap Best For
Fixed 500-1000 tokens 50-100 General text
Sentence 3-5 sentences 1 sentence Structured text
Semantic Variable Based on meaning Research papers
Recursive Hierarchical Parent-child Long documents

Model Monitoring

Monitor production models for drift and degradation:

  1. Set up latency tracking (p50, p95, p99)
  2. Configure error rate alerting
  3. Implement input data drift detection
  4. Track prediction distribution shifts
  5. Log ground truth when available
  6. Compare model versions with A/B metrics
  7. Set up automated retraining triggers
  8. Validation: Alerts fire before user-visible degradation
Drift Detection
from scipy.stats import ks_2samp

def detect_drift(reference, current, threshold=0.05):
    statistic, p_value = ks_2samp(reference, current)
    return {
        "drift_detected": p_value < threshold,
        "ks_statistic": statistic,
        "p_value": p_value
    }
Alert Thresholds
Metric Warning Critical
p95 latency > 100ms > 200ms
Error rate > 0.1% > 1%
PSI (drift) > 0.1 > 0.2
Accuracy drop > 2% > 5%

Reference Documentation

MLOps Production Patterns

references/mlops_production_patterns.md contains:

  • Model deployment pipeline with Kubernetes manifests
  • Feature store architecture with Feast examples
  • Model monitoring with drift detection code
  • A/B testing infrastructure with traffic splitting
  • Automated retraining pipeline with MLflow
LLM Integration Guide

references/llm_integration_guide.md contains:

  • Provider abstraction layer pattern
  • Retry and fallback strategies with tenacity
  • Prompt engineering templates (few-shot, CoT)
  • Token optimization with tiktoken
  • Cost calculation and tracking
RAG System Architecture

references/rag_system_architecture.md contains:

  • RAG pipeline implementation with code
  • Vector database comparison and integration
  • Chunking strategies (fixed, semantic, recursive)
  • Embedding model selection guide
  • Hybrid search and reranking patterns

Tools

Model Deployment Pipeline
python scripts/model_deployment_pipeline.py --model model.pkl --target staging

Generates deployment artifacts: Dockerfile, Kubernetes manifests, health checks.

RAG System Builder
python scripts/rag_system_builder.py --config rag_config.yaml --analyze

Scaffolds RAG pipeline with vector store integration and retrieval logic.

ML Monitoring Suite
python scripts/ml_monitoring_suite.py --config monitoring.yaml --deploy

Sets up drift detection, alerting, and performance dashboards.


Tech Stack

Category Tools
ML Frameworks PyTorch, TensorFlow, Scikit-learn, XGBoost
LLM Frameworks LangChain, LlamaIndex, DSPy
MLOps MLflow, Weights & Biases, Kubeflow
Data Spark, Airflow, dbt, Kafka
Deployment Docker, Kubernetes, Triton
Databases PostgreSQL, BigQuery, Pinecone, Redis
1---
2name: "senior-ml-engineer"
3description: ML engineering skill for productionizing models, building MLOps pipelines, and integrating LLMs. Covers model deployment, feature stores, drift monitoring, RAG systems, and cost optimization. Use when the user asks about deploying ML models to production, setting up MLOps infrastructure (MLflow, Kubeflow, Kubernetes, Docker), monitoring model performance or drift, building RAG pipelines, or integrating LLM APIs with retry logic and cost controls. Focused on production and operational concerns rather than model research or initial training.
4triggers:
5 - MLOps pipeline
6 - model deployment
7 - feature store
8 - model monitoring
9 - drift detection
10 - RAG system
11 - LLM integration
12 - model serving
13 - A/B testing ML
14 - automated retraining
15---
16 
17# Senior ML Engineer
18 
19Production ML engineering patterns for model deployment, MLOps infrastructure, and LLM integration.
20 
21---
22 
23## Table of Contents
24 
25- [Model Deployment Workflow](#model-deployment-workflow)
26- [MLOps Pipeline Setup](#mlops-pipeline-setup)
27- [LLM Integration Workflow](#llm-integration-workflow)
28- [RAG System Implementation](#rag-system-implementation)
29- [Model Monitoring](#model-monitoring)
30- [Reference Documentation](#reference-documentation)
31- [Tools](#tools)
32 
33---
34 
35## Model Deployment Workflow
36 
37Deploy a trained model to production with monitoring:
38 
391. Export model to standardized format (ONNX, TorchScript, SavedModel)
402. Package model with dependencies in Docker container
413. Deploy to staging environment
424. Run integration tests against staging
435. Deploy canary (5% traffic) to production
446. Monitor latency and error rates for 1 hour
457. Promote to full production if metrics pass
468. **Validation:** p95 latency < 100ms, error rate < 0.1%
47 
48### Container Template
49 
50```dockerfile
51FROM python:3.11-slim
52 
53COPY requirements.txt .
54RUN pip install --no-cache-dir -r requirements.txt
55 
56COPY model/ /app/model/
57COPY src/ /app/src/
58 
59HEALTHCHECK CMD curl -f http://localhost:8080/health || exit 1
60 
61EXPOSE 8080
62CMD ["uvicorn", "src.server:app", "--host", "0.0.0.0", "--port", "8080"]
63```
64 
65### Serving Options
66 
67| Option | Latency | Throughput | Use Case |
68|--------|---------|------------|----------|
69| FastAPI + Uvicorn | Low | Medium | REST APIs, small models |
70| Triton Inference Server | Very Low | Very High | GPU inference, batching |
71| TensorFlow Serving | Low | High | TensorFlow models |
72| TorchServe | Low | High | PyTorch models |
73| Ray Serve | Medium | High | Complex pipelines, multi-model |
74 
75---
76 
77## MLOps Pipeline Setup
78 
79Establish automated training and deployment:
80 
811. Configure feature store (Feast, Tecton) for training data
822. Set up experiment tracking (MLflow, Weights & Biases)
833. Create training pipeline with hyperparameter logging
844. Register model in model registry with version metadata
855. Configure staging deployment triggered by registry events
866. Set up A/B testing infrastructure for model comparison
877. Enable drift monitoring with alerting
888. **Validation:** New models automatically evaluated against baseline
89 
90### Feature Store Pattern
91 
92```python
93from feast import Entity, Feature, FeatureView, FileSource
94 
95user = Entity(name="user_id", value_type=ValueType.INT64)
96 
97user_features = FeatureView(
98 name="user_features",
99 entities=["user_id"],
100 ttl=timedelta(days=1),
101 features=[
102 Feature(name="purchase_count_30d", dtype=ValueType.INT64),
103 Feature(name="avg_order_value", dtype=ValueType.FLOAT),
104 ],
105 online=True,
106 source=FileSource(path="data/user_features.parquet"),
107)
108```
109 
110### Retraining Triggers
111 
112| Trigger | Detection | Action |
113|---------|-----------|--------|
114| Scheduled | Cron (weekly/monthly) | Full retrain |
115| Performance drop | Accuracy < threshold | Immediate retrain |
116| Data drift | PSI > 0.2 | Evaluate, then retrain |
117| New data volume | X new samples | Incremental update |
118 
119---
120 
121## LLM Integration Workflow
122 
123Integrate LLM APIs into production applications:
124 
1251. Create provider abstraction layer for vendor flexibility
1262. Implement retry logic with exponential backoff
1273. Configure fallback to secondary provider
1284. Set up token counting and context truncation
1295. Add response caching for repeated queries
1306. Implement cost tracking per request
1317. Add structured output validation with Pydantic
1328. **Validation:** Response parses correctly, cost within budget
133 
134### Provider Abstraction
135 
136```python
137from abc import ABC, abstractmethod
138from tenacity import retry, stop_after_attempt, wait_exponential
139 
140class LLMProvider(ABC):
141 @abstractmethod
142 def complete(self, prompt: str, **kwargs) -> str:
143 pass
144 
145@retry(stop=stop_after_attempt(3), wait=wait_exponential(min=1, max=10))
146def call_llm_with_retry(provider: LLMProvider, prompt: str) -> str:
147 return provider.complete(prompt)
148```
149 
150### Cost Management
151 
152Do not hardcode prices, and do not trust a price table you find in a document
153(including this one). Providers reprice several times a year, and a stale
154figure produces a confidently wrong business case.
155 
156Work in tiers and look the current numbers up at request time:
157 
158| Tier | Typical use | Relative cost |
159|------|-------------|---------------|
160| Small | Classification, extraction, routing, short output | 1x baseline |
161| Mid | Summarisation, structured output, moderate reasoning | ~10-25x small |
162| Large | Multi-step reasoning, code generation, long context | ~50-100x small |
163 
164Read the live rate from your provider's pricing page and pass it in, the way
165`engineering-team/skills/senior-prompt-engineer/scripts/prompt_optimizer.py`
166takes `--price-per-mtok`.
167The ratios between tiers are far more stable than the absolute prices, so
168build the model-routing decision on the ratio.
169 
170---
171 
172## RAG System Implementation
173 
174Build retrieval-augmented generation pipeline:
175 
1761. Choose vector database (Pinecone, Qdrant, Weaviate)
1772. Select embedding model based on quality/cost tradeoff
1783. Implement document chunking strategy
1794. Create ingestion pipeline with metadata extraction
1805. Build retrieval with query embedding
1816. Add reranking for relevance improvement
1827. Format context and send to LLM
1838. **Validation:** Response references retrieved context, no hallucinations
184 
185### Vector Database Selection
186 
187| Database | Hosting | Scale | Latency | Best For |
188|----------|---------|-------|---------|----------|
189| Pinecone | Managed | High | Low | Production, managed |
190| Qdrant | Both | High | Very Low | Performance-critical |
191| Weaviate | Both | High | Low | Hybrid search |
192| Chroma | Self-hosted | Medium | Low | Prototyping |
193| pgvector | Self-hosted | Medium | Medium | Existing Postgres |
194 
195### Chunking Strategies
196 
197| Strategy | Chunk Size | Overlap | Best For |
198|----------|------------|---------|----------|
199| Fixed | 500-1000 tokens | 50-100 | General text |
200| Sentence | 3-5 sentences | 1 sentence | Structured text |
201| Semantic | Variable | Based on meaning | Research papers |
202| Recursive | Hierarchical | Parent-child | Long documents |
203 
204---
205 
206## Model Monitoring
207 
208Monitor production models for drift and degradation:
209 
2101. Set up latency tracking (p50, p95, p99)
2112. Configure error rate alerting
2123. Implement input data drift detection
2134. Track prediction distribution shifts
2145. Log ground truth when available
2156. Compare model versions with A/B metrics
2167. Set up automated retraining triggers
2178. **Validation:** Alerts fire before user-visible degradation
218 
219### Drift Detection
220 
221```python
222from scipy.stats import ks_2samp
223 
224def detect_drift(reference, current, threshold=0.05):
225 statistic, p_value = ks_2samp(reference, current)
226 return {
227 "drift_detected": p_value < threshold,
228 "ks_statistic": statistic,
229 "p_value": p_value
230 }
231```
232 
233### Alert Thresholds
234 
235| Metric | Warning | Critical |
236|--------|---------|----------|
237| p95 latency | > 100ms | > 200ms |
238| Error rate | > 0.1% | > 1% |
239| PSI (drift) | > 0.1 | > 0.2 |
240| Accuracy drop | > 2% | > 5% |
241 
242---
243 
244## Reference Documentation
245 
246### MLOps Production Patterns
247 
248`references/mlops_production_patterns.md` contains:
249 
250- Model deployment pipeline with Kubernetes manifests
251- Feature store architecture with Feast examples
252- Model monitoring with drift detection code
253- A/B testing infrastructure with traffic splitting
254- Automated retraining pipeline with MLflow
255 
256### LLM Integration Guide
257 
258`references/llm_integration_guide.md` contains:
259 
260- Provider abstraction layer pattern
261- Retry and fallback strategies with tenacity
262- Prompt engineering templates (few-shot, CoT)
263- Token optimization with tiktoken
264- Cost calculation and tracking
265 
266### RAG System Architecture
267 
268`references/rag_system_architecture.md` contains:
269 
270- RAG pipeline implementation with code
271- Vector database comparison and integration
272- Chunking strategies (fixed, semantic, recursive)
273- Embedding model selection guide
274- Hybrid search and reranking patterns
275 
276---
277 
278## Tools
279 
280### Model Deployment Pipeline
281 
282```bash
283python scripts/model_deployment_pipeline.py --model model.pkl --target staging
284```
285 
286Generates deployment artifacts: Dockerfile, Kubernetes manifests, health checks.
287 
288### RAG System Builder
289 
290```bash
291python scripts/rag_system_builder.py --config rag_config.yaml --analyze
292```
293 
294Scaffolds RAG pipeline with vector store integration and retrieval logic.
295 
296### ML Monitoring Suite
297 
298```bash
299python scripts/ml_monitoring_suite.py --config monitoring.yaml --deploy
300```
301 
302Sets up drift detection, alerting, and performance dashboards.
303 
304---
305 
306## Tech Stack
307 
308| Category | Tools |
309|----------|-------|
310| ML Frameworks | PyTorch, TensorFlow, Scikit-learn, XGBoost |
311| LLM Frameworks | LangChain, LlamaIndex, DSPy |
312| MLOps | MLflow, Weights & Biases, Kubeflow |
313| Data | Spark, Airflow, dbt, Kafka |
314| Deployment | Docker, Kubernetes, Triton |
315| Databases | PostgreSQL, BigQuery, Pinecone, Redis |
316 

Discussion

Alternatives

Also in Models & evalsSee all 533 in Development →
AI engineerAct as an expert AI engineer specializing in practical machine learning implementation and AI integration for production applications, ensuring efficient and robust AI solutions.Coding · CC0-1.0OneKGPd: Individual-Level Queries over the 1000 Genomes ProjectQuery the 1000 Genomes Project dataset (3,202 whole-genome-sequenced individuals, GRCh38) at the level of individual participants. Use when a question is about individuals or variants in the 1000 Genomes Project cohort: which individuals carry variants matching specific criteria in a gene or region, which individuals are homozygous-reference at a position, which variants exist in the dataset or carried by specified individuals in a gene or region, the relatedness between two specified individuals. Variants are returned with 1000 Genomes allele frequencies (AF), gnomAD v4.1 exome and genome AF, AlphaMissense score, and HGVSp annotations.Science · MITPyMC Bayesian ModelingBayesian modeling with PyMC. Build hierarchical models, MCMC (NUTS), variational inference, LOO/WAIC comparison, posterior checks, for probabilistic programming and inference.Science · MITStatsmodels: Statistical Modeling and EconometricsStatistical models library for Python. Use when you need specific model classes (OLS, GLM, mixed models, ARIMA) with detailed diagnostics, residuals, and inference. Best for econometrics, time series, rigorous inference with coefficient tables. For guided statistical test selection with APA reporting use statistical-analysis.Science · MIT