The Python framework for lightning-fast AI prototypes
Project description
RapidAI ๐
Production-ready Python framework for building AI applications fast
RapidAI is designed for one thing: getting from idea to deployed AI application in under an hour. When your boss asks you to POC the latest AI tool, this is the framework you reach for.
Vision
A web framework that bridges the gap between Flask's simplicity and Django's batteries-included approach, but optimized specifically for modern AI development. Think of it as "the Rails of AI apps" - convention over configuration, but for LLM-powered applications.
โจ Features
- ๐ค Zero-config LLM integration - Built-in support for Anthropic Claude, OpenAI, Cohere with unified interface
- ๐ก Streaming by default - SSE/WebSocket streaming built into routes, not bolted on
- ๐ Background jobs - Async task processing with automatic retry and job tracking
- ๐ Built-in monitoring - Token usage, cost tracking, and metrics dashboard
- ๐จ UI components - Pre-built chat interfaces with customizable themes
- ๐ RAG system - Document loading, embeddings, vector DB integration for retrieval
- ๐ Prompt management - Version control and templating for prompts with Jinja2
- ๐พ Smart caching - Semantic caching using embedding similarity
- ๐งช Testing utilities - TestClient, MockLLM, MockMemory for easy testing
- โก CLI tool - Project templates, dev server, deployment, and more
๐ Quick Start
Simple Chat Endpoint
from rapidai import App, LLM
app = App()
llm = LLM("claude-3-haiku-20240307")
@app.route("/chat", methods=["POST"])
async def chat(message: str):
response = await llm.complete(message)
return {"response": response}
if __name__ == "__main__":
app.run()
With Streaming
from rapidai import App, LLM
app = App()
llm = LLM("claude-3-haiku-20240307")
@app.route("/chat", methods=["POST"])
async def chat(message: str):
async for chunk in llm.stream(message):
yield chunk
if __name__ == "__main__":
app.run()
With Background Jobs
from rapidai import App, background
app = App()
@background(max_retries=3)
async def process_document(doc_id: str):
# Long-running task runs in background
await analyze_document(doc_id)
@app.route("/process", methods=["POST"])
async def start_processing(doc_id: str):
job = await process_document(doc_id)
return {"job_id": job.id, "status": job.status}
With Monitoring
from rapidai import App, LLM, monitor
app = App()
llm = LLM("claude-3-haiku-20240307")
@app.route("/chat", methods=["POST"])
@monitor() # Automatically tracks tokens and costs
async def chat(message: str):
return await llm.complete(message)
@app.route("/metrics")
async def metrics():
return app.get_metrics_html() # Built-in dashboard
๐ฆ Installation
pip install rapidai-framework
Optional Dependencies
Install with specific features:
# Anthropic Claude support
pip install "rapidai-framework[anthropic]"
# OpenAI support
pip install "rapidai-framework[openai]"
# RAG (document loading, embeddings, vector DB)
pip install "rapidai-framework[rag]"
# Redis (for caching and memory)
pip install "rapidai-framework[redis]"
# Everything
pip install "rapidai-framework[all]"
# Development tools
pip install "rapidai-framework[dev]"
๐ What's Included
Core Framework
- โ App class - Fast async web server with routing
- โ LLM clients - Anthropic Claude, OpenAI, Cohere with unified interface
- โ Streaming - Built-in SSE support for real-time responses
- โ Memory - Conversation history (in-memory and Redis)
- โ Caching - Semantic caching with embedding similarity
- โ Config - Environment-based configuration with Pydantic
Advanced Features
- โ
Background jobs -
@backgrounddecorator with retry logic and job tracking - โ
Monitoring -
@monitordecorator with token/cost tracking and HTML dashboard - โ RAG system - Document loading (PDF, DOCX, TXT, HTML, MD), embeddings, vector DB
- โ Prompt management - Template-based prompts with Jinja2 and versioning
- โ UI components - Pre-built chat interfaces with themes and customization
- โ Testing utilities - TestClient, MockLLM, MockMemory for easy testing
Developer Tools
- โ
CLI tool -
rapidai new,rapidai dev,rapidai deploy,rapidai test - โ Project templates - Chatbot, RAG, Agent, API templates
- โ Type hints - Full type coverage for IDE support
- โ Documentation - Complete guides and API references at rapidai.dev
Status
Version: 1.0.0 - Production Ready ๐
See CHANGELOG.md for release notes.
๐ก Use Cases
Perfect for building:
- ๐ค Chat applications - Customer support bots, AI assistants
- ๐ RAG systems - Document Q&A, knowledge bases
- ๐ง Internal tools - AI-powered dashboards and workflows
- ๐ Data processing - Background jobs for document analysis
- ๐ AI APIs - REST endpoints with LLM integration
- ๐ฏ Rapid prototypes - POCs and MVPs in under an hour
๐ฏ Philosophy
- Convention over configuration - Sensible defaults, minimal boilerplate
- Provider agnostic - Swap OpenAI for Anthropic with one line
- Async-first - Built on modern async/await patterns
- Type-safe - Full type hints for excellent IDE support
- Batteries included - Everything you need, nothing you don't
- Production ready - Monitoring, testing, deployment from day one
๐ Documentation
Complete documentation available at rapidai.dev
- Getting Started Guide
- LLM Integration
- Background Jobs
- Monitoring & Metrics
- RAG System
- UI Components
- Testing Guide
- Deployment
- API Reference
๐ ๏ธ CLI Tool
RapidAI includes a powerful CLI for project scaffolding and management:
# Create a new project from template
rapidai new my-chatbot --template chatbot
# Start development server with hot reload
rapidai dev
# Run tests
rapidai test
# Deploy to cloud platforms
rapidai deploy --platform vercel
# Generate documentation
rapidai docs
Available templates:
chatbot- Simple chat applicationrag- RAG system with document Q&Aagent- AI agent with toolsapi- REST API with LLM endpoints
๐จโ๐ป Development
# Clone the repository
git clone https://github.com/shaungehring/rapidai.git
cd rapidai
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Install pre-commit hooks
pre-commit install
# Run tests
pytest
# Run tests with coverage
pytest --cov=rapidai tests/
# Type check
mypy rapidai
# Lint and format
ruff check rapidai
ruff format rapidai
๐ค Community & Support
- ๐ Documentation - rapidai.dev
- ๐ Bug Reports - GitHub Issues
- ๐ก Feature Requests - GitHub Discussions
- ๐ฆ PyPI Package - pypi.org/project/rapidai-framework
- ๐ Changelog - CHANGELOG.md
๐ Publishing
RapidAI is available on PyPI. To publish a new version:
# Test on TestPyPI first
./scripts/publish.sh test
# Publish to production PyPI
./scripts/publish.sh prod
See PUBLISHING.md for complete publishing guide.
๐ License
MIT License - see LICENSE file for details.
๐ Contributing
We welcome contributions! Whether it's:
- ๐ Bug fixes
- โจ New features
- ๐ Documentation improvements
- ๐งช Test coverage
- ๐ก Ideas and suggestions
See CONTRIBUTING.md for guidelines on how to contribute.
โญ Show Your Support
If you find RapidAI helpful, please consider:
- โญ Starring the GitHub repository
- ๐ข Sharing with your network
- ๐ Reporting issues you encounter
- ๐ก Suggesting new features
Built with โค๏ธ for AI engineers who move fast
Version: 1.0.0 | Status: Production Ready ๐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rapidai_framework-1.0.1.tar.gz.
File metadata
- Download URL: rapidai_framework-1.0.1.tar.gz
- Upload date:
- Size: 54.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f088ceaac826f461a0cd0bcd43fe8d2cacc037326b02d8200e8d68c2310d6f40
|
|
| MD5 |
99e50e9d831a3fa16bd72075a3681934
|
|
| BLAKE2b-256 |
8dec39416958c565dfaaeb5089ba3a4fd5da56a91f643f63a4c1399caa31c71e
|
File details
Details for the file rapidai_framework-1.0.1-py3-none-any.whl.
File metadata
- Download URL: rapidai_framework-1.0.1-py3-none-any.whl
- Upload date:
- Size: 70.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60685095d8c8dc0799086ae21df9cc4154340d7855440a8819baf2779ca77ca1
|
|
| MD5 |
8682ea3e00b135369e1be556e62300a1
|
|
| BLAKE2b-256 |
abca525fc0d53aa34dbc5c4fae37701eb5ccfff7a3abf7f5ec158c817c6c3f99
|