Skip to content

Every AI model, one blazing fast workspace - see how they think, schedule what you need

License

Notifications You must be signed in to change notification settings

ajanraj/OpenChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OS Chat

Visit OS Chat

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.

OS Chat β€” Open-source AI chat app (oschat.ai)

πŸš€ Why OS Chat?

  • πŸ”“ 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

✨ Features

⏰ Background Agents & Automation

  • 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

πŸ”— Service Connectors & Integrations

  • 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

πŸ€– AI & Models

  • 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

πŸ’¬ Chat Management

  • 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

🎨 Interface & Experience

  • 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

βš™οΈ Customization & Settings

  • 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

πŸ’³ Premium Features

  • 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

πŸ€– Available Models

OS Chat supports 40+ AI models across multiple providers:

πŸ’¬ Text & Chat Models

  • 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

🎨 Image Generation

  • OpenAI: GPT Image 1
  • Google: Imagen 4, Imagen 4 Ultra
  • Fal: Flux Schnell

πŸ› οΈ Built with

πŸ—ΊοΈ Roadmap

  • 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.

πŸš€ Recent Updates

  • 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

πŸš€ Getting Started

Prerequisites

  • Node.js 18+ or Bun (recommended)
  • Git
  • A Convex account (free tier available)
  • API keys for the AI models you want to use

1. Clone and Install

# Clone the repository
git clone https://github.com/ajanraj/OpenChat.git
cd OpenChat

# Install dependencies (using Bun - recommended)
bun install

2. Set up Convex Backend

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

3. Configure Environment Variables

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

4. Set up Convex Configuration

Configure the required and optional Convex environment variables for your application.

A. Authentication (Required)

OS Chat uses Convex Auth for authentication with Google OAuth.

  1. Initialize Convex Auth:

    # Initialize Convex Auth setup
    bunx @convex-dev/auth
  2. Set up Google OAuth:

    # 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
  3. 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

B. Cloudflare R2 Storage (Required for file uploads)

OS Chat uses Cloudflare R2 for file attachments and image storage.

  1. 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
  2. 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
  3. 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/

C. Polar Payments (Optional)

# 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:

5. Deploy Convex Functions

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

6. Run the Development Server

# Start the Next.js development server
bun dev

Visit http://localhost:3000 to see oschat running locally!

7. Production Deployment

For production deployment:

  1. Deploy Convex:

    bunx convex deploy --prod
  2. Deploy Frontend (Vercel recommended):

    # Install Vercel CLI
    bun add -g vercel
    
    # Deploy to Vercel
    vercel --prod
  3. Update Environment Variables:

    • Add your production API keys to Vercel
    • Update SITE_URL in Convex production dashboard to your production URL

Troubleshooting

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?

🀝 Contributing

We welcome contributions! OS Chat is built with modern web technologies and follows best practices for maintainability and performance.

Setup for Contributors

  1. Fork the repository
  2. Follow the Getting Started guide above to set up your development environment
  3. Create your feature branch (git checkout -b feature/amazing-feature)

Development Guidelines

  • 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

Submitting Changes

  1. Commit your changes (git commit -m 'Add some amazing feature')
  2. Push to the branch (git push origin feature/amazing-feature)
  3. Open a Pull Request with a clear description of changes

Areas I'd Love Help With

  • Stream resuming using Redis
  • Performance optimizations

⚠️ Notes

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.

About

Every AI model, one blazing fast workspace - see how they think, schedule what you need

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages