Prompt
How do I set up a model metadata store for tracking runs, artifacts, and promotion history across teams?
Latest observation
A good model metadata store should act like a system of record for the model lifecycle: training runs, artifacts, evaluations, approvals, and promotions across environments/teams.
1) Define the core entities
At minimum, model metadata usually centers on these objects:
- Model: the logical model name or family
- Model version / artifact: a specific trained package, file, or container
- Run: a training or evaluation execution
- Dataset / data snapshot: what data the run used
- Metrics / evaluation results: accuracy, AUC, latency, fairness, etc.
- Experiment / job: a grouping of runs
- Environment: dev / staging / prod
- Deployment / promotion event: when a version moved between environments
- Approval / governance record: who approved and why
- Lineage / dependencies: code version, feature set, data sources
- Ownership / team / project: accountability and access boundaries
2) Use a hybrid metadata architecture
Most teams use:
- Object store for large artifacts
Examples: S3, GCS, Azure Blob, MinIO - Relational database for structured metadata
Examples: Postgres, MySQL - Optional event log / message bus for async updates
Examples: Kafka, Pub/Sub, SQS
Typical split:
- Store model binaries, ONNX files, Docker images, reports in object storage
- Store references, hashes, tags, metrics, statuses, and promotion history in the DB
3) Design the data model
A practical relational schema might look like this:
teams
team_idnameownercost_center
models
model_idnamedescriptionteam_idcreated_at
model_versions
version_idmodel_idversion_nameorsemverartifact_uriartifact_hashframeworkcreated_atcreated_bygit_commitstatus(registered,candidate,approved,deprecated)
runs
run_idmodel_idversion_idnullable until registeredexperiment_namestatusstarted_atended_attriggered_bycompute_envcode_version
run_inputs
run_iddataset_uridataset_versionfeature_store_snapshotdata_hash
run_metrics
run_idmetric_namemetric_valuemetric_typethresholdpassed
artifacts
artifact_idrun_idversion_idtype(model,plot,confusion_matrix,log,profile)urihashsize_bytes
environments
environment_idname(dev,staging,prod)team_scope
promotions
promotion_idversion_idfrom_environment_idto_environment_idstatusrequested_byapproved_byapproved_atreasonpolicy_result
audit_events
event_identity_typeentity_idactionactortimestampdetails_json
This gives you:
- run tracking
- artifact lineage
- environment promotion history
- auditability across teams
4) Capture lineage and immutability
For trustworthy metadata:
- Make artifacts immutable once registered
- Store content hashes for artifacts and datasets
- Record git commit hash, branch, and build ID
- Track exact dataset versions and feature snapshots
- Record who approved each promotion and what policy was evaluated
This is what lets you answer:
- “What exact data trained prod model X?”
- “Which code commit produced this artifact?”
- “Who promoted it and when?”
- “Was it approved by policy or manually overridden?”
5) Support multi-team access and governance
Across teams, you need:
- RBAC/ABAC
- Team members can see their models
- Platform/admins can see everything
- Only approvers can promote to prod
- Namespace or tenancy model
team_idon every major object- Optional project/org hierarchy
- Audit logs
- All reads/writes for sensitive actions
- Policy checks
- Block promotion if metrics regress, bias thresholds fail, or artifacts are unsigned
- Tags/labels
owner,business_unit,pii_sensitive,critical_system
6) Decide how metadata gets written
Good patterns:
Option A: Model registry API
Each training pipeline calls an internal service:
POST /runsPOST /artifactsPOST /metricsPOST /promotions
Best for centralized control and consistency.
Option B: SDK
Provide a Python/Java SDK so training jobs can log metadata easily:
log_run()log_metric()log_artifact()register_model_version()promote_version()
Best for developer adoption.
Option C: Event-driven
Training jobs emit events; a metadata service consumes them. Best for scale and decoupling, but more complex.
7) Include promotion workflow states
A robust promotion lifecycle often looks like:
trainedvalidatedcandidateapproveddeployedrolled_backordeprecated
Each state transition should be recorded in promotions or an events table.
You may also want:
- manual approvals
- automated gates
- canary status
- rollback history
8) Add search and discovery
Teams need to find models quickly. Index:
- model name
- tags
- owner/team
- metric values
- environment
- creation date
- framework
- status
If your relational DB search is limited, mirror metadata into:
- Elasticsearch / OpenSearch
- or use Postgres full-text search
9) Build for scale and reliability
Practical implementation tips:
- Use Postgres first unless scale demands otherwise
- Partition large tables like
audit_eventsandrun_metrics - Add indexes on:
model_idversion_idteam_idcreated_atstatus
- Keep artifact blobs out of the DB
- Use idempotent writes for pipeline retries
- Version your schema and APIs
10) Example end-to-end flow
- Data scientist starts training job
- Job creates a
run - Job logs input dataset snapshot, code commit, and metrics
- Job uploads model artifact to object storage
- Metadata service registers a
model_version - Evaluation pipeline validates metrics and policy checks
- If approved, create a
promotionrecord from dev to staging/prod - Deployment system reads the metadata store to fetch the correct artifact
- Audit events capture every transition
11) If you want to start simple
A minimal but solid v1:
- Postgres metadata DB
- S3/GCS artifact storage
- SDK to log runs/metrics/artifacts
- Basic RBAC by team
- Promotion table with approval history
- Audit log table
- Dashboard/search UI
12) Useful existing tools
If you don’t want to build everything:
- MLflow Model Registry
- Weights & Biases
- SageMaker Model Registry
- Vertex AI Model Registry
- Kubeflow Metadata
- OpenLineage / Marquez for lineage
These can be integrated with your own governance layer if needed.
If you want, I can also provide:
- a sample Postgres schema,
- a REST API design, or
- a reference architecture diagram for this metadata store.
Observation history
Unlock observation history
Create a free Obsurfable account to unlock historical responses, model comparisons, and deeper brand intelligence.
How did Obsurfable measure this prompt?
Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.
Which AI systems does Obsurfable collect answers from?
OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, and Meta AI.