Introduction
FastAPI AI Kit is a production-ready backend boilerplate for developers building AI-powered APIs. Instead of wiring up authentication, LLM integration, RAG pipelines, billing metering, and infrastructure from scratch, you start with a clean, modular codebase where all of that is already done.
Who is this for?
- Indie developers shipping AI products (chatbots, assistants, RAG apps) fast
- Startup engineers who need a backend that's ready to handle real users from day one
- Backend developers who want to add LLM capabilities to an existing product without a rewrite
What's included
| Module | Description | |---|---| | Auth | JWT authentication, API key issuance, rate limiting per key | | LLM Layer | Unified interface for OpenAI, Anthropic, and local models | | Streaming | Server-sent events (SSE) with per-request token counting | | RAG Pipeline | Document ingestion, embedding, and retrieval via pgvector or Qdrant | | Billing Hooks | Stripe-compatible usage metering, pluggable per-key | | Background Jobs | Celery + Redis, or arq — pre-configured | | Database | PostgreSQL + SQLAlchemy 2.0 async + Alembic migrations | | DevOps | Docker, docker-compose, deploy guides for Railway/Render/Fly/VPS | | Quality | pytest, pre-commit, GitHub Actions CI |
What it is NOT
- A no-code platform — this is real Python code you own and extend
- A hosted service — you deploy it anywhere you like
- A tutorial — it's production code, not a learning exercise
Philosophy
The kit follows a few simple principles:
- Boring over clever. Clean, readable code over clever abstractions.
- Easy to delete. Every module is decoupled. Don't need billing hooks? Delete them. No footguns.
- Extend, don't fight. Standard FastAPI, standard SQLAlchemy. If you know FastAPI, you know this codebase.
- Config over code. LLM providers, rate limits, tier definitions — all in config files, not hardcoded.
