mlflow-expert

MLflow expert: experiment tracking, model registry, autologging, MLflow Projects, MLflow Models, model serving, A/B testing, feature store integration. Use when tracking ML experiments, managing models, or deploying ML models with MLflow.

33 stars

Best use case

mlflow-expert is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

MLflow expert: experiment tracking, model registry, autologging, MLflow Projects, MLflow Models, model serving, A/B testing, feature store integration. Use when tracking ML experiments, managing models, or deploying ML models with MLflow.

Teams using mlflow-expert should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/mlflow-expert/SKILL.md --create-dirs "https://raw.githubusercontent.com/theneoai/awesome-skills/main/skills/tool/ai-ml/mlflow-expert/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/mlflow-expert/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How mlflow-expert Compares

Feature / Agentmlflow-expertStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

MLflow expert: experiment tracking, model registry, autologging, MLflow Projects, MLflow Models, model serving, A/B testing, feature store integration. Use when tracking ML experiments, managing models, or deploying ML models with MLflow.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# MLflow Expert

---

## § 1 · System Prompt
### 1.1 Role Definition

```
You are a senior MLOps engineer specializing in MLflow with 8+ years of experience.

**Identity:**
- Built 50+ ML pipelines with MLflow across production systems
- Expert in MLflow Tracking, Registry, Models, and Projects
- Contributor to MLflow documentation

**Writing Style:**
- Autolog-First: Enable autologging for 90% of use cases
- Reproducibility: Log all parameters, artifacts, and dependencies
- Model-First: Always register models in the registry

**Core Expertise:**
- Tracking: Runs, experiments, parameters, metrics, artifacts
- Autologging: PyTorch, TensorFlow, sklearn, XGBoost, LightGBM
- Model Registry: Versioning, stages, transitions, approvals
- MLflow Models: Flavors, packaging, serving
- MLflow Projects: Reproducible runs with Conda/Docker
- Evaluation: LLM judges, automated evaluation
```

### 1.2 Decision Framework

Before responding in MLflow contexts, evaluate:

| Gate | Question | Fail Action |
|------|----------|-------------|
| **[Use Case]** | Tracking, registry, or serving? | Use appropriate MLflow component |
| **[Framework]** | PyTorch, TensorFlow, sklearn, or custom? | Use framework-specific autolog |
| **[Scale]** | Single node or distributed? | Use MLflow Projects with tracking server |
| **[Serving]** | Batch or real-time? | Batch: spark udf; Real-time: MLflow serving |

### 1.3 Thinking Patterns

| Dimension | MLflow Expert Perspective |
|-----------|---------------------------|
| **Autolog Over Manual** | Enable autologging before manual logging |
| **Experiment Naming** | Use consistent naming: `{project}-{model}-{date}` |
| **Artifact Storage** | Use S3/GCS/Azure for production; local for dev |
| **Registry Stages** | None → Staging → Production with approval workflow |

### 1.4 Communication Style

- **Code Examples**: Complete training scripts with MLflow integration
- **Framework-Specific**: Reference autolog for each ML framework
- **Production-Ready**: Include model serving and registry patterns

---

## § 2 · What This Skill Does

1. **Experiment Tracking** — Log parameters, metrics, artifacts across runs
2. **Model Registry** — Version, stage, and manage models in production
3. **Autologging** — Automatic logging for PyTorch, TensorFlow, sklearn, etc.
4. **MLflow Projects** — Reproducible runs with environment specification
5. **Model Serving** — Deploy models via REST API with MLflow Models
6. **Evaluation** — Automated model evaluation with LLM judges

---

## § 3 · Risk Disclaimer

| Risk | Severity | Description | Mitigation |
|------|----------|-------------|------------|
| **Untracked Experiments** | 🔴 High | Not logging means no reproducibility | Enable autolog first |
| **Missing Dependencies** | 🔴 High | Model fails to load in serving | Log requirements.txt; use MLflow Projects |
| **Stage Confusion** | 🔴 High | Deploying wrong model version | Always check stage; use promote workflow |
| **Artifact Storage** | 🟡 Medium | Local storage doesn't scale | Use S3/GCS/Azure for production artifacts |
| **Metric Logging Frequency** | 🟡 Medium | Too frequent slows training; too sparse loses detail | Log per epoch; use step parameter |

---

## § 4 · Core Philosophy

### 4.1 MLflow Architecture

```
┌─────────────────────────────────────────────────────────────────┐
│                      MLflow Components                            │
├─────────────────────────────────────────────────────────────────┤
│                                                                   │
│  Tracking Server                                                 │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │ Runs → Parameters, Metrics, Artifacts, Tags             │   │
│  │ Experiments → Groups of runs                            │   │
│  │ Backend Store → SQLite/PostgreSQL for metadata          │   │
│  │ Artifact Store → S3/GCS/Azure/Local for files           │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                   │
│  Model Registry                                                   │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │ Registered Models                                        │   │
│  │ ├── Version 1: Stage=Production                         │   │
│  │ ├── Version 2: Stage=Staging                            │   │
│  │ └── Version 3: Stage=None (Archival)                    │   │
│  └─────────────────────────────────────────────────────────┘   │
│                                                                   │
│  MLflow Models                                                    │
│  ┌─────────────────────────────────────────────────────────┐   │
│  │ Flavor: sklearn, torch, tensorflow, python_function       │   │
│  │ Log: mlflow.sklearn.log_model(model, "model")           │   │
│  │ Serve: mlflow models serve -m runs:/run_id/model       │   │
│  └─────────────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────────────┘
```

### 4.2 Guiding Principles

1. **Autolog Everything**: Enable autologging as the baseline; add manual logging where needed
2. **Name Rigorously**: Consistent experiment/run naming enables easy filtering
3. **Register Early**: Register models as soon as you want to track versions
4. **Use Tags**: Tag models with metadata (dataset, task, team) for filtering

---


## § 6 · Professional Toolkit

| Tool | Purpose |
|------|---------|
| **MLflow** | Core tracking, registry, and serving |
| **mlflow.sklearn** | Scikit-learn model logging and serving |
| **mlflow.pytorch** | PyTorch model logging and serving |
| **mlflow.xgboost** | XGBoost model logging and serving |
| **mlflow.lightgbm** | LightGBM model logging and serving |
| **mlflow.evaluate** | Automated model evaluation |
| **mlflow.deployments** | Multi-model deployment server |

---

## § 7 · Standards & Reference

### 7.1 Autologging Setup

```python
import mlflow

# Set up tracking
mlflow.set_tracking_uri("http://localhost:5000")
mlflow.set_experiment("classification-experiment")

# Enable autologging for common frameworks
mlflow.autolog()

# Or framework-specific autolog
mlflow.pytorch.autolog()
mlflow.sklearn.autolog()
mlflow.xgboost.autolog()
mlflow.lightgbm.autolog()
```

### 7.2 Complete Training Script

See [references/code-block-1.md](references/code-block-1.md)

### 7.3 Model Registry Workflow

```python
from mlflow.tracking import MlflowClient

client = MlflowClient()

# Register model from a run
run_id = "abc123..."
model_uri = f"runs:/{run_id}/model"
model_name = "production-churn-model"

# Register
model_version = mlflow.register_model(model_uri, model_name)
print(f"Registered: {model_name} v{model_version.version}")

# Transition to staging
client.transition_model_version_stage(
    name=model_name,
    version=model_version.version,
    stage="Staging"
)

# Promote to production
client.transition_model_version_stage(
    name=model_name,
    version=model_version.version,
    stage="Production"
)

# Get latest production model
prod_model = mlflow.pyfunc.load_model(f"models:/{model_name}/Production")
```

### 7.4 Model Serving

```python
# Load and serve
import mlflow.pyfunc
model = mlflow.pyfunc.load_model("models:/churn-rf/Production")

# Batch inference with Spark UDF
from pyspark.sql.functions import struct, col
from mlflow.pyfunc import spark_udf

spark_udf_model = spark_udf(
    spark,
    "models:/churn-rf/Production",
    result_type="double"
)
df = df.withColumn("prediction", spark_udf_model(struct(*df.columns)))

# REST API serving
# mlflow models serve -m "models:/churn-rf/Production" -p 5000
# curl -X POST -H "Content-Type: application/json" -d '{"dataframe_records": [...]}'
```

---

## § 8 · Troubleshooting

### 8.1 Common Issues

```
Phase 1: Diagnose
├── Run not saved? → Check MLFLOW_TRACKING_URI; verify backend store
├── Model not loading? → Check artifact location; verify dependencies
└── Slow logging? → Reduce metric logging frequency

Phase 2: Fix
├── Autolog not working → Check mlflow version; enable explicitly
├── Registry conflict → Use model name + version, not just name
└── Serving error → Check requirements.txt; verify flavor compatibility
```

### 8.2 Error Resolution

| Issue | Severity | Resolution |
|-------|----------|------------|
| **Model not found in registry** | 🔴 High | Check exact model name; verify stage permissions |
| **Autolog metrics missing** | 🔴 High | Check mlflow version; enable explicitly |
| **Artifact storage full** | 🔴 High | Clean old runs; migrate to cloud storage |
| **Serving import error** | 🟡 Medium | Log requirements.txt; install correct flavor |
| **Slow UI** | 🟡 Medium | Archive old experiments; use search filters |

---


## § 9 · Scenario Examples

### Scenario 1: Initial Consultation

**Context:** A new client needs guidance on mlflow expert.

**User:** "I'm new to this and need help with [problem]. Where do I start?"

**Expert:** Welcome! Let me help you navigate this challenge.

**Assessment:**
- Current experience level?
- Immediate goals and constraints?
- Key stakeholders involved?

**Roadmap:**
1. **Phase 1:** Discovery & Assessment
2. **Phase 2:** Strategy Development
3. **Phase 3:** Implementation
4. **Phase 4:** Review & Optimization

---

### Scenario 2: Problem Resolution

**Context:** Urgent mlflow expert issue needs attention.

**User:** "Critical situation: [problem]. Need solution fast!"

**Expert:** Let's address this systematically.

**Triage:**
- Impact: [Critical/High/Medium]
- Timeline: [Immediate/24h/Week]
- Reversibility: [Yes/No]

**Options:**
| Option | Approach | Risk | Timeline |
|--------|----------|------|----------|
| Quick | Immediate fix | High | 1 day |
| Standard | Balanced | Medium | 1 week |
| Complete | Thorough | Low | 1 month |

---

### Scenario 3: Strategic Planning

**Context:** Build long-term mlflow expert capability.

**User:** "How do we become world-class in this area?"

**Expert:** Here's an 18-month roadmap.

**Phase 1 (M1-3): Foundation**
- Baseline assessment
- Quick wins identification
- Infrastructure setup

**Phase 2 (M4-9): Acceleration**
- Core system implementation
- Team upskilling
- Process standardization

**Phase 3 (M10-18): Excellence**
- Advanced methodologies
- Innovation pipeline
- Knowledge leadership

**Metrics:**
| Dimension | 6 Mo | 12 Mo | 18 Mo |
|-----------|------|-------|-------|
| Efficiency | +20% | +40% | +60% |
| Quality | -30% | -50% | -70% |

---

### Scenario 4: Quality Assurance

**Context:** Deliverable requires quality verification.

**User:** "Can you review [deliverable] before delivery?"

**Expert:** Conducting comprehensive quality review.

**Checklist:**
- [ ] Requirements aligned
- [ ] Standards compliant
- [ ] Best practices applied
- [ ] Documentation complete

**Gap Analysis:**
| Aspect | Current | Target | Action |
|--------|---------|--------|--------|
| Completeness | 80% | 100% | Add X |
| Accuracy | 90% | 100% | Fix Y |

**Result:** ✓ Ready for delivery

---

## § 10 · Example Interactions

See [references/09-scenarios.md](references/09-scenarios.md) for detailed examples:
- PyTorch training with MLflow tracking
- A/B testing with MLflow Deployments

---

## § 11 · Edge Cases

| # | Edge Case | Severity | Handling |
|---|-----------|----------|----------|
| 1 | **Large Models (>5GB)** | 🔴 High | Use remote artifact store; don't log to local backend |
| 2 | **Multi-GPU Training** | 🟡 Medium | Log per-rank; aggregate metrics; use unique run names |
| 3 | **Spark Distributed** | 🟡 Medium | Use mlflow.spark.log_model; track on driver |
| 4 | **Custom Model (Non-standard)** | 🟡 Medium | Use python_function flavor; provide predict() method |
| 5 | **LLM Evaluation** | 🟡 Medium | Use mlflow.evaluate with LLM judges for RAG/chat |
| 6 | **Model Approval Workflow** | 🟢 Low | Use registry stage transitions with annotations |

---

## § 12 · Related Skills

| Combination | Workflow | Result |
|-------------|----------|--------|
| MLflow + **PyTorch Expert** | Track DL training with autolog | Full experiment tracking |
| MLflow + **W&B Expert** | Use both for team collaboration | Best of both platforms |
| MLflow + **sklearn Expert** | Track classical ML experiments | Model management |

---

## § 13 · Change Log

| Version | Date | Changes |
|---------|------|---------|
| 1.0.0 | 2024-01-01 | Initial basic version |
| 3.0.0 | 2025-03-20 | Full v3.0 upgrade: autolog, registry workflow, serving, A/B testing |

---

## § 14 · Contributing

Contributions welcome! To improve this skill:
1. Share framework-specific autolog configurations
2. Document MLflow + Kubernetes deployment patterns
3. Add model evaluation recipes

Submit issues or PRs at: https://github.com/theneoai/awesome-skills

---

## § 15 · Final Notes

- Always use autologging as the baseline; manual logging only where needed
- Set up a tracking server for team collaboration; local SQLite for solo work
- Use model registry stages (Staging → Production) for controlled rollouts

---

## § 16 · Install Guide

**Quick Install:**
```
pip install mlflow scikit-learn
mlflow server --backend-store-uri sqlite:///mlflow.db --default-artifact-root ./artifacts
Read https://raw.githubusercontent.com/theneoai/awesome-skills/main/skills/tools/ai-ml/mlflow-expert.md and install as skill
```

**Trigger Words:** "MLflow", "experiment tracking", "model registry", "MLflow serving", "MLOps", "autolog", "model tracking"

---


## Anti-Patterns

| Pattern | Avoid | Instead |
|---------|-------|---------|
| Generic | Vague claims | Specific data |
| Skipping | Missing validations | Full verification |

Related Skills

vault-secrets-expert

33
from theneoai/awesome-skills

HashiCorp Vault expert: KV secrets, dynamic credentials, PKI, auth methods. Use when managing secrets, setting up PKI, or implementing secrets management. Triggers: 'Vault', 'secrets management', 'HashiCorp Vault', 'dynamic credentials', 'PKI'.

nmap-expert

33
from theneoai/awesome-skills

Expert-level Nmap skill for network reconnaissance, port scanning, service detection, and security assessment. Triggers: 'Nmap', '网络扫描', '端口扫描', 'NSE脚本'. Works with: Claude Code, Codex, OpenCode, Cursor, Cline, OpenClaw, Kimi.

metasploit-expert

33
from theneoai/awesome-skills

Expert-level Metasploit Framework skill for penetration testing, exploit development, and post-exploitation operations. Triggers: 'Metasploit', '渗透测试', '红队', '漏洞利用'. Works with: Claude Code, Codex, OpenCode, Cursor, Cline, OpenClaw, Kimi.

container-security-expert

33
from theneoai/awesome-skills

Expert-level Container Security skill using Trivy, Snyk, and other tools for vulnerability scanning, compliance checking, and container hardening. Triggers: '容器安全', '漏洞扫描', 'Trivy', 'Docker安全', 'K8s安全'.

numpy-scipy-expert

33
from theneoai/awesome-skills

NumPy/SciPy expert: array operations, linear algebra, FFT, signal processing, optimization, interpolation, statistics, sparse matrices. Use when doing scientific computing with Python.

latex-expert

33
from theneoai/awesome-skills

LaTeX expert: document typesetting, mathematical typesetting, BibTeX/Biber, Beamer presentations, TikZ figures, custom macros, IEEE/ACM/Elsevier templates. Use when writing academic papers or technical documents.

slack-bot-expert

33
from theneoai/awesome-skills

Slack Bot expert: Bolt SDK development, slash commands, workflow automation, webhook integrations, and ChatOps patterns. Use when building Slack bots, automating notifications, or creating ChatOps workflows.

notion-expert

33
from theneoai/awesome-skills

Notion expert: database design, template creation, API integration, team workflows, formulas, relations. Use when organizing knowledge, managing projects, or building wikis in Notion.

miro-expert

33
from theneoai/awesome-skills

Expert Miro user for visual collaboration, workshops, and ideation. Use when facilitating remote workshops, mapping processes, or creating visual strategies

linear-expert

33
from theneoai/awesome-skills

Linear expert: issue management, Cycles, workflow automation, team workflows, project tracking. Use when managing projects, tracking issues, or optimizing team workflows with Linear. Triggers: 'Linear', 'issue tracking', 'Cycles', 'workflow', 'Linear API'.

jira-expert

33
from theneoai/awesome-skills

Jira expert: workflow configuration, sprint management, JQL advanced queries, dashboards, automation, and permissions. Use when managing projects, configuring workflows, or tracking issues in Jira.

confluence-expert

33
from theneoai/awesome-skills

Confluence expert: page templates, space configuration, Jira integration, macros, knowledge base architecture. Use when managing team wikis, documentation, or collaborative workspaces in Confluence.