MLCrack

    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:

    1. 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'.

    1. A/B testing deployment: route percentage of traffic to new version, measure key metrics (quality, latency, cost).

    Use statistical significance before full rollout.

    1. Canary deployment: start with 1-5% traffic, gradually increase if metrics are healthy.

    2. Blue/green deployment: maintain two environments, switch traffic instantly with rollback capability.

    3. Prompt versioning: version control prompts alongside model versions (prompts may need updating with model changes).

    4. Shadow mode: run new model in parallel, compare outputs without serving to users.

    5. 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.