Skip to main content

Marimo Flow - Interactive ML notebooks with MLflow integration

Project description

Marimo Flow ๐ŸŒŠ

Interactive ML notebooks with reactive updates, AI assistance, and MLflow tracking


Python Marimo MLflow MCP Docker Version License Contributing


Like marimo algae drifting in crystal waters, your code flows and evolves โ€“ each cell a living sphere of computation, gently touching others, creating ripples of reactive change. In this digital ocean, data streams like currents, models grow like organic formations, and insights emerge naturally from the depths. Let your ML experiments flow freely, tracked and nurtured, as nature intended.

Why Marimo Flow is Powerful ๐Ÿš€

Marimo Flow combines reactive notebook development with AI-powered assistance and robust ML experiment tracking:

  • ๐Ÿค– AI-First Development with MCP: Model Context Protocol (MCP) integration brings live documentation, code examples, and AI assistance directly into your notebooks - access up-to-date library docs for Marimo, Polars, Plotly, and more without leaving your workflow
  • ๐Ÿ”„ Reactive Execution: Marimo's dataflow graph ensures your notebooks are always consistent - change a parameter and watch your entire pipeline update automatically
  • ๐Ÿ“Š Seamless ML Pipeline: MLflow integration tracks every experiment, model, and metric without breaking your flow
  • ๐ŸŽฏ Interactive Development: Real-time parameter tuning with instant feedback and beautiful visualizations

This combination eliminates the reproducibility issues of traditional notebooks while providing AI-enhanced, enterprise-grade experiment tracking.

Features โœจ

๐Ÿค– AI-Powered Development (MCP)

  • Model Context Protocol Integration: Live documentation and AI assistance in your notebooks
  • Context7 Server: Access up-to-date docs for any Python library without leaving marimo
  • Marimo MCP Server: Specialized assistance for marimo patterns and best practices
  • Local LLM Support: Ollama integration for privacy-focused AI code completion

๐Ÿ“Š ML Development Workflow

  • ๐Ÿ““ Reactive Notebooks: Git-friendly .py notebooks with automatic dependency tracking
  • ๐Ÿ”ฌ MLflow Tracking: Complete ML lifecycle management with model registry
  • ๐ŸŽฏ Interactive Development: Real-time parameter tuning with instant visual feedback
  • ๐Ÿ’พ SQLite Backend: Lightweight, file-based storage for experiments

๐Ÿš€ Production Ready

  • ๐Ÿณ Docker Deployment: One-command setup with docker-compose
  • ๐Ÿ“ฆ Curated Snippets & Tutorials: 4 reusable snippet modules plus 15+ tutorial notebooks covering Polars, Plotly, Marimo UI patterns, RAG, and OpenVINO
  • ๐Ÿ“š Comprehensive Docs: Built-in reference guides with 100+ code examples
  • ๐ŸŒ GitHub Pages: Auto-deploy interactive notebooks with WASM

Quick Start ๐Ÿƒโ€โ™‚๏ธ

With Docker (Recommended)

# Clone repository
git clone https://github.com/bjoernbethge/marimo-flow.git
cd marimo-flow

# Build and start services
docker compose -f docker/docker-compose.yaml up --build -d

# Access services
# Marimo: http://localhost:2718
# MLflow: http://localhost:5000

# View logs
docker compose -f docker/docker-compose.yaml logs -f

# Stop services
docker compose -f docker/docker-compose.yaml down

Docker Image Variants

Variant Image Tag Use Case
CPU ghcr.io/bjoernbethge/marimo-flow:latest No GPU (lightweight)
CUDA ghcr.io/bjoernbethge/marimo-flow:cuda NVIDIA GPUs
XPU ghcr.io/bjoernbethge/marimo-flow:xpu Intel Arc/Data Center GPUs
# NVIDIA GPU (requires nvidia-docker)
docker compose -f docker/docker-compose.cuda.yaml up -d

# Intel GPU (requires Intel GPU drivers)
docker compose -f docker/docker-compose.xpu.yaml up -d

Local Development

# Install dependencies
uv sync

# Start MLflow server (in background or separate terminal)
uv run mlflow server \
  --host 0.0.0.0 \
  --port 5000 \
  --backend-store-uri sqlite:///data/experiments/db/mlflow.db \
  --default-artifact-root ./data/experiments/artifacts \
  --serve-artifacts

# Start Marimo (in another terminal)
uv run marimo edit examples/

Example Notebooks ๐Ÿ“š

All notebooks live in examples/ and can be opened with uv run marimo edit examples/<file>.py.

  • 01_interactive_data_profiler.py โ€“ DuckDB-powered data explorer with filters, previews, and interactive scatter plots for any local database.
  • 02_mlflow_experiment_console.py โ€“ Connect to an MLflow tracking directory, inspect experiments, and visualize metric trends inline with Altair.
  • 03_pina_walrus_solver.py โ€“ Toggle between baseline PINNs and the Walrus adapter to solve a Poisson equation with live training controls.
  • 04_hyperparameter_tuning.py โ€“ Optuna-based hyperparameter search for PINA/PyTorch models with MLflow tracking and interactive study settings.
  • 05_model_registry.py โ€“ Train, register, and promote MLflow models end-to-end, including stage transitions and inference checks.
  • 06_production_pipeline.py โ€“ Production-style pipeline featuring validation gates, training, registry integration, deployment steps, and monitoring hooks.
  • 09_pina_live_monitoring.py โ€“ Live training monitoring with real-time loss plotting, error analysis, and comprehensive visualization tools.

Additional learning material lives in examples/tutorials/ (15+ focused notebooks covering marimo UI patterns, Polars, Plotly, DuckDB, OpenVINO, RAG, and PYG) plus examples/tutorials/legacy/ for the retired 00โ€“03 pipeline.

Project Structure ๐Ÿ“

marimo-flow/
โ”œโ”€โ”€ .claude/                     # Claude Code configuration
โ”‚   โ”œโ”€โ”€ Skills/                  # Domain-specific skills
โ”‚   โ”‚   โ”œโ”€โ”€ marimo/              # Marimo notebook development
โ”‚   โ”‚   โ”œโ”€โ”€ mlflow/              # MLflow tracking & GenAI
โ”‚   โ”‚   โ”œโ”€โ”€ pina/                # Physics-informed neural networks
โ”‚   โ”‚   โ””โ”€โ”€ _integration/        # Cross-skill workflows
โ”‚   โ””โ”€โ”€ settings.json            # Hooks (format, lint, protection)
โ”œโ”€โ”€ .vscode/
โ”‚   โ””โ”€โ”€ mcp.json                 # VS Code Copilot MCP config
โ”œโ”€โ”€ .mcp.json                    # Claude Code MCP config
โ”œโ”€โ”€ examples/                    # Production-ready marimo notebooks
โ”‚   โ”œโ”€โ”€ 01_interactive_data_profiler.py
โ”‚   โ”œโ”€โ”€ 02_mlflow_experiment_console.py
โ”‚   โ”œโ”€โ”€ 03_pina_walrus_solver.py
โ”‚   โ”œโ”€โ”€ 04_hyperparameter_tuning.py
โ”‚   โ”œโ”€โ”€ 05_model_registry.py
โ”‚   โ”œโ”€โ”€ 06_production_pipeline.py
โ”‚   โ”œโ”€โ”€ 09_pina_live_monitoring.py
โ”‚   โ””โ”€โ”€ tutorials/                # 15+ focused learning notebooks (+ legacy/)
โ”œโ”€โ”€ snippets/                   # Reusable Python modules for notebooks
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ altair_visualization.py
โ”‚   โ”œโ”€โ”€ data_explorer_pattern.py
โ”‚   โ””โ”€โ”€ pina_basics.py
โ”œโ”€โ”€ tools/                       # Utility tools
โ”‚   โ”œโ”€โ”€ ollama_manager.py           # Local LLM orchestration
โ”‚   โ””โ”€โ”€ openvino_manager.py         # Model serving utilities
โ”œโ”€โ”€ docs/                        # Reference documentation
โ”‚   โ”œโ”€โ”€ marimo-quickstart.md        # Marimo guide
โ”‚   โ”œโ”€โ”€ polars-quickstart.md        # Polars guide
โ”‚   โ”œโ”€โ”€ plotly-quickstart.md        # Plotly guide
โ”‚   โ”œโ”€โ”€ pina-quickstart.md          # PINA guide
โ”‚   โ””โ”€โ”€ integration-patterns.md     # Integration examples
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ mlflow/                  # MLflow storage
โ”‚       โ”œโ”€โ”€ artifacts/           # Model artifacts
โ”‚       โ”œโ”€โ”€ db/                  # SQLite database
โ”‚       โ””โ”€โ”€ prompts/             # Prompt templates
โ”œโ”€โ”€ docker/                      # Docker configuration
โ”œโ”€โ”€ pyproject.toml              # Dependencies
โ””โ”€โ”€ README.md                   # This file

๐Ÿ“ About Snippets

The snippets/ directory contains reusable code patterns built for direct import into Marimo notebooks:

  • altair_visualization.py: opinionated chart builders and theming helpers
  • data_explorer_pattern.py: column filtering + scatter plotting utilities
  • pina_basics.py: Walrus/PINA helpers (problem setup, solver, visualization)

All examples already import these where needed; use them to jump-start your own notebooks or extend the shipped apps. Additional pattern walk-throughs live in examples/tutorials/.

๐Ÿ› ๏ธ About Tools

The tools/ directory contains standalone utility scripts for managing external services:

  • ollama_manager.py: Manage local LLM deployments with Ollama
  • openvino_manager.py: Model serving and inference with OpenVINO

๐Ÿ“š About References

The docs/ directory contains comprehensive LLM-friendly documentation for key technologies:

  • Quick-start guides for Marimo, Polars, Plotly, and PINA
  • Integration patterns and best practices
  • Code examples and common workflows

MCP (Model Context Protocol) Integration ๐Ÿ”Œ

Marimo Flow is AI-first with built-in Model Context Protocol (MCP) support for intelligent, context-aware development assistance.

Why MCP Matters

Traditional notebooks require constant context-switching to documentation sites. With MCP:

  • ๐Ÿ“š Live Documentation: Access up-to-date library docs directly in marimo
  • ๐Ÿค– AI Code Completion: Context-aware suggestions from local LLMs (Ollama)
  • ๐Ÿ’ก Smart Assistance: Ask questions about libraries and get instant, accurate answers
  • ๐Ÿ”„ Always Current: Documentation updates automatically, no more outdated tutorials

Pre-Configured MCP Servers

Context7 - Universal Library Documentation

Access real-time documentation for any Python library:

# Ask: "How do I use polars window functions?"
# Get: Current polars docs, code examples, best practices

# Ask: "Show me plotly 3D scatter plot examples"
# Get: Latest plotly API with working code samples

Supported Libraries:

  • Polars, Pandas, NumPy - Data manipulation
  • Plotly, Altair, Matplotlib - Visualization
  • Scikit-learn, PyTorch - Machine Learning
  • And 1000+ more Python packages

Marimo - Specialized Notebook Assistance

Get expert help with marimo-specific patterns:

# Ask: "How do I create a reactive form in marimo?"
# Get: marimo form patterns, state management examples

# Ask: "Show me marimo UI element examples"
# Get: Complete UI component reference with code

Real-World Examples

Example 1: Learning New Libraries

# You're exploring polars window functions
# Type: "polars rolling mean example"
# MCP returns: Latest polars docs + working code
df.with_columns(
    pl.col("sales").rolling_mean(window_size=7).alias("7d_avg")
)

Example 2: Debugging

# Stuck on a plotly error?
# Ask: "Why is my plotly 3D scatter not showing?"
# Get: Common issues, solutions, and corrected code

Example 3: Best Practices

# Want to optimize code?
# Ask: "Best way to aggregate in polars?"
# Get: Performance tips, lazy evaluation patterns

AI Features Powered by MCP

  • Code Completion: Context-aware suggestions as you type (Ollama local LLM)
  • Inline Documentation: Hover over functions for instant docs
  • Smart Refactoring: AI suggests improvements based on current libraries
  • Interactive Q&A: Chat with AI about your code using latest docs

Configuration

MCP servers are pre-configured in .marimo.toml:

[mcp]
presets = ["context7", "marimo"]

[ai.ollama]
model = "gpt-oss:20b-cloud"
base_url = "http://localhost:11434/v1"

If you're running inside Docker, the same mcp block lives in docker/.marimo.toml, so both local and containerized sessions pick up identical presets.

Adding Custom MCP Servers

You can extend functionality by adding custom MCP servers in .marimo.toml:

[mcp.mcpServers.your-custom-server]
command = "npx"
args = ["-y", "@your-org/your-mcp-server"]

MLflow Trace Server (Optional)

Expose MLflow trace operations to MCP-aware IDEs/assistants (e.g., Claude Desktop, Cursor) by running:

mlflow mcp run

Run the command from an environment where MLFLOW_TRACKING_URI (or MLFLOW_BACKEND_STORE_URI/MLFLOW_DEFAULT_ARTIFACT_ROOT) points at your experiments. The server stays up until interrupted and can be proxied alongside Marimo/MLflow so every tool shares the same MCP context.

Learn More:

Claude Code Integration ๐Ÿค–

Marimo Flow includes full Claude Code support with domain-specific skills, MCP servers, and automated hooks.

Pre-Configured MCP Servers

Server Purpose Config
marimo Notebook inspection, debugging, linting HTTP on port 2718
mlflow Trace search, feedback, evaluation stdio via mlflow mcp run
context7 Live library documentation stdio via npx
serena Semantic code search stdio via uvx

Start marimo MCP server:

# Install once (recommended)
uv tool install "marimo[lsp,recommended,sql,mcp]>=0.18.0"

# Start server
marimo edit --mcp --no-token --port 2718 --headless

Domain Skills

Three specialized skills in .claude/Skills/ provide expert guidance:

Skill Triggers MCP Tools
marimo marimo, reactive notebook, mo.ui Notebook inspection, linting, context7 docs
mlflow mlflow, experiment tracking, genai tracing Trace search, feedback, evaluation, context7 docs
pina pina, pinns, pde solver, neural operator MLflow tracking, context7 docs

Pre-resolved context7 library IDs (no lookup needed):

  • /marimo-team/marimo - marimo docs (2,413 snippets)
  • /mlflow/mlflow - mlflow docs (9,559 snippets)
  • /mathlab/pina - PINA docs (2,345 snippets)

Automated Hooks

Cross-platform hooks in .claude/settings.json:

Hook Trigger Action
SessionStart Session begins Start marimo MCP server
PostToolUse Edit/Write .py files Auto-format with ruff
PreToolUse Edit uv.lock Block (protection)

VS Code Copilot

MCP config for VS Code Copilot in .vscode/mcp.json:

{
  "servers": {
    "marimo": { "type": "http", "url": "http://127.0.0.1:2718/mcp/server" },
    "mlflow": { "type": "stdio", "command": "mlflow", "args": ["mcp", "run"] }
  }
}

Configuration โš™๏ธ

Environment Variables

Docker setup (configured in docker/docker-compose.yaml):

  • MLFLOW_BACKEND_STORE_URI: sqlite:////app/data/experiments/db/mlflow.db
  • MLFLOW_DEFAULT_ARTIFACT_ROOT: /app/data/experiments/artifacts
  • MLFLOW_HOST: 0.0.0.0 (allows external access)
  • MLFLOW_PORT: 5000
  • OLLAMA_BASE_URL: http://host.docker.internal:11434 (requires Ollama on host)

Local development:

  • MLFLOW_TRACKING_URI: http://localhost:5000 (default)

Docker Services

The Docker container runs both services via docker/start.sh:

  • Marimo: Port 2718 - Interactive notebook environment
  • MLflow: Port 5000 - Experiment tracking UI

GPU Support: NVIDIA GPU support is enabled by default. Remove the deploy.resources section in docker-compose.yaml if running without GPU.

Pre-installed ML & Data Science Stack ๐Ÿ“ฆ

Machine Learning & Scientific Computing

  • scikit-learn ^1.5.2 - Machine learning library
  • NumPy ^2.1.3 - Numerical computing
  • pandas ^2.2.3 - Data manipulation and analysis
  • PyArrow ^18.0.0 - Columnar data processing
  • SciPy ^1.14.1 - Scientific computing
  • matplotlib ^3.9.2 - Plotting library

High-Performance Data Processing

  • Polars ^1.12.0 - Lightning-fast DataFrame library
  • DuckDB ^1.1.3 - In-process analytical database
  • Altair ^5.4.1 - Declarative statistical visualization

AI & LLM Integration

  • OpenAI ^1.54.4 - GPT API integration
  • FastAPI ^0.115.4 - Modern web framework
  • Pydantic ^2.10.2 - Data validation

Database & Storage

  • SQLAlchemy ^2.0.36 - SQL toolkit and ORM
  • Alembic ^1.14.0 - Database migrations
  • SQLGlot ^25.30.2 - SQL parser and transpiler

Web & API

Development Tools

  • Black ^24.10.0 - Code formatter
  • Ruff ^0.7.4 - Fast Python linter
  • pytest ^8.3.3 - Testing framework
  • MyPy ^1.13.0 - Static type checker

API Endpoints ๐Ÿ”Œ

MLflow REST API

  • Experiments: GET /api/2.0/mlflow/experiments/list
  • Runs: GET /api/2.0/mlflow/runs/search
  • Models: GET /api/2.0/mlflow/registered-models/list

Marimo Server

  • Notebooks: GET / - File browser and editor
  • Apps: GET /run/<notebook> - Run notebook as web app

Contributing ๐Ÿค

We welcome contributions! Please see our Contributing Guidelines for details on:

  • Development setup and workflow
  • Code standards and style guide
  • Testing requirements
  • Pull request process

Quick Start for Contributors:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Make your changes following the coding standards
  4. Test your changes: uv run pytest
  5. Submit a pull request

See CONTRIBUTING.md for comprehensive guidelines.

Changelog ๐Ÿ“‹

See CHANGELOG.md for a detailed version history and release notes.

Current Version: 0.2.0

License ๐Ÿ“„

This project is licensed under the MIT License - see the LICENSE file for details.


Built with โค๏ธ using Marimo and MLflow

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

marimo_flow-0.2.0.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

marimo_flow-0.2.0-py3-none-any.whl (20.8 kB view details)

Uploaded Python 3

File details

Details for the file marimo_flow-0.2.0.tar.gz.

File metadata

  • Download URL: marimo_flow-0.2.0.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for marimo_flow-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c3eb800372eb1cb836af1d9fd3bce95e3f744f95fa16bed8fe7a0f4db99683f5
MD5 892430d20de6e26a9ee2612586328281
BLAKE2b-256 6202ec1c97a9bf905572c086c20fd30596fdc2938fd82b1145106916619c43e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for marimo_flow-0.2.0.tar.gz:

Publisher: python-publish.yml on bjoernbethge/marimo-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file marimo_flow-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: marimo_flow-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for marimo_flow-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65655ced4ea8306e961100bb7fb0bcd2c3d83014c04de4f29a09c6e26b183c47
MD5 7c481d01ece25f60290ce6714f629510
BLAKE2b-256 85276e0466f9f101482aac216dd47f345980cab30d87e7d7939d113837b9de06

See more details on using hashes here.

Provenance

The following attestation bundles were made for marimo_flow-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on bjoernbethge/marimo-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page