← 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/autolog.py """ Framework autologging wrappers for scikit-learn and XGBoost. MLflow's ``autolog`` feature instruments a training library so that parameters, metrics, the trained model, and an input-example signature are captured automatically -- no manual ``log_param`` calls. The catch is that each flavor's ``autolog`` exposes a slightly different set of keyword arguments, and the safe defaults for a *production* project differ from the library defaults. This module gives you one :class:`AutologOptions` dataclass with project-sane defaults plus thin wrappers that translate it into the correct per-framework call. :func:`autolog_run` ties autologging together with an experiment/run so a single ``with`` block produces a fully tracked training run. """ from __future__ import annotations import logging from contextlib import contextmanager from dataclasses import dataclass, field from typing import Any, Iterator, Optional, Sequence import mlflow from .tracking import experiment_run logger = logging.getLogger("mlflow_starter.autolog") # Flavors this module knows how to drive. Each maps to an ``mlflow.<name>`` # submodule that exposes an ``autolog`` function. SUPPORTED_FRAMEWORKS = ("sklearn", "xgboost") @dataclass class AutologOptions: """Project-sane autologging defaults, shared across frameworks. The library defaults disable input-example logging (so no signature is inferred) and silently log a lot of nested runs during hyper-parameter search. These defaults flip that around: capture a signature, keep output quiet, and cap the number of child runs created during tuning. Attributes: log_models: Log the fitted model as an artifact. log_input_examples: Log a sample of the training input (enables schema inference and a serving signature). log_model_signatures: Infer and store the model input/output signature. log_datasets: Log dataset metadata (shape, source) when available. silent: Suppress event/warning logs emitted during autologging. max_tuning_runs: Max child runs to create for tuning estimators # ... 122 more lines ...
Buy Now — $39 Back to Products