Free AI chat with OAuth login - no API keys needed! Use premium models or add your own keys for enterprise mode.
- π Zero Setup: Login with Google/GitHub and start chatting immediately
- π Free AI Chat: Rotating free providers (no API keys required)
- π Enterprise Mode: Optional - add your own API keys for premium models
- π° Cost Optimization: Intelligent caching reduces API costs by up to 80%
- π§ Semantic Caching: Exact match + semantic similarity caching
- π Analytics: Real-time usage statistics and cache insights
- π₯οΈ CLI Tool: Command-line interface available via NPM
- π Multi-Provider: OpenAI, Anthropic, Google, Perplexity, and free providers
- π¨ Modern UI: Responsive Next.js interface with dark mode
- Framework: Next.js 14 with TypeScript and App Router
- Database: Supabase (PostgreSQL with pgvector for semantic search)
- Authentication: Supabase Auth (OAuth + Email)
- Deployment: Vercel
- CLI: Node.js with Commander (published to NPM as
cachegpt-cli)
- Visit https://cachegpt.app
- Click "Login" and authenticate with Google/GitHub
- Start chatting for free!
# Install globally from NPM
npm install -g cachegpt-cli
# Login (opens browser for OAuth)
cachegpt login
# Start chatting
cachegpt chat
# View all commands
cachegpt --help- Node.js 18+
- Yarn (recommended) or npm
- Supabase account
- API keys for LLM providers (OpenAI, Anthropic, etc.)
- Clone the repository:
git clone https://github.com/Fender1992/cachegpt.git
cd cachegpt- Install dependencies:
yarn install
# Optional: Install CLI dependencies
cd cli && yarn install && cd ..- Set up environment variables:
cp .env.example .env
# Edit .env with your Supabase and API key configurationRequired environment variables:
NEXT_PUBLIC_SUPABASE_URL- Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY- Supabase anonymous keySUPABASE_SERVICE_ROLE_KEY- Supabase service role key (server-side only)OPENAI_API_KEY- OpenAI API key for server-side model rotationANTHROPIC_API_KEY- Anthropic API key for Claude modelsJWT_SECRET- Secret for JWT token signing
- Set up the database:
Run the migration scripts in database-scripts/ directory in your Supabase SQL editor, in order:
-- Run each file in numeric order:
-- 001_initial_schema.sql
-- 002_cache_tables.sql
-- ...through to the latest migrationOr use the migration script:
node scripts/apply-db-migration.js- Run the development server:
yarn devVisit http://localhost:3000 to see your app!
cd cli
yarn build # Compile TypeScript
yarn link # Test locally before publishingcachegpt/
βββ app/ # Next.js App Router
β βββ api/ # API routes (Next.js serverless)
β βββ chat/ # Chat interface
β βββ login/ # Authentication pages
β βββ admin/ # Admin dashboard
β βββ settings/ # User settings (API key management)
βββ components/ # React components
βββ lib/ # Shared utilities
β βββ supabase-client.ts # Supabase client
β βββ cache-lifecycle.ts # Cache management
β βββ llm-client.ts # LLM provider abstraction
βββ cli/ # CLI tool source
β βββ src/
β β βββ commands/ # CLI command implementations
β β βββ lib/ # CLI utilities
β βββ package.json # Published to NPM as cachegpt-cli
βββ database-scripts/ # SQL migrations
βββ hooks/ # React hooks
βββ middleware/ # Next.js middleware
cachegpt login # OAuth login (opens browser)
cachegpt chat # Start interactive chat
cachegpt status # Check authentication status
cachegpt api-keys add # Add your own API keys (enterprise)
cachegpt api-keys view # View configured keys
cachegpt api-keys test # Test API key connections
cachegpt models # List available models
cachegpt logout # Logout from account
cachegpt --version # Show version- Fork this repository
- Connect to Vercel
- Add environment variables in Vercel dashboard (see
.env.example) - Deploy!
Required for production:
NEXT_PUBLIC_SUPABASE_URL=https://your-project.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
OPENAI_API_KEY=sk-proj-...
ANTHROPIC_API_KEY=sk-ant-...
JWT_SECRET=your_secure_random_string
CRON_SECRET=your_cron_secret- Lifecycle Management: Automatic cache expiration based on age and usage
- Semantic Search: Uses pgvector for finding similar queries
- Context-Aware: Invalidates cache when enrichment context changes
- Query Classification: Different TTLs for static vs time-sensitive queries
- OAuth Flow: Google and GitHub login via Supabase Auth
- Email Authentication: 6-digit code verification
- Keyless by Default: No API keys needed for standard users
- Enterprise Mode: Optional personal API key management
Users can add their own API keys via:
- Web UI:
/settingspage - CLI:
cachegpt api-keys add
Supported providers:
- OpenAI (GPT-4, GPT-3.5)
- Anthropic (Claude 3.5 Sonnet, Opus, Haiku)
- Google (Gemini Pro)
- Perplexity
Migrations are in database-scripts/ directory. Run them in numeric order.
Key migrations:
030_rbac_system.sql- Role-based access control031_cache_lifecycle_metadata.sql- Cache lifecycle management032_bug_tracker_system.sql- Bug tracking and feedback
Pull requests are welcome! For major changes, please open an issue first.
- Create a feature branch
- Make your changes
- Test locally with
yarn dev - Update STATUS_2025_09_24.md with your changes
- Submit a pull request
For detailed implementation notes, see:
STATUS_2025_09_24.md- Current system state and recent changesCLAUDE.md- Instructions for Claude Code assistant
MIT
- GitHub Issues: https://github.com/Fender1992/cachegpt/issues
- Production App: https://cachegpt.app