Areas we serve

Self-Hosted MLflow: Keep Training Runs, Prompts, and Traces on Your Server

Someone changed the system prompt on Thursday. Friday’s answers got worse, and the only record is a Slack thread that says “try this instead.” That is how small AI projects lose the plot. The model did not forget. You did, because the prompt, the test set, and the trace never lived anywhere but a laptop.

MLflow (mlflow/mlflow) is the Apache-2.0 project that started as experiment tracking for classic machine learning and now also covers LLM apps and agents. About 29,000 GitHub stars, docs at mlflow.org. You log parameters, metrics, and artifacts. You register a model version. For newer work you trace a call, score it, version the prompt, and optionally send traffic through an AI Gateway so keys and rate limits are not scattered through twelve repos. We already wrote about Langfuse as a tracing and eval tool built for LLM apps. MLflow is the wider shelf: training runs and a model registry on one side, traces and prompts on the other, one server if you want both.

What teams actually use it for

The old job is still the common one. A data scientist runs twenty training jobs, changes a learning rate, and needs to know which run produced the file that is in production. MLflow’s tracking server stores that. The model registry is the “this version is staging, that version is production” list, so deploy does not mean copying a pickle out of someone’s home directory.

The newer job is the one product teams hit first. Autolog a client, point mlflow.set_tracking_uri at your server, and each call shows up as a trace: prompt, response, token counts, latency. You can run evals against a dataset you keep, and you can keep prompt versions next to the code that used them. The AI Gateway is an OpenAI-shaped front door if you want one place for provider keys, fallbacks, and who is allowed to call which model. You do not have to turn all of that on. A lot of shops run tracking and the registry and ignore the gateway until the API bill shows up in three different dashboards.

Why self-host the tracking server

Traces and eval sets are the sensitive part. They contain real customer questions, internal documents you pasted into a prompt, and sometimes the weights themselves in the artifact store. A managed MLflow (Databricks and the cloud ML platforms ship variants) is convenient. It is also another company holding that pile. Self-hosting means the tracking URI is a host you operate, in a region you can name.

The project is explicit that you can run the whole thing yourself: Docker, Kubernetes, or a single mlflow server. Since 3.7 the default backend for a new server is SQLite (sqlite:///mlflow.db) instead of the old ./mlruns folder. Existing file stores are still detected. SQLite is fine for one person. A team wants Postgres, and an artifact store that is not “whatever disk the container had this morning.” The official Compose bundle in the repo brings MLflow, PostgreSQL, and RustFS for objects. Helm is there when you already run Kubernetes.

Do not leave port 5000 open

A tracking server with no login is a browser onto your experiments. Prompts, datasets, and model files should not be world-readable because someone forwarded a port to debug a notebook. Put TLS in front, require authentication, and keep the artifact bucket private. Notebooks on laptops should talk to that server over a VPN or an internal network, not over a public IP with a guessable path.

uvx mlflow server or pip install mlflow then mlflow server --port 5000 is the honest local start. Treat it like a dev database. Production is the Compose or Helm layout, a backup of Postgres, and a backup of the artifact store you have restored once. Pin the MLflow version. The client and the server need to agree, and a casual upgrade has surprised people who logged runs from an older SDK.

Good fit / skip it

Good fit: teams training models and also shipping an LLM feature, anyone who needs a model registry that is not a shared drive, shops that want traces and prompt versions on infrastructure they control.

Skip it: you only need a chat UI (that is a different product), or a two-person team that will never look at the UI again after the first week. An unused tracking server is just another database full of customer text you now have to secure.

Bottom line

MLflow is the notebook-to-production log: runs, models, traces, prompts, and an optional gateway, Apache-licensed and happy on your own Postgres. Self-host it when the contents of those traces are the thing you cannot hand to someone else’s SaaS. Then actually lock the server. The log is only useful if it is yours, and only safe if it is not public.

Talk with Swift Host about a Canadian VPS for the tracking server and a disk that survives a container rebuild. The model files get big faster than the dashboard suggests.

Tags:
  • MLflow
  • MLOps
  • LLM
  • Observability
  • Self-Hosted

Need Help With Your Hosting?

Tell us about your application — we respond within 1 hour with honest recommendations.