A powerful, fully client-side AI roleplay chat application with multi-LLM provider support and cross-platform capabilities.
100% client-side β ImaginChat runs entirely in your browser. There is no backend server. All data (characters, chats, personas, API keys, lorebooks, settings) is stored in your browser's
localStorage. Your API keys never leave your device β they are sent directly from your browser to the LLM provider.
- Gemini (Google) - Default provider with advanced features
- Deepseek - Cost-effective alternative with strong performance
- Grok (xAI) - X's AI model with unique capabilities
- Profile Management - Save multiple API keys and switch providers seamlessly
- Custom Models - Specify any model name for each provider
- Direct Roleplay - One-on-one conversations with AI characters
- Group Chats - Multiple characters in the same conversation
- Story Mode - AI-driven narrative generation
- Memory System - Automatic context extraction every 5 messages
- Streaming Responses - Real-time message generation
- Markdown Support - Rich text formatting in messages
- AI Character Generation - Gemini-powered profile creation
- Custom Characters - Manually create detailed character profiles
- Character Settings - Per-character AI parameters
- Multi-language Support - Characters can speak different languages
- Avatar Support - Custom images for characters
- Create Multiple Personas - Play as different characters across sessions
- View & Edit Personas - Full description view and inline editing
- Per-Session Persona - Each chat session remembers its persona
- Keyword-Triggered Lore - Inject world info when keywords appear in chat
- Logical Operators - AND, OR, NOT logic for keyword matching
- Recursive Scanning - Lore entries can trigger other entries (2 levels deep)
- Import/Export - SillyTavern V2 compatible format
- Always Active Entries - Inject lore regardless of keywords
- Structured Templates - Modular JSON-based prompt templates for roleplay and story modes
- Customizable Templates - Edit system prompts via the built-in Template Editor
- Prompt Library - Reusable prompt scripts with
{{scriptName}}injection - Global & Per-Character Overrides - Layer system prompts at different levels
- Fully Client-Side - No backend server, everything runs in the browser
- Web App - Run in any modern browser
- Android APK - Build native Android apps with Capacitor
- Local Storage - All data persists locally (characters, chats, settings, profiles)
- Node.js 18+
- npm or yarn
- (Optional) Android Studio for APK builds
# Clone the repository git clone <repository-url> cd ImaginChat # Install dependencies npm install # Run development server npm run devVisit http://localhost:3000 to use the app.
- Click the Settings icon (βοΈ) in the navigation bar
- Scroll to LLM Profiles section
- Click Add Profile to create a new provider profile:
- Profile Name: e.g., "My Deepseek"
- Provider: Select Gemini, Deepseek, or Grok
- API Key: Your API key from the provider
- Model Name: e.g.,
gemini-2.0-flash,deepseek-chat,grok-2
- Switch between profiles by clicking on them
- Gemini: https://ai.google.dev/
- Deepseek: https://platform.deepseek.com
- Grok: https://api.x.ai
# Build web assets npm run build # Sync to Android npx cap sync android # Open in Android Studio npx cap open androidIn Android Studio:
- Build β Build Bundle(s) / APK(s) β Build APK(s)
- Find APK in
android/app/build/outputs/apk/debug/
npm run android- System Prompts & Templates Guide β How the prompt template system works and how to customize AI behavior
- Lorebooks (World Info) Guide β How to create and manage keyword-triggered world lore
ImaginChat/ βββ services/ β βββ llm/ β β βββ types.ts # LLM provider interfaces β β βββ geminiProvider.ts # Gemini implementation β β βββ deepseekProvider.ts # Deepseek implementation β β βββ grokProvider.ts # Grok implementation β β βββ llmService.ts # Provider factory β βββ prompts/ β β βββ systemPromptBuilder.ts # Shared prompt assembly β β βββ promptTemplates.ts # Template loading & interpolation β β βββ templates/ # JSON prompt templates β β βββ roleplay.json β β βββ story.json β β βββ common.json β βββ lorebook/ β βββ lorebookEngine.ts # Keyword scanning & RAG logic β βββ lorebookService.ts # CRUD & import/export βββ components/ β βββ ChatInterface.tsx # Main chat UI β βββ CharacterForm.tsx # Character creation/editing β βββ PersonaManager.tsx # Persona view, edit, select β βββ LorebookManager.tsx # Lorebook CRUD UI β βββ PromptTemplateEditor.tsx # System template editor β βββ PromptLibrary.tsx # Reusable prompt scripts β βββ ... βββ docs/ β βββ guide-system-prompts.md # System prompt guide β βββ guide-lorebooks.md # Lorebook guide βββ App.tsx # Main app with LLM profile UI βββ types.ts # TypeScript types βββ capacitor.config.ts # Capacitor configuration βββ android/ # Generated Android project base: './'- Required for Capacitor- Environment variables for API keys
- App ID:
com.imaginai.chat - App Name: ImaginChat
- Web Dir:
dist
# Development server npm run dev # Build for production npm run build # Preview production build npm run preview # Sync Capacitor npm run cap:sync # Open Android Studio npm run cap:openImaginChat is fully client-side β there is no backend. All data is stored in browser localStorage:
- Characters and personas
- Chat sessions and messages
- LLM profiles (including API keys)
- Lorebooks and prompt templates
- Global settings and prompt scripts
Note: API keys are stored locally in your browser and sent directly to the LLM provider. They never pass through any intermediary server. This is acceptable for personal use but not recommended for production apps with sensitive credentials.
MIT
Contributions welcome! Please open an issue or PR.