← Back to all products

MLflow Starter Kit

$39

MLflow experiment tracking setup, model registry patterns, and deployment configs for going from notebooks to production.

📁 18 files🏷 v1.0.0
JSONMarkdownYAMLPythonDockerKubernetesAWSPostgreSQLMLflow

📄 Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample

📁 File Structure 18 files

mlflow-starter-kit/ ├── .gitignore ├── LICENSE ├── README.md ├── docker/ │ └── docker-compose.yml ├── examples/ │ ├── promote_model_example.py │ └── train_sklearn_example.py ├── guides/ │ ├── mlflow-setup-guide.md │ └── model-registry-workflow.md ├── src/ │ └── mlflow_starter/ │ ├── __init__.py │ ├── autolog.py │ ├── config.py │ ├── deployment.py │ ├── registry.py │ └── tracking.py └── tests/ ├── conftest.py ├── test_registry.py └── test_tracking.py

📖 Documentation Preview README excerpt

MLflow Starter Kit

A typed, production-minded layer over [MLflow](https://mlflow.org) that takes you

from ad-hoc notebook experiments to a structured, reproducible MLOps workflow:

experiment tracking, a model registry promotion lifecycle, autologging

for scikit-learn / XGBoost, deployment config generation for batch and

real-time serving, and a one-command Docker stack (MLflow + Postgres + MinIO).

The Python package (mlflow_starter) is a thin, well-documented wrapper -- you

can always drop down to the raw mlflow.* API. Everything ships with docstrings,

type hints, runnable examples, and a real pytest suite.

Features

  • Typed configuration (MLflowConfig) -- load from env vars, a mapping, or a

JSON/YAML file; validate it; export it to the environment in one call.

  • Experiment tracking helpers -- one experiment_run context manager that

sets the server, experiment, and default tags; helpers that flatten nested

hyper-parameters, log metric series (training curves), JSON config blobs, and

text artifacts without temp-file juggling.

  • Model registry facade (ModelRegistry) -- register_from_run, stage

transitions (Staging / Production / Archived) with automatic archiving,

load-by-stage, latest-version lookups, and MLflow 2.9+ aliases.

  • Autologging wrappers -- project-sane AutologOptions defaults plus

per-framework wrappers for scikit-learn and XGBoost, and an autolog_run

context manager.

  • Deployment generators -- build mlflow models serve / build-docker

commands, Docker Compose services, a Kubernetes CronJob, and a complete

standalone batch-scoring script -- all as plain text/dicts you can commit.

  • Self-hosted stack -- docker/docker-compose.yml runs a real MLflow server

backed by PostgreSQL (metadata) and MinIO (S3-compatible artifacts).

Requirements

  • Python 3.9+ (the package itself uses only the standard library)
  • For running models: pip install mlflow (2.x); examples also use

scikit-learn

  • Docker + Docker Compose (optional, for the bundled tracking stack)

Quick Start

1. Start a tracking server (optional but recommended)


docker compose -f docker/docker-compose.yml up -d
# MLflow UI    -> http://localhost:5000
# MinIO console-> http://localhost:9001  (minioadmin / minioadmin)

No server? The examples automatically fall back to a local ./mlruns file store.

2. Point your code at it and log a run


from mlflow_starter import MLflowConfig, configure, experiment_run, log_params, log_metrics

configure(MLflowConfig.from_env())          # reads MLFLOW_TRACKING_URI, tags, ...

with experiment_run("baseline", tags={"owner": "ml-team"}) as run:
    log_params({"model": {"max_depth": 6, "n_estimators": 300}})   # auto-flattened

*... continues with setup instructions, usage examples, and more.*

📄 Code Sample .py preview

src/mlflow_starter/config.py""" Typed configuration for the MLflow Starter Kit. MLflow is configured almost entirely through environment variables (``MLFLOW_TRACKING_URI``, ``MLFLOW_S3_ENDPOINT_URL``, the AWS credential variables, ...). That works, but it scatters configuration across shell profiles, CI secrets, and Dockerfiles where it is hard to validate and easy to get subtly wrong. This module centralises everything into a single typed :class:`MLflowConfig` dataclass. You build the config once -- from environment variables, a mapping, or a JSON/YAML file -- validate it, then call :meth:`MLflowConfig.apply` to push the values into ``os.environ`` so that ``import mlflow`` and the bundled ``docker-compose.yml`` stack all see a consistent view of the world. The module depends only on the Python standard library. YAML files are supported when PyYAML happens to be installed, but it is never required. """ from __future__ import annotations import json import os from dataclasses import dataclass, field, fields from pathlib import Path from typing import Any, Mapping, Optional # Default local tracking URI. ``http://localhost:5000`` matches the MLflow # server started by the bundled docker/docker-compose.yml stack. Use a # ``file:`` URI (e.g. ``file:./mlruns``) for quick, server-less experiments. DEFAULT_TRACKING_URI = "http://localhost:5000" # Valid MLflow model-registry stages. Kept here so every module agrees on the # canonical spelling (MLflow is case-sensitive about these). REGISTRY_STAGES = ("None", "Staging", "Production", "Archived") @dataclass class MLflowConfig: """Strongly-typed MLflow connection and experiment configuration.
Buy Now — $39 Back to Products