Installation¶
Requirements¶
Python Version
RapidAI requires Python 3.9 or higher
Install RapidAI¶
Optional Dependencies¶
RapidAI has several optional dependency groups:
| Extra | Description | Install Command |
|---|---|---|
anthropic |
Anthropic Claude support | pip install rapidai[anthropic] |
openai |
OpenAI GPT support | pip install rapidai[openai] |
cohere |
Cohere support | pip install rapidai[cohere] |
rag |
RAG features (vector DB, embeddings) | pip install rapidai[rag] |
redis |
Redis cache/memory backend | pip install rapidai[redis] |
postgres |
PostgreSQL memory backend | pip install rapidai[postgres] |
all |
All optional features | pip install rapidai[all] |
dev |
Development tools | pip install rapidai[dev] |
Setup API Keys¶
Create a .env file in your project root:
.env
# Anthropic (Claude)
ANTHROPIC_API_KEY=sk-ant-your-key-here
# OpenAI (GPT)
OPENAI_API_KEY=sk-your-key-here
# Cohere
COHERE_API_KEY=your-key-here
# Optional: Default settings
RAPIDAI_LLM_PROVIDER=anthropic
RAPIDAI_LLM_MODEL=claude-3-haiku-20240307
RAPIDAI_LLM_TEMPERATURE=0.7
RAPIDAI_LLM_MAX_TOKENS=4000
Keep Your Keys Secret
Never commit .env files to version control. Add .env to your .gitignore.
Verify Installation¶
test_install.py
import rapidai
print(f"RapidAI version: {rapidai.__version__}")
print("✓ Installation successful!")
python test_install.py
Expected output:
Get API Keys¶
Anthropic (Claude)¶
- Visit console.anthropic.com
- Sign up or log in
- Navigate to API Keys
- Create a new API key
- Copy and add to your
.envfile
OpenAI (GPT)¶
- Visit platform.openai.com
- Sign up or log in
- Navigate to API Keys
- Create a new API key
- Copy and add to your
.envfile
Cohere¶
- Visit dashboard.cohere.com
- Sign up or log in
- Navigate to API Keys
- Copy your API key
- Add to your
.envfile
Troubleshooting¶
ModuleNotFoundError¶
If you get ModuleNotFoundError: No module named 'rapidai':
- Check your Python version:
python --version - Verify installation:
pip list | grep rapidai - Try reinstalling:
pip install --force-reinstall rapidai
Import Errors¶
If you get import errors for optional dependencies:
# ❌ This will fail if anthropic not installed
from rapidai import LLM
llm = LLM("claude-3-haiku-20240307")
Solution:
API Key Not Found¶
If you get "API key not found" errors:
- Check
.envfile exists in project root - Verify key names match:
ANTHROPIC_API_KEY,OPENAI_API_KEY - No quotes around keys in
.env - No spaces around
=in.env
Next Steps¶
- First Steps - Create your first RapidAI app
- Quick Start - Learn the basics
- Tutorial - Step-by-step guide
Ready to Go!
Installation complete! Let's build something amazing.