0
0
MLOpsdevops~10 mins

Model stages (staging, production, archived) in MLOps - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Model stages (staging, production, archived)
Model Created
Stage: Staging
Test & Validate
Promote
Stage: Production
Monitor & Use
Archive Old Models
Models start in staging for testing, then move to production if validated, and old models get archived.
Execution Sample
MLOps
model = create_model()
stage = 'staging'
if test_model(model):
  stage = 'production'
else:
  stage = 'staging'
This code creates a model, tests it, and sets its stage to production if tests pass, otherwise keeps it in staging.
Process Table
StepActionModel StageTest ResultNext Stage
1Create modelstagingN/Astaging
2Test modelstagingPassproduction
3Promote modelproductionN/Aproduction
4Monitor modelproductionN/Aproduction
5Archive old modelproductionN/Aarchived
💡 Model promoted to production after passing tests, then archived when replaced.
Status Tracker
VariableStartAfter Step 1After Step 2After Step 3After Step 5
stageNonestagingproductionproductionarchived
test_resultNoneNonePassNoneNone
Key Moments - 2 Insights
Why does the model stay in staging if tests fail?
Because the test result is 'No' (see concept_flow ASCII diagram), the model is not promoted and remains in staging for fixes.
What triggers moving a model to archived?
When a newer model replaces the production one, the old model stage changes to archived (see execution_table step 5).
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 2, what is the model stage after testing?
Aproduction
Bstaging
Carchived
Dtesting
💡 Hint
Check the 'Next Stage' column at step 2 in execution_table.
At which step does the model get archived?
AStep 3
BStep 4
CStep 5
DStep 2
💡 Hint
Look for 'archived' in the 'Next Stage' column in execution_table.
If the test_model function fails, what will be the model stage after step 2?
Aarchived
Bstaging
Cproduction
Ddeleted
💡 Hint
Refer to variable_tracker and execution_table step 2 for test results and stage changes.
Concept Snapshot
Model stages track lifecycle:
- Staging: model testing and validation
- Production: live use after passing tests
- Archived: old models replaced by newer ones
Models move forward only if tests pass.
Full Transcript
In MLOps, models go through stages to manage their lifecycle. First, a model is created and placed in the staging stage where it is tested. If the tests pass, the model is promoted to production, meaning it is ready for real use. If tests fail, the model stays in staging for fixes and retesting. When a newer model replaces an old one, the old model is moved to the archived stage to keep history and avoid confusion. This flow ensures only good models serve users and old versions are safely stored.