Installation#

Prerequisites#

MassGen requires Python 3.11 or higher.

A guide to install python can be found here

python --version  # Should be 3.11+

Quick Install#

pip install uv          # if uv is not installed, the fastest way to check if uv is installed is to run "uv venv"
# if the above command fails, run "curl -LsSf https://astral.sh/uv/install.sh | sh" for macOS and Linux to install uv
# or run "powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex" for Windows
uv venv && source .venv/bin/activate
uv pip install massgen

For programmatic Python usage, see the Programmatic API Guide.

First Run Setup#

On first run, MassGen guides you through setup. Choose your preferred interface:

uv run massgen --web

The browser-based setup wizard will:

  1. Configure API keys - Enter keys for OpenAI, Anthropic, Google, etc.

  2. Setup Docker (optional) - For isolated code execution

  3. Review Skills - See available agent capabilities

  4. Create your agent team - Quickstart wizard for configuration

This is the easiest way to get started - everything in one visual interface.

Your configuration is saved to ~/.config/massgen/config.yaml.

API Keys#

API keys can be configured through webui or cli setup. However, they can also be setup through the terminal:

OpenRouter (recommended): Single API key for all models

export OPENROUTER_API_KEY=sk-or-v1-...

Or use individual providers: OpenAI, Anthropic, Google Gemini, xAI (Grok), Azure OpenAI, Groq, Together AI, Fireworks, Cerebras

Manual setup (optional - wizard handles this):

# Create .env file
mkdir -p ~/.config/massgen
echo "OPENROUTER_API_KEY=sk-or-v1-..." >> ~/.config/massgen/.env

Re-run Setup#

Re-configure anytime:

uv run massgen --web         # WebUI setup page (visit /setup)
uv run massgen --init        # CLI full configuration wizard
uv run massgen --setup       # CLI just API keys
uv run massgen --quickstart  # CLI quick 3-agent setup

Verify Installation#

# Check CLI is available
uv run massgen --help

# List example configurations
uv run massgen --list-examples

# Run multi-agent collaboration
uv run massgen --config @examples/basic/multi/three_agents_default "What is machine learning?"

Optional: Observability#

For structured logging and tracing with Logfire:

# Install with observability support
pip install "massgen[observability]"

# Or with uv
uv pip install "massgen[observability]"

# Authenticate with Logfire
uv run logfire auth

# Run with observability enabled
uv run massgen --logfire --config your_config.yaml "Your question"

See Logging & Debugging for detailed Logfire configuration.

Optional: Docker & Skills#

For advanced features like isolated code execution:

# Install Docker images
uv run massgen --setup-docker

# Install skills (semantic search, web scraping)
uv run massgen --setup-skills

These are optional - basic MassGen works without them.

Development Installation#

For contributors or source code access:

git clone https://github.com/Leezekun/MassGen.git
cd MassGen
pip install -e .

# Or with full dev setup (Unix/macOS)
./scripts/init.sh

Next Steps#

▶️ Run MassGen

See all usage modes

Running MassGen

⚙️ Configuration

Create custom agent teams

Configuration

📚 Examples

Ready-to-use configs

Basic Examples

🐍 Python API

Programmatic integration

Programmatic API Guide

Troubleshooting#

Python version error:

python --version  # Need 3.11+
pip install --upgrade massgen

API key not found:

Check ~/.config/massgen/.env exists with correct keys, or re-run massgen --init.

Setup wizard not appearing:

Run massgen --init to manually trigger it.

For more help: GitHub Issues