AI ChatKit is a production-ready, full-stack AI chat framework that lets you drop a fully featured chat interface into any application in minutes. It abstracts away provider-specific API quirks β streaming protocols, token limits, tool-call formats β behind a single clean interface so your team ships features instead of glue code.
Problem it solves: Every team building with LLMs rewrites the same boilerplate β provider adapters, SSE streaming, conversation history, auth, and embeddings. AI ChatKit is that solved layer, plug-and-play out of the box.
| Feature | Description |
|---|---|
| π Multi-Provider LLM Support | Switch between OpenAI, Google Gemini, Anthropic Claude, DeepSeek, and Qwen with a single env var |
| β‘ Streaming Responses | Real-time token streaming via Server-Sent Events (SSE) β zero polling |
| π§ Conversation History | Persistent, multi-turn conversation storage with SQLite or PostgreSQL |
| π’ Multi-Tenant Architecture | Isolated sessions and API keys per workspace or user |
| π REST API | Clean, documented REST endpoints β integrate with any frontend or service |
| πͺ Embeddable Widget | Drop the React component into any existing app with a single import |
| π RAG-Ready | ChromaDB vector store integration with bge-m3 multilingual embeddings |
| π JWT Auth | Stateless authentication baked in from day one |
graph TD
subgraph Frontend ["Frontend (Next.js 14 + React 18)"]
W["Chat Widget\n(Embeddable Component)"]
UI["Chat UI\n(Ant Design + Tailwind)"]
W --> UI
end
subgraph Backend ["Backend (Python / FastAPI)"]
API["REST API\n/api/v1/chat"]
AUTH["JWT Auth\nMiddleware"]
HIST["Conversation\nHistory Service"]
EMB["Embedding\nService (bge-m3)"]
API --> AUTH
API --> HIST
API --> EMB
end
subgraph VectorDB ["Vector Store"]
CHROMA["ChromaDB"]
end
subgraph DB ["Database"]
SQLITE["SQLite\n(dev)"]
POSTGRES["PostgreSQL\n(prod)"]
end
subgraph LLMs ["LLM Providers"]
OAI["OpenAI\nGPT-4o"]
GEM["Google\nGemini"]
ANT["Anthropic\nClaude"]
DS["DeepSeek"]
end
UI -->|"SSE Stream"| API
HIST --> SQLITE
HIST --> POSTGRES
EMB --> CHROMA
API -->|"Adapter"| OAI
API -->|"Adapter"| GEM
API -->|"Adapter"| ANT
API -->|"Adapter"| DS
- Python 3.11+
- Node.js 20+
- uv (Python package manager)
git clone https://github.com/Raphasha27/ai-chatkit.git
cd ai-chatkitcd backend
# Install dependencies via uv
uv sync
# Copy and configure environment variables
cp .env.example .env
# Edit .env β set LLM_PROVIDER and the matching API key
# Start the development server
uv run uvicorn app.main:app --reload --port 8000The API will be available at http://localhost:8000.
cd frontend
# Install dependencies
npm install
# Copy and configure environment variables
cp .env.example .env.local
# Edit .env.local β set NEXT_PUBLIC_API_URL=http://localhost:8000
# Start the development server
npm run devThe chat UI will be available at http://localhost:3000.
Configure the root .env (or backend/.env) using the table below. Copy .env.example as your starting point β never commit real secrets.
| Variable | Required | Default | Description |
|---|---|---|---|
PORT |
β | 8000 |
Port the backend API listens on |
LLM_PROVIDER |
β | openai |
Active LLM provider: openai | gemini | anthropic | deepseek | dashscope |
OPENAI_API_KEY |
β΄οΈ | β | OpenAI API key (required when LLM_PROVIDER=openai) |
GEMINI_API_KEY |
β΄οΈ | β | Google Gemini API key (required when LLM_PROVIDER=gemini) |
ANTHROPIC_API_KEY |
β΄οΈ | β | Anthropic API key (required when LLM_PROVIDER=anthropic) |
JWT_SECRET |
β | β | Secret used to sign JWT tokens β generate with openssl rand -hex 32 |
DATABASE_URL |
β | sqlite+aiosqlite:///resource/database.db |
SQLAlchemy async database connection string |
EMBEDDING_MODEL |
β | bge-m3 |
Ollama embedding model for RAG features |
CHROMA_PATH |
β | resource/chroma_db |
Relative path for ChromaDB persistence |
DEBUG |
β | false |
Enable verbose debug logging |
β΄οΈ Only the key matching the active
LLM_PROVIDERis required.
- Unified provider adapter layer (OpenAI, Gemini, Anthropic, DeepSeek, Qwen)
- SSE streaming responses
- Persistent conversation history (SQLite + PostgreSQL)
- JWT authentication middleware
- ChromaDB + bge-m3 embedding integration
- Next.js 14 + Ant Design chat UI
- Built-in RAG pipeline with document upload
- Embeddable
<ChatWidget />npm package - OpenAPI / Swagger documentation endpoint
- WebSocket transport option (alongside SSE)
- Admin dashboard for conversation analytics
- One-click Vercel + Railway deployment templates
- MCP (Model Context Protocol) tool integration
Contributions, issues, and feature requests are welcome!
See CONTRIBUTING.md for guidelines and CODE_OF_CONDUCT.md for community standards.
Found a vulnerability? Please read SECURITY.md before disclosing publicly.
This project is licensed under the MIT License β see LICENSE for details.