ML SYSTEM DESIGN & MLOPS ยท INTERVIEW QUESTION
How do you handle versioning of LLMs in production?
๐ก intermediate ยท ML Pipelines
Hint: Think about model registry, traffic splitting, and rollback strategies.
Answer
LLM versioning strategy:
- Model registry: store all model versions with metadata (training data, hyperparams, eval metrics).
Tools: MLflow, Weights & Biases, HuggingFace Hub. Tag versions as 'staging', 'production', 'archived'.
- A/B testing deployment: route percentage of traffic to new version, measure key metrics (quality, latency, cost).
Use statistical significance before full rollout.
-
Canary deployment: start with 1-5% traffic, gradually increase if metrics are healthy.
-
Blue/green deployment: maintain two environments, switch traffic instantly with rollback capability.
-
Prompt versioning: version control prompts alongside model versions (prompts may need updating with model changes).
-
Shadow mode: run new model in parallel, compare outputs without serving to users.
-
Rollback plan: always keep previous version deployable. Automated monitoring triggers rollback if quality drops.
Best practice: treat model + prompt + guardrails as a single deployable unit. Version them together.
Related questions
- What is LLMOps and how does it differ from traditional MLOps?
- What is a feature store? Why is it important for ML systems?
- Explain model parallelism vs data parallelism for training large models.
- Outline the data pipeline for training an LLM from raw text to training batches.
- Design a real-time ML serving system for a recommendation engine handling 10k QPS.