5.3.3 · HinglishMLOps & Deployment

Model versioning and registries

1,922 words9 min readRead in English

5.3.3 · AI-ML › MLOps & Deployment


YEH exist KYUN karta hai?


KYA version kiya ja raha hai?

Mental model:

registry["fraud-detector"] = [v1, v2, v3, ...]
   v3.stage = "Production"
   v2.stage = "Archived"
   alias "champion" -> v3   (pointer, cheap to move)
Figure — Model versioning and registries

Ek version KAISE identify hota hai? (Scratch se derive karein)

Hum ek model ke liye aisa identifier chahte hain ki: identical inputs → identical ID, aur koi bhi change → new ID. Yeh bilkul content hash ki property hai.

Yeh step kyun? Hum machine identity (hash, immutable, exact) ko human label (v3, Production, mutable, meaningful) se alag karte hain. Yahi split Git use karta hai: commit SHA (immutable) vs. branch name (mutable pointer).


Models ki Semantic versioning


Model lineage ("yahan tak kaise pahunche" ka graph)


Worked examples


Common mistakes (Steel-man + fix)


Active recall

Recall Khud test karein (jawaab dene ke baad reveal karein)
  • Woh kaunsi chaar cheezein hain jo model ko reproducible banane ke liye pin ki jaati hain?
  • Content hash filename se behtar identity kyun hai?
  • Registry mein rollback fast kyun hota hai? Asliyat mein kya move hota hai?
  • Metrics compare karna sirf same eval set par kyun valid hai?
  • Ek immutable version aur ek mutable stage mein kya fark hai?

Flashcards

Model registry kya hai?
Ek version-controlled store jo ek model name ko immutable versions ki ek ordered list se map karta hai, har ek ke saath metadata, metrics, artifacts, aur ek mutable stage label.
Kaunsa 4-tuple ek model ko reproducible banata hai?
(code hash, data hash, hyperparameters, random seed) — ek deterministic pipeline ke saath yeh byte-identical weights reproduce karte hain.
Plain Git models ko achhi tarah version kyun nahi kar sakta?
Weights bade binaries hote hain jinka meaningful diff nahi ho sakta, aur identical code stochastic training ki wajah se alag weights de sakta hai.
Content-addressable versioning kya hai?
Artifact bytes ka cryptographic hash uski ID ke roop mein use karna; identical bytes → same ID, koi bhi change → new ID.
Registry rollback near-instant kyun hai?
Purane versions immutable hain aur abhi bhi stored hain; rollback sirf ek alias/stage pointer flip karta hai artifacts ko move kiye bina.
Ek model ke liye MAJOR/MINOR/PATCH ka kya matlab hai?
MAJOR = breaking interface change; MINOR = same interface par retrain; PATCH = serving/wrapper fix, weights unchanged.
Metrics ko eval-data hash se kyun tie karna zaroori hai?
Ek metric versions ke beech tabhi comparable hai jab same frozen eval set par measure kiya gaya ho; warna yeh apples vs oranges hai.
Model lineage kya hai?
Ek backward-pointing DAG jo ek version ko uske data version, code commit, aur experiment run se reproduction/audit ke liye link karta hai.
Immutable version vs mutable stage — kya fark hai?
Version (weights+metadata) kabhi nahi badlata; stage/alias (Staging/Production/champion) ek movable pointer hai.
Recall Feynman: ek 12-saal ke bachche ko explain karein

Socho tum bahut saare cookies (models) bake karte ho. Har cookie ko ek numbered box milta hai jise tum kabhi dobara nahi kholte ya badlate (immutable version). Box par tum recipe, exact ingredients, aur oven settings likhte ho (code, data, seed) taaki aap exactly same cookie dobara bake kar sako. Tum sabhi boxes ki ek badi shelf (registry) rakhte ho. Ek sticky note jis par likha hai "YEH SERVE KARO" (Production alias) abhi ke best box par lagi hai. Agar serve ki gayi cookie kharab nikle, toh tum bas sticky note ko kal wale box par wapas chipka dete ho — dobara bake nahi karna. Yahi rollback hai.


Connections

  • Experiment tracking and metadata logging — jahaan metrics/lineage originate hoti hain.
  • Data versioning (DVC) — 4-tuple mein data_hash supply karta hai.
  • CI-CD for machine learning — automated promotion/rollback triggers.
  • Model serving and deployment patterns — stage labels ka canary/shadow use.
  • Reproducibility and random seeds — woh determinism jis par 4-tuple rely karta hai.
  • Model monitoring and drift detection — signals jo rollback trigger karte hain.

Concept Map

not enough

motivates

stores

reproduced by

if deterministic

identified by

immutable ID

maps name to

carries mutable

enables

human label

Model = code + data + params + weights + env

Plain Git fails on binaries

Model Registry

Model Artifact

4-tuple: code, data, params, seed

Byte-identical weights

Content Hash SHA-256

Machine Identity

Ordered immutable versions

Stage: Staging/Production/Archived

Fast Rollback

SemVer / vN counter