01-experiment-tracking produces many runs, each with its own metrics, but a run isn't automatically "the model in production." A model registry is the missing piece between experimentation and deployment: a named, versioned record that tracks WHICH run became WHICH numbered version of a model, and WHICH version (if any) is currently promoted to serve real traffic.
Implement create_registry, register_model_version (linking a run to a new, sequentially-numbered model version), promote_to_stage (moving a version between lifecycle stages), and get_version_at_stage.
register_model_version(registry, model_name, run_id, metrics) assigns sequential version numbers PER model name, starting at 1; new versions start in stage "none".promote_to_stage(registry, model_name, version, stage) raises ValueError for an unrecognized stage."production" must automatically move whatever OTHER version was previously "production" to "archived": at most one version can be "production" at a time.get_version_at_stage(registry, model_name, stage) returns the matching version dict, or None if none match.Open one at a time. Each gives away a little more than the last.
Version numbers are len(existing_versions) + 1: a simple, deterministic counter scoped to each model name independently, so two different models both start numbering from 1.
promote_to_stage's "at most one production version" rule needs a loop over ALL of a model's versions: set the TARGET version to the new stage, and separately check every OTHER version: if it's currently "production" and the new stage being applied is "production", demote it to "archived".
No results yet
Run your code to check it against the examples, or submit to run every test.