Saltar al contenido

Lección 1 · Getting Started

What Is MLflow?

Learn what MLflow is, which problems it solves for machine learning and LLM projects, what you need to know first, and how this tutorial is organized.

When you build a model, you try many things. You change a setting, train again, and get a new score. A week later you cannot remember which settings produced your best result, or which file holds that model. MLflow is an open source platform that records this work, so you can find it, compare it and ship it.

It started as a tool for classic machine learning. Current versions also cover applications built on large language models (LLMs), with tracing, evaluation and prompt versioning. This tutorial teaches both sides.

The problems MLflow solves

  • Lost results. Experiment tracking stores the settings, scores and output files of every training run.
  • Unclear model files. A standard model format describes how to load a model and what input it expects.
  • Confusing releases. A model registry gives each model a name and numbered versions, and lets you mark which one is in use.
  • Guesswork about quality. Evaluation tools score a model or an LLM app against the same data every time.
  • Invisible LLM behavior. Tracing shows each step an application takes to answer a request.

The main parts of MLflow

Tracking Record runs
Models A standard format
Registry Named versions
1 / 3

Who this tutorial is for

It is for data scientists, machine learning engineers, developers of LLM applications, and students. You should be comfortable with basic Python: functions, dictionaries, loops and installing packages. Some knowledge of machine learning helps, for example knowing what training data and accuracy are. For the LLM chapters, it helps to know what a prompt is; see prompt engineering and large language models.

What this tutorial can and cannot run

The code runner on this site cannot run MLflow. It has no MLflow package, no tracking server and no hosted models.

You will see two kinds of code:

  1. Real MLflow code in read-only blocks. Copy it to your own computer to run it.
  2. Runnable blocks titled "Stand-in:". These are small programs in plain Python or SQL that imitate one idea, such as how a run stores parameters. They are written for this tutorial. Their output is not MLflow output, and their names are not MLflow's API.

A stand-in helps you understand the logic. To learn the real behavior, such as what the web interface shows, run the real code yourself. MLflow changes often. Product details here were checked against the official documentation as of December 2026. If your version behaves differently, trust the official docs for your version.

This tutorial is independent. It is not written, approved or sponsored by the MLflow project or by any company that offers MLflow services.

A first taste

Here is real MLflow code. It records one training attempt with a setting and a score.

Python
import mlflow

mlflow.set_experiment("house-prices")

with mlflow.start_run(run_name="first-try"):
    mlflow.log_param("max_depth", 4)
    mlflow.log_metric("rmse", 31.2)  # a made-up score

The stand-in below shows the same habit with ordinary Python objects.

Python Stand-in: a notebook that remembers every attempt

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The error values are invented. The point is the habit: every attempt is written down when it happens, not reconstructed later from memory.

What MLflow is not

MLflow does not train models for you. You keep using your own libraries, such as scikit-learn, PyTorch or an LLM provider's SDK. It also does not replace version control, so keep your code in Git. And it does not guarantee quality. A carefully tracked bad experiment is still a bad experiment, so you still need good data splits and honest evaluation.

You can use MLflow on your laptop, run your own shared server, or use a managed service from a vendor. The core concepts stay the same, while setup, login and extra features differ between providers.

A short story: before and after

Imagine two teammates who build a model that predicts late deliveries. Before tracking, Priya keeps results in a spreadsheet. Some rows say "new features", others say "try 2". The model file is on her laptop. When Omar asks which version is in the live system, nobody is sure.

With a tracking habit, each training run records its settings, scores and files automatically or with a few lines of code. The model that goes live is a numbered version in a registry, linked back to the run that produced it. When a score drops a month later, Omar opens that run and sees the data version and parameters. He still has to investigate the cause, but he starts from facts instead of memory. This story is invented, yet the problem is very common.

Two vocabularies, one platform

People who come to MLflow from classic machine learning and people who come from LLM work often use different words for similar ideas:

Idea Classic ML LLM apps
What you change Hyperparameters, features Prompts, models, retrieval settings
What you record Runs and metrics Runs, traces and feedback
How you judge Metrics on a test set Scorers and judges on test cases
What you release A model version A prompt version and app version

You do not need to learn both sides at once. If you only train classic models, you can read the first six chapters and skim the tracing lessons. If you only build LLM apps, start with the first two chapters, then jump to evaluation and tracing, and come back to the registry later.

How to study

Type the real code yourself on your computer. Then run the stand-ins here and change them: add a run, break a rule, or edit a number. Predict what will happen before you press Run. That small habit teaches far more than reading alone.

Check your understanding

Quick check · 3 questions

of 3 answered You scored / 3 · perfect!

  1. 1. What is the main job of experiment tracking?

    Tracking keeps a record of every attempt so that you can find and compare results.
  2. 2. What does a block titled 'Stand-in:' show in this tutorial?

    The site cannot run MLflow, so stand-ins are plain programs that illustrate one concept.
  3. 3. Which task is outside the job of MLflow?

    Good experiment design remains your responsibility; MLflow records what you do.

Summary

  • MLflow is an open source platform for tracking, packaging, registering and evaluating models and LLM apps.
  • It works with your existing libraries instead of replacing them.
  • This site cannot run MLflow: real code is read-only and runnable blocks are labeled stand-ins.
  • The tutorial is independent, and product details reflect December 2026.

Next: Install MLflow and Log Your First Run

Tu progreso se guarda en este navegador. No necesitas una cuenta.