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
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 litellm python-dotenv
Then in Python:
from dotenv import load_dotenv
load_dotenv() # Load OPENROUTER_API_KEY from .env
import litellm
from massgen import register_with_litellm
register_with_litellm()
response = litellm.completion(
model="massgen/build",
messages=[{"role": "user", "content": "Hello!"}],
optional_params={"models": ["openrouter/openai/gpt-5"]}
)
print(response.choices[0].message.content)
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:
Configure API keys - Enter keys for OpenAI, Anthropic, Google, etc.
Setup Docker (optional) - For isolated code execution
Review Skills - See available agent capabilities
Create your agent team - Quickstart wizard for configuration
This is the easiest way to get started - everything in one visual interface.
uv run massgen
The terminal wizard will:
Configure API keys (OpenRouter recommended, or individual providers)
Create your agent team (choose from templates or examples)
Launch interactive mode immediately
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#
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