An AI chat application built with SvelteKit that you can host anywhere that supports Node.js!
NOTE: This is in acitve development. Things will change fast.
- Anthropic: Claude Sonnet 4 with thinking mode
- Google: Gemini 2.0 Flash with search grounding and thinking capabilities
- OpenAI: GPT models with reasoning and o1 series support
- xAI: Grok models with reasoning effort control
- Real-time streaming responses
- Message editing and regeneration
- Chat branching and conversation trees
- Automatic chat title generation
- Pinned conversations
- Message retry with different models
- File management with storage
- Recent files tracking to easy reuse.
- If the model supports the file type you can upload it.
- AI-generated images
- Text-to-speech synthesis
- Audio file creation and playback
- Media creations gallery
- Responsive design with mobile support
- Dark/light mode switching
- Customizable model settings and options
- Speech synthesis with voice and speed controls
- Auto-scroll with manual override
- Keyboard shortcuts and accessibility features
- Secure authentication with Better Auth
- Session management
- User settings and preferences
- Account deletion and data management
- SvelteKit 2 - Full-stack web framework
- Svelte 5 - Reactive UI components
- TypeScript - Type-safe development
- Tailwind CSS 4 - Utility-first styling
- Bits UI - Accessible component primitives
- Shiki - Syntax highlighting for code blocks
- Node.js - Runtime environment
- Drizzle ORM - Type-safe database queries
- PostgreSQL - Primary database
- Redis - Caching and session storage
- MinIO - Object storage for files
- Better Auth - Authentication system
- AI SDK - Unified AI provider interface
- Streaming - Real-time response delivery
- Multiple Providers - Support for major AI services
- Node.js
- PostgreSQL database
- Redis server
- MinIO object storage (or S3-compatible storage)
- API keys for desired AI providers
- Clone the repository:
git clone <repository-url>
cd chat- Install dependencies:
pnpm install- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration- Set up the database:
pnpm db:migrate- Start the development server:
pnpm devConfigure the following environment variables in your .env file:
# Application Configuration
PUBLIC_BASE_URL=http://localhost:5173
BODY_SIZE_LIMIT=50M
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/chat
REDIS_URL=redis://localhost:6379
# Object Storage
S3_ENDPOINT=http://localhost:9000
S3_ACCESS_KEY=your-access-key
S3_SECRET_KEY=your-secret-key
S3_BUCKET=chat-files
# AI Provider API Keys
ANTHROPIC_API_KEY=your-anthropic-key
OPENAI_API_KEY=your-openai-key
GOOGLE_API_KEY=your-google-key
XAI_API_KEY=your-xai-key
# Authentication
AUTH_SECRET=your-auth-secret
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secretpnpm dev- Start development serverpnpm build- Build for productionpnpm preview- Preview production buildpnpm lint- Lint code with ESLint and Prettierpnpm check- Type check with Sveltepnpm format- Format code with Prettierpnpm flc- Run format, lint, and check togetherpnpm db:generate- Generate database migrationspnpm db:migrate- Run database migrationspnpm db:studio- Open Drizzle Studio
Build and run with Docker:
# Build the image
docker build -t chat .
# Run the container
docker run -p 3000:3000 --env-file .env chatThe application is designed to work with:
- App Platforms (Set GCP_BUILDPACKS=true to make adapter-auto build for Node)
- Google Cloud Platform (adapter-auto detects GCP)
- Vercel or other Node.js platforms supported by adapter-auto
- Self-hosted with Docker
Each AI provider supports specific options:
- Anthropic: Thinking mode for enhanced reasoning
- Google: Search grounding and thinking configuration
- OpenAI: Reasoning modes, image quality settings
- xAI: Reasoning effort levels
Configure MinIO or S3-compatible storage for file uploads and media generation. The application automatically handles file processing, storage, and serving.
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting:
pnpm flc - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.