Requirements

  • Python 3.10 or higher
  • An API key from an LLM provider (OpenAI by default)

Install marvin

The easiest way to install Marvin is a package manager like pip or uv:

# add marvin to your project
uv add marvin
# add marvin to your virtual environment
uv pip install marvin
# add marvin to your script
uv add --script some_script.py marvin
# run a python process with marvin installed ephemerally
uv run --with marvin some_script.py

Configure your LLM provider

By default, Marvin uses OpenAI’s models. Set your API key as an environment variable:

export OPENAI_API_KEY="your-api-key"

To use another provider, see the docs on configuring LLMs.

Development Installation

For development, install Marvin with development dependencies:

git clone https://github.com/prefecthq/marvin.git
cd marvin
uv venv && source .venv/bin/activate
uv sync --dev

What’s Next?

  • Follow the Quickstart guide to build your first AI application
  • Learn about Tasks, the building blocks of AI workflows
  • Explore Agents to create specialized AI workers
  • Read about Threads for managing conversation context