OS Chat is a free, open-source AI personal assistant that combines 40+ language models with powerful automation capabilities. Deploy background agents, connect your favorite services (Gmail, Calendar, Notion, GitHub), and get things done through natural conversation.
- π Open Source T3 Chat Alternative - Get all the speed and multi-model access of T3 Chat, but open source, self-hostable, and enhanced with background agents and service integrations
- π€ Your AI Personal Assistant - More than chat - deploy background agents, automate workflows, and manage your digital life
- π Connect Everything - Direct integration with Gmail, Calendar, Notion, GitHub, Slack, and 10+ more services
- β° Smart Automation - Deploy background agents with email notifications - let your assistant work while you sleep
- π§ 40+ AI Models - Access the latest from OpenAI, Anthropic, Google, Meta, and more in one interface
- π― Truly Personal - Customize personality traits, personal context, and preferences for tailored interactions
- π Privacy-First - Open source, self-hostable, with encrypted API key storage
- Smart Background Agents - Deploy AI agents to run one-time, daily, or weekly with timezone awareness
- Email Notifications - Get notified when your background agents complete successfully
- Automated Workflows - Let your AI assistant handle routine work while you focus on what matters
- Execution History - Track and monitor all your background agent runs with detailed logs
- Flexible Scheduling - Pause, resume, or archive agents as your needs change
- Gmail Integration - Access, read, and manage your email messages directly through chat
- Google Calendar - View, create, and schedule calendar events seamlessly
- Google Drive & Docs - Access files, create documents, and collaborate on projects
- Notion Workspace - Read and write to your Notion pages and databases
- GitHub Management - Manage repositories, issues, and pull requests
- Slack Communication - Send messages and interact with your workspace
- Linear Project Management - Track and manage issues and projects
- X (Twitter) - Post tweets and manage your social media presence
- 10+ More Services - Expanding ecosystem of productivity integrations
- 40+ AI Models - Access OpenAI, Anthropic, Google, Meta, Mistral, DeepSeek, xAI, Moonshot, zAI, and Qwen models
- Multi-modal Support - Text, images, and reasoning across all supported models
- Image Generation - Create high-quality images with GPT Image 1, Imagen 4, and Flux Schnell
- Reasoning Models - View AI thinking process with o3, Claude 4, Gemini Thinking, and DeepSeek R1
- Model Switching - Seamlessly switch between models within conversations
- Web Search Integration - Real-time internet search using Exa, Tavily, and Brave APIs
- Smart Organization - Automatic grouping by Today, Yesterday, Last 7 Days, etc.
- Pinned Chats - Keep important conversations at the top
- Chat Branching - Create alternative conversation paths from any assistant message
- Advanced Search - Full-text search across chat history with content snippets
- Bulk Operations - Export, delete, or manage multiple chats at once
- Data Portability - Export/import chat history with full data control
- Responsive Design - Beautiful interface that works on desktop and mobile
- Advanced Sidebar - Collapsible chat sidebar with search, pinning, and organization
- Theme System - Beautiful light and dark modes with smooth transitions
- Keyboard Shortcuts - Quick access with β+K (search), β+Shift+O (new chat), β+B (toggle sidebar)
- Real-time Streaming - Instant message streaming for immediate responses
- Mobile Optimized - Drawer-based navigation for seamless mobile experience
- User Personalization - Set name, occupation, and personality traits for AI interactions
- Comprehensive Settings - Dedicated pages for account, customization, history, and attachments
- Message Usage Tracking - Clear visibility into daily/monthly limits and premium credits
- API Key Management - Secure encryption and management of user-provided API keys
- Prompt Suggestions - Contextual prompt ideas to inspire conversations
- Payments & Subscriptions - Integrated billing with Polar for premium model access
- Premium Credits - Access to advanced models like GPT-5, Claude 4 Sonnet, o3 and more
OS Chat supports 40+ AI models across multiple providers:
- OpenAI: GPT-5, GPT-5 Mini, GPT-5 Nano, GPT OSS 20B, GPT OSS 120B, GPT-4o, GPT-4o Mini, o4 Mini, o3, o3 Pro, GPT-4.1, GPT-4.1 Mini, GPT-4.1 Nano, GPT-4.5
- Anthropic: Claude 4 Opus, Claude 4 Sonnet (with reasoning), Claude 3.7 Sonnet (with reasoning), Claude 3.5 Sonnet
- Google: Gemini 2.5 Pro, Gemini 2.5 Flash (with thinking), Gemini 2.5 Flash Lite (with thinking), Gemini 2.0 Flash, Gemini 2.0 Flash Lite
- Meta: Llama 4 Maverick, Llama 4 Scout
- Mistral: Pixtral Large, Mistral Large
- DeepSeek: DeepSeek V3.1 (with reasoning), DeepSeek V3 0324, DeepSeek R1 (0528), DeepSeek R1 Distill Llama 70B
- xAI: Grok 4, Grok 3, Grok 3 Mini
- Moonshot: Kimi K2
- zAI: GLM 4.5, GLM 4.5 Air, GLM 4.5V
- Qwen: Qwen3 Coder, Qwen3 235B (with thinking), Qwen3 235B
- OpenAI: GPT Image 1
- Google: Imagen 4, Imagen 4 Ultra
- Fal: Flux Schnell
- Next.js - React framework for the frontend
- prompt-kit - Beautiful AI components and primitives
- shadcn/ui - Modern component library for UI
- motion-primitives - Smooth animations and transitions
- Vercel AI SDK - Model integration and streaming
- Convex - Real-time backend, authentication, and database
- Cloudflare R2 - Object storage for file attachments
- Polar - Payments and subscriptions
- Phosphor Icons - Beautiful icon system
- Tailwind CSS - Utility-first CSS framework
- Projects & Workspaces - Organize your chats into projects and workspaces
- MCP integration - Model Context Protocol support for enhanced AI capabilities
- Background Agents - Deploy agents that work autonomously and deliver results via email.
- Image Generation - Create images with GPT Image 1, Imagen 4, and Flux Schnell
- Advanced Search - Full-text search across chat history with content snippets
- Payments Integration - Polar-powered subscriptions for premium model access
- Enhanced Settings Panel - Comprehensive settings with account management and API key encryption
- Chat Branching - Create alternative conversation paths from any assistant message
- Reasoning Models - Visual thinking process for o3, Claude 4 Opus, and DeepSeek R1
- Mobile Optimization - Improved mobile experience with drawer-based navigation
- Node.js 18+ or Bun (recommended)
- Git
- A Convex account (free tier available)
- API keys for the AI models you want to use
# Clone the repository
git clone https://github.com/ajanraj/OpenChat.git
cd OpenChat
# Install dependencies (using Bun - recommended)
bun install
OS Chat uses Convex for real-time backend, authentication, and database management.
# Login to Convex (creates account if needed)
bunx convex login
# Set up a new Convex project (this creates .env.local with Convex URLs)
bunx convex dev --once
This will:
- Create a new Convex project in your dashboard
- Generate a
convex/
directory with your schema - Create a
.env.local
file with your Convex deployment URLs
Important: Convex creates .env.local
with deployment URLs. Don't overwrite it!
Instead, copy the example file to see what other variables you need:
# View the example to see what API keys you need
cat .env.example
# Add the additional variables to your existing .env.local
# (Don't copy over - this would delete your Convex URLs!)
Manually add these to your existing .env.local
file:
- AI model API keys (OpenAI, Google, Anthropic, xAI, etc.)
- Analytics keys (PostHog, Umami)
- Search provider keys (Exa)
- Other configuration from
.env.example
Configure the required and optional Convex environment variables for your application.
OS Chat uses Convex Auth for authentication with Google OAuth.
-
Initialize Convex Auth:
# Initialize Convex Auth setup bunx @convex-dev/auth
-
Set up Google OAuth:
- Follow the Google OAuth Setup Guide
- Set your Google OAuth credentials in Convex:
# Set Google OAuth credentials bunx convex env set AUTH_GOOGLE_ID your-google-client-id bunx convex env set AUTH_GOOGLE_SECRET your-google-client-secret
-
Set Required Environment Variables:
# Generate and set API key encryption secret in Convex (REQUIRED) bunx convex env set API_KEY_SECRET $(openssl rand -hex 64) # Set site URL for development bunx convex env set SITE_URL http://localhost:3000
OS Chat uses Cloudflare R2 for file attachments and image storage.
-
Create a Public Cloudflare R2 Bucket:
- Sign up for a Cloudflare account
- Navigate to R2 Object Storage in your dashboard
- Create a new bucket (e.g.,
oschat-files
) - Important: Configure the bucket for public access:
- Go to Settings > Public Access
- Enable "Allow public access"
- Set up a custom domain or use the R2.dev subdomain
- Configure CORS to allow GET and PUT requests from your domain
-
Generate R2 API Credentials:
- Go to R2 > Manage R2 API tokens
- Create a new API token with Object Read & Write permissions
- Save the Access Key ID and Secret Access Key
-
Set R2 Environment Variables in Convex:
# Required R2 configuration bunx convex env set R2_BUCKET your-bucket-name bunx convex env set R2_TOKEN your-r2-api-token bunx convex env set R2_ACCESS_KEY_ID your-access-key-id bunx convex env set R2_SECRET_ACCESS_KEY your-secret-access-key bunx convex env set R2_ENDPOINT https://your-account-id.r2.cloudflarestorage.com # Required: Public URL for serving files # Use your custom domain or R2.dev subdomain bunx convex env set R2_PUBLIC_URL_BASE https://your-bucket.your-domain.com/ # or # bunx convex env set R2_PUBLIC_URL_BASE https://pub-xxxxx.r2.dev/
# Set Polar environment variables (optional)
bunx convex env set POLAR_ORGANIZATION_TOKEN your-polar-organization-token
bunx convex env set POLAR_PREMIUM_PRODUCT_ID your-product-id
bunx convex env set POLAR_WEBHOOK_SECRET your-polar-webhook-secret
Reference Documentation:
- Convex Auth Setup Guide
- Google OAuth Configuration
- Cloudflare R2 Component
- Polar Component Documentation
Deploy your Convex schema and functions:
# Deploy to Convex (this pushes your functions and schema)
bunx convex deploy
# Or for development with hot reload
bunx convex dev
# Start the Next.js development server
bun dev
Visit http://localhost:3000 to see oschat running locally!
For production deployment:
-
Deploy Convex:
bunx convex deploy --prod
-
Deploy Frontend (Vercel recommended):
# Install Vercel CLI bun add -g vercel # Deploy to Vercel vercel --prod
-
Update Environment Variables:
- Add your production API keys to Vercel
- Update
SITE_URL
in Convex production dashboard to your production URL
Convex Connection Issues:
- Ensure you're logged into Convex:
bunx convex login
- Check your deployment URL in
.env.local
- Run
bunx convex dev
to sync functions
Authentication Issues:
- Verify OAuth credentials in Convex dashboard
- Check
SITE_URL
matches your development/production URL - Ensure Convex Auth is properly configured
API Key Issues:
- Verify API keys are correctly set in
.env.local
- Check API key permissions and quotas
File Upload Issues:
- Ensure R2 bucket is configured for public access
- Verify R2_PUBLIC_URL_BASE is set correctly with trailing slash
- Check CORS settings allow your domain
- Confirm all R2 environment variables are set in Convex
Need Help?
- Check the Convex Documentation
- Review the Convex Auth Setup Guide
- See Google OAuth Configuration for authentication
- Configure Cloudflare R2 for file storage
- Get an Exa API key for web search functionality
- Set up Polar payments for premium features
- Open an issue in this repository
We welcome contributions! OS Chat is built with modern web technologies and follows best practices for maintainability and performance.
- Fork the repository
- Follow the Getting Started guide above to set up your development environment
- Create your feature branch (
git checkout -b feature/amazing-feature
)
- Follow the existing code style and patterns
- Add tests for new features when applicable
- Update documentation for user-facing changes
- Ensure responsive design works across devices
- Test keyboard shortcuts and accessibility features
- Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request with a clear description of changes
- Stream resuming using Redis
- Performance optimizations
Current Status: Beta Release - OS Chat is actively developed with regular feature updates and improvements.
Compatibility: This codebase represents a significant evolution from earlier versions, with substantial architectural improvements and new features added throughout 2025.
Performance: Built for scale with real-time features, efficient data management, and optimized for both desktop and mobile experiences.
Privacy: All data is processed securely with user control over exports, imports, and data management.
This code is a heavily modified version of work by Julien Thibeaut, originally licensed under the Apache License 2.0. All significant changes, improvements, and new features were implemented by Ajan Raj in 2025.