Sub topic 3
Hosting models, cost, and data governance
This chapter assumes you can run a Python training script, that you know what a run and a metric are, and that you understand how a client talks to a server over a REST API.
Where the tracker runs decides who controls your data, what you pay, and how much operational work your team takes on. Three hosting models are common:
| Hosting model | Who operates the server | Metrics and artifacts leave your network | Main cost driver |
|---|---|---|---|
| Self-hosted (for example, MLflow with PostgreSQL and S3-compatible storage) | Your team | No | Infrastructure and staff time |
| Vendor SaaS (for example, Weights & Biases cloud) | The vendor | Yes, unless you negotiate otherwise | Per-seat licences and storage |
| Dedicated private instance in your cloud account | The vendor, inside your account | Stays in your cloud account | Licence plus your cloud bill |
Estimate cost for a full year. Include seats, artifact storage (checkpoints and dataset snapshots grow quickly), and the hours needed to patch and back up a self-hosted server.
Before a pilot, answer these governance questions:
- Where are logs and artifacts stored, and in which region?
- Who can read a run, and who can delete one?
- Do parameters or artifacts ever contain personal data or customer identifiers?
- How long are runs retained, and how is a run deleted on request?
Limiting lock-in with a thin tracking interface
Training code should depend on a small interface you own, not on a vendor's API. Switching tools then means writing one new adapter.
from typing import Mapping, Protocol
class Tracker(Protocol):
def log_params(self, params: Mapping[str, object]) -> None: ...
def log_metric(self, name: str, value: float, step: int) -> None: ...
def finish(self) -> None: ...
class MlflowTracker:
def __init__(self):
import mlflow
self._mlflow = mlflow
mlflow.start_run()
def log_params(self, params):
self._mlflow.log_params(dict(params))
def log_metric(self, name, value, step):
self._mlflow.log_metric(name, value, step=step)
def finish(self):
self._mlflow.end_run()Keep the interface to the calls you actually use. A wide interface copies the vendor's API and gives you no real protection.
Criteria for comparing trackers
Score each candidate on the same criteria before you look at demos:
- Hosting and data residency meet your policy.
- Total yearly cost, including storage and operations, fits the budget.
- Run comparison and sharing work for your team's workflow.
- Artifact and model registry features cover your deployment path.
- Your frameworks are supported, with autologging where you need it.
- Exporting your data is possible without vendor help.
Running a trial and recording the decision
Time-box the trial to two weeks. Log the same training run with each candidate using your thin interface, then check that parameters, metrics, and artifacts appear correctly and that you can export them.
Record the decision in a short file in the repository. Include the criteria scores, the trial results, the yearly cost estimate, and the reason for the choice.
Exercise
Your team must keep all metrics inside your own cloud account, and the budget does not allow a dedicated server team. Which hosting model fits, and why?
Show answer
A dedicated private instance in your cloud account fits. The vendor operates the service, so no in-house server team is needed, and the data stays inside your account. A fully self-hosted server would need staff the budget does not cover, and a vendor SaaS would send data outside your network.