Skip to content

Raphasha27/ai-chatkit

Β 
Β 

Node.js React TypeScript Python Next.js License


πŸ€– Overview

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.


✨ Features

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

πŸ—οΈ Architecture

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
Loading

πŸš€ Quick Start

Prerequisites

  • Python 3.11+
  • Node.js 20+
  • uv (Python package manager)

1. Clone the repository

git clone https://github.com/Raphasha27/ai-chatkit.git
cd ai-chatkit

2. Backend setup

cd 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 8000

The API will be available at http://localhost:8000.

3. Frontend setup

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 dev

The chat UI will be available at http://localhost:3000.


βš™οΈ Environment Variables

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_PROVIDER is required.


πŸ—ΊοΈ Roadmap

  • 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

🀝 Contributing

Contributions, issues, and feature requests are welcome!
See CONTRIBUTING.md for guidelines and CODE_OF_CONDUCT.md for community standards.


πŸ” Security

Found a vulnerability? Please read SECURITY.md before disclosing publicly.


πŸ“„ License

This project is licensed under the MIT License β€” see LICENSE for details.


Built with ❀️ by Koketso Raphasha · © 2026 Kirov Dynamics Technology

About

Extensible AI chat toolkit for rapid integration of Gemini and OpenAI models into enterprise applications.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 67.1%
  • TypeScript 32.4%
  • Other 0.5%