Skip to content

dmatrix/mlflow-genai-tutorials

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MLflow GenAI Tutorial Series

MLflow tutorial series

Python MLflow OpenAI LangChain LlamaIndex DeepEval UV RAGAS DSPy CrewAI GEPA License

Tutorial: Mastering GenAI with MLflow

This tutorial series teaches you, in a step-by-step manner, how to use MLflow's open source platform for building, tracking, tracing, prompt registry and optimization, evaluating, and debugging GenAI applications.

🎬 Series Overview Video

Mastering GenAI Development with MLflow

Watch the full overview: Mastering GenAI Development with MLflow

πŸ“š Tutorial Structure

Notebook Title Description Video Tutorial
1.1 Setup and Introduction
  • Understanding MLflow for GenAI
  • Installation and configuration
  • First tracked run
  • MLflow UI basics
Watch Tutorial
1.2 Experiment Tracking for LLMs
  • Tracking LLM parameters and metrics
  • Comparing model configurations
  • Cost tracking and optimization
  • Organizing experiments with tags
  • Parent-child runs for workflows
Watch Tutorial
1.3 Introduction to Tracing
  • Auto-tracing with MLflow
  • Understanding the trace model
  • Manual instrumentation
  • Viewing traces in UI
Watch Tutorial
1.4 Manual Tracing and Advanced Observability
  • Custom span decorators
  • Tracing complex workflows
  • Debugging with traces
  • Multi-step agentic patterns
Watch Tutorial
1.5 Prompt Management
  • Creating prompt templates
  • Versioning prompts
  • Registering in the Prompt Registry
  • Searching Prompt Registry
  • Using prompts from the Prompt Registry
  • Linking prompts to experiments
Watch Tutorial
1.6 Framework Integrations
  • OpenAI direct API integration
  • LangChain chains and workflows
  • LlamaIndex document indexing and RAG
  • Framework comparison matrix
  • Best practices for each framework
Watch Tutorial
1.7 Evaluating Agents
  • LLM-as-Judge evaluation patterns
  • MLflow built-in scorers (RelevanceToQuery, Correctness, Guidelines)
  • Custom scorers with @scorer decorator
  • DeepEval integration for conversations
  • Session-level multi-turn evaluation
Watch Tutorial
1.8 Prompt Optimization with GEPA
  • Automatic prompt optimization with GEPA algorithm
  • MLflow Prompt Registry integration
  • Before/after evaluation comparison
Watch tutorial
1.9 Complete RAG Application
  • Building a full RAG pipeline
  • End-to-end tracing
  • Performance analysis
  • RAG evaluation with RAGAS metrics
Coming Soon...
1.10 Multi-Agent Supervisor Pattern
  • Supervisor agent that routes queries to specialized subagents
  • Genie agent for structured data queries (SQL over pandas DataFrame)
  • Knowledge Assistant for document retrieval and policy Q&A
  • Full supervisor-subagent trace hierarchy with MLflow
  • 3-layer evaluation: routing accuracy, response quality, orchestration
Coming Soon...
1.11 LangGraph Deep Agents
  • Deep Agents with built-in planning (write_todos / read_todos)
  • File system context management (read, write, edit files)
  • Sub-agent delegation via task() tool
  • Evaluating Deep Agent outputs with mlflow.genai.evaluate()
  • Auto-tracing with mlflow.langchain.autolog()
Coming Soon...
1.12 CrewAI Multi-Agent Orchestration
  • Role-based agents with CrewAI (role, goal, backstory)
  • Custom tools: query_disaster_database and search_fema_policies
  • Hierarchical crew with manager agent delegating to specialists
  • Evaluating crew outputs with mlflow.genai.evaluate()
  • Auto-tracing with mlflow.crewai.autolog()
Coming Soon...

πŸŽ“ Learning Outcomes

After completing this tutorial, you will be able to:

Core Skills

  • βœ… Set up MLflow for GenAI development
  • βœ… Track LLM experiments systematically
  • βœ… Implement comprehensive tracing
  • βœ… Debug GenAI applications effectively
  • βœ… Manage prompts with version control
  • βœ… Build RAG systems

Advanced Capabilities

  • βœ… Cost tracking and optimization
  • βœ… Performance analysis and debugging
  • βœ… Multi-framework integration
  • βœ… Hierarchical trace creation
  • βœ… Custom span instrumentation
  • βœ… Agent workflow tracing

πŸš€ Getting Started

This project uses UV for dependency management.

  1. Install UV (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Install Dependencies
uv sync
  1. Configure API Keys Create a .env file in the tutorials directory:
OPENAI_API_KEY=your-api-key-here
MLFLOW_TRACKING_URI=http://localhost:5000
  1. Start Jupyter
uv run jupyter notebook
  1. Start MLflow UI (in a separate terminal)
uv run mlflow ui --port 5000
  1. Open Browser Navigate to http://localhost:5000

πŸ“‹ Prerequisites

  • Python 3.10+
  • UV package manager
  • OpenAI API key (or Databricks Workspace)
  • Basic understanding of Python and LLMs

🎯 Learning Objectives

By the end of all tutorials, you will:

  • βœ… Understand MLflow's core GenAI components
  • βœ… Track and trace LLM experiments systematically
  • βœ… Implement comprehensive tracing for observability
  • βœ… Debug GenAI applications using trace visualizations and MLflow Assistant
  • βœ… Manage prompts with version control and Prompt Registery
  • βœ… Evaluate an agent using MLflow predefined judges, custom and integrated judges from DeepEval and RAGAS
  • βœ… Build end-to-end RAG applications
  • βœ… Build and evaluate multi-agent orchestration systems

πŸ“‚ Directory Structure

mlflow-genai-tutorial-1/
β”œβ”€β”€ 01_setup_and_introduction.ipynb
β”œβ”€β”€ 02_experiment_tracking.ipynb
β”œβ”€β”€ 03_introduction_to_tracing.ipynb     
β”œβ”€β”€ 04_manual_tracing_advanced.ipynb     
β”œβ”€β”€ 05_prompt_management.ipynb           
β”œβ”€β”€ 06_framework_integrations.ipynb      
β”œβ”€β”€ 07_evaluating_agents.ipynb
β”œβ”€β”€ 08_prompt_optimization.ipynb
β”œβ”€β”€ 09_complete_rag_application.ipynb
β”œβ”€β”€ 10_multi_agent_supervisor.ipynb
β”œβ”€β”€ 11_deep_agents_langgraph.ipynb
β”œβ”€β”€ 12_crewai_multi_agent.ipynb
β”œβ”€β”€ .env                                 (create this yourself and use the template env_template)
└── README.md

πŸ”— Resources

πŸ’‘ Tips

  • Keep the MLflow UI open while working through notebooks
  • Experiment with different parameter values
  • Compare runs in the UI to understand trade-offs
  • Tag runs for easy organization
  • Track costs from the beginning

❓ Troubleshooting

Issue: MLflow UI won't start

# Try a different port
uv run mlflow ui --port 5001

Issue: API key not recognized

# Restart Jupyter kernel after adding to .env
# Or set manually:
import os
os.environ["OPENAI_API_KEY"] = "your-key"

Issue: Module not found

# Sync dependencies with UV
uv sync

# Or install specific package
uv add mlflow openai python-dotenv

πŸ“ License

This tutorial series is provided as educational content for learning MLflow's GenAI capabilities.


πŸ“ Feedback & Contributions

  • Found an issue? Open a GitHub issue
  • Have suggestions? Submit a pull request
  • Want to share? Tag us on social media
  • Questions? Check the MLflow community

Authors: Jules (Databricks Developer Relations) + Claude Code Date: Feburary 2026 MLflow Version: 3.9.0+

About

No description, website, or topics provided.

Resources

Stars

44 stars

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors