Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Cheatsheet - MLOps

MLOps Fundamentals

ML Product ArchetypeDefinitionExampleKey Question
Software 2.0Take something traditional SW is good at and make it better with MLCode completion, recommendationsDoes ML truly improve performance/business value?
Human in the LoopHelp humans do their job better by complementing them with ML based toolsEmail autocomplete, Turn sketches into slidesHow good must the system be to be useful?
Autonomous SystemsTake something humans do today and automate it with MLSelf-driving, customer supportWhat’s acceptable failure rate?

ML Research vs Production

AspectResearchProduction
GoalPublish novel resultsBuild reliable, scalable systems
DataClean, curatedMessy, real-world
EvaluationAccuracy on test setPerformance, latency, robustness
IterationExperimentalIncremental, controlled
FocusModel innovationSystem reliability

Also important for Production but not so much for Research: Fairness & Interpretability.

MLOps Components

Business ObjectivesData EngineeringModel Training & EvaluationModel TestingDeploymentMonitoring → (Feedback Loop)

Data Flywheel

More dataBetter modelMore usersMore data → ...

Deep Learning Fundamentals

Neural Network Architectures

ArchitectureKey IdeaUse CaseExample
CNNConvolution + PoolingImage classificationResNet, VGG, AlexNet
TransformerSelf-attentionSequential dataBERT, ViT
RNN/LSTMRecurrent connectionsTime series, text-

Training Process

  1. Define: Input size, layers, activations (ReLU, Softmax), output, loss, optimizer, metrics

  2. Train: Adjust weights via backpropagation to minimize loss

  3. Evaluate: Check metrics on validation set

Data Engineering

Data Storage TypeDescriptionUse CasesExamples
FilesystemLocal disk storageDev, small datasetsCSV, JSON, Parquet
Object StorageDistributed, scalableLarge datasetsS3, GCS, Azure Blob
DatabasesStructured, queryableTransactional dataPostgreSQL, MySQL
Data LakesRaw data repositoriesBig data, analyticsDelta Lake, Iceberg
Data WarehousesAnalytics-optimizedBIBigQuery, Snowflake

Deployment

Prediction PatternDescriptionLatencyUse Cases
BatchProcess multiple inputs at onceHours-daysOffline, large datasets
OnlineProcess one input at a timems-secondsReal-time apps
StreamingContinuous data processingSecondsReal-time analytics
Model Serving ApproachProsCons
Model-in-ServiceReuse infrastructureDifferent languages, resource conflicts
Model-as-ServiceDependability, scalabilityAdded latency, complexity
Batch PredictionSimple, low latencyStale predictions, limited inputs
Deployment OptionProsCons
Cloud (Managed)Fully managed, scalableVendor lock-in, cost
Cloud (Self-managed)Full control, portableMore work
On-PremisesControl, privacyHigh cost, maintenance
EdgeLow latency, offlineLimited resources
ServerlessAuto-scaling, pay-per-useCold starts

Model Compression

Serving Frameworks

TorchServe (PyTorch), TensorFlow Serving, Ray Serve, vLLM (LLMs), MLServer (framework-agnostic)

Monitoring & Continual Learning

ML models degrade over time → Monitoring is essential

Types of Distribution Shifts

TypeDefinitionExample
Covariate ShiftP(X)P(X) changes, P(YX)P(Y | X) changesDifferent car mileage distribution
Label ShiftP(Y)P(Y) changes, P(XY)P(X | Y) changesMore expensive cars in dataset
Concept DriftP(YX)P(Y | X) changesMileage → price relationship changes

ML Product Management & Teams

ML RoleResponsibilities
Data EngineerData pipelines, ETL, infrastructure
ML EngineerModel development, deployment, MLOps
ML Product ManagerBusiness alignment, prioritization
MLOps EngineerCI/CD, monitoring, infrastructure
AI/LLM EngineerLLM-specific development
Organizational ModelDescriptionProsCons
CentralizedOne ML teamEfficiency, expertiseBottleneck
DecentralizedML in each teamAlignment, speedDuplication
HybridCentral platform + embeddedBalanceComplexity

ML Maturity Levels

  1. Nascent: Exploring ML, no production

  2. Emerging: First ML systems in production

  3. Maturing: Multiple ML systems, standardized

  4. ML-First: ML is core to business

Business Alignment