# What is MLOps?

_MLOps (Machine Learning Operations) is the set of practices that combines ML, DevOps, and data engineering to deploy and maintain ML models in production reliably and efficiently._

MLOps (Machine Learning Operations) is the set of practices that combines ML, DevOps, and data engineering to deploy and maintain ML models in production reliably and efficiently. It operationalizes the [ML model lifecycle](/ml-model-lifecycle) for production systems.

Why it matters: Most ML projects never make it to production. Research shows 80%+ of ML initiatives stall before deployment. The gap isn't modeling capability—it's the operational infrastructure to move models from notebooks to production and keep them working over time.

## The MLOps Gap

Data science teams build models that work in controlled environments—clean data, Jupyter notebooks, offline evaluation. But production is different:

- **Data changes**: Real-world data drifts from training distributions
- **Scale demands**: Models must handle production traffic, latency requirements
- **Reliability needs**: Downtime and failures have business impact
- **Maintenance burden**: Models decay and need retraining, updates, and fixes
- **Governance requirements**: Audit trails, explainability, compliance documentation

Without MLOps practices, organizations end up with:
- Models that can't be reproduced or deployed
- Manual handoffs between data science and engineering
- No visibility into production model behavior
- Slow, error-prone deployment processes
- Models that [degrade](/model-degradation) silently until failures become visible

## MLOps vs. DevOps

MLOps extends DevOps principles but addresses ML-specific challenges:

| DevOps | MLOps |
|--------|-------|
| Code versioning | Code + data + model versioning |
| Unit/integration tests | Model validation + data tests |
| CI/CD for code | CI/CD for models + data pipelines |
| Application monitoring | Model monitoring + data drift detection |
| Deterministic behavior | Probabilistic behavior, distribution shifts |

Key additions MLOps brings:
- **Data versioning and lineage**: Track what data trained which model
- **Experiment tracking**: Log parameters, metrics, and artifacts across runs
- **Feature stores**: Consistent feature engineering across training and serving
- **Model registry**: Catalog, version, and stage models for deployment
- **Model validation**: [Testing](/ml-model-testing) that goes beyond unit tests
- **Production monitoring**: [Drift detection](/ai-model-drift), performance tracking, anomaly alerting

## The MLOps Lifecycle

### 1. Problem Definition
Define business objectives, success metrics, and constraints before building models.

### 2. Data Engineering
Build pipelines to collect, clean, transform, and version data. Implement data quality checks. Create feature engineering processes.

### 3. Model Development
Experiment with algorithms, architectures, and hyperparameters. Track experiments systematically. Validate models against holdout data and business requirements.

### 4. Model Validation
Go beyond accuracy metrics:
- [Fairness and bias](/ai-bias-fairness) testing
- Robustness and adversarial testing
- Performance on edge cases and slices
- Compliance with business rules

### 5. Deployment
Automate model packaging and deployment. Implement staging environments and canary releases. Enable rollback capabilities.

### 6. Monitoring
Track production performance:
- Input data drift
- Prediction drift
- Model accuracy (when ground truth available)
- Latency and throughput
- Resource utilization

### 7. Feedback and Retraining
Collect production data for model improvement. Implement retraining pipelines. Close the loop between production insights and model updates.

## MLOps Maturity Levels

### Level 0: Manual
- Models developed in notebooks
- Manual deployment and handoffs
- No monitoring or automation
- Ad hoc retraining

### Level 1: ML Pipeline Automation
- Automated training pipelines
- Experiment tracking
- Model registry
- Basic monitoring

### Level 2: CI/CD for ML
- Automated testing for models and data
- Continuous integration for ML pipelines
- Automated deployment with staging
- Model validation gates

### Level 3: Full Automation
- Automated retraining triggers
- Continuous monitoring with alerting
- Automated rollback and recovery
- Self-healing systems

## LLMOps: MLOps for Large Language Models

LLMs require adapted MLOps practices:

### Differences from Traditional ML
- **No training from scratch**: Most organizations use pre-trained models with fine-tuning or prompting
- **Prompt engineering**: System prompts become the primary "model development"
- **Evaluation challenges**: Output quality is harder to measure than classification accuracy
- **New failure modes**: [Hallucinations](/ai-hallucinations), [prompt injection](/ai-prompt-injection), safety violations

### LLMOps Practices
- **Prompt versioning**: Track and version system prompts like code
- **Evaluation pipelines**: Systematic testing for accuracy, safety, and quality
- **Guardrail management**: Configure and monitor [safety boundaries](/ai-guardrails)
- **Cost monitoring**: Track token usage and inference costs using [model monitoring tools](/model-monitoring-tools)
- **[Observability](/ai-observability)**: Log prompts, responses, and metadata for debugging

## How Swept AI Supports MLOps

Swept AI provides the [monitoring](/ai-monitoring) and [supervision](/ai-supervision) layer for production AI:

- **[Supervise](/product/supervise)**: Real-time monitoring for drift, quality, safety, and performance. Detect issues before they impact users. Enforce policies that keep models operating within bounds.

- **[Evaluate](/product/evaluate)**: Pre-deployment validation that tests models under realistic conditions. Understand behavior distributions, not just average performance.

- **[Certify](/product/certify)**: Documentation and evidence generation for audit trails, compliance requirements, and governance workflows.

MLOps is what separates organizations that demo ML from those that deploy it reliably at scale.