{"id":31057253,"url":"https://github.com/qduc/chat","last_synced_at":"2026-05-16T13:07:51.336Z","repository":{"id":311606748,"uuid":"1040102752","full_name":"qduc/chat","owner":"qduc","description":"A simple AI chat frontend if you think OpenWebUI is too bloated","archived":false,"fork":false,"pushed_at":"2026-05-16T11:13:29.000Z","size":5314,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-16T12:39:00.504Z","etag":null,"topics":["agent","ai","chat","frontend","llm","openai"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qduc.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-08-18T13:11:18.000Z","updated_at":"2026-05-16T11:13:31.000Z","dependencies_parsed_at":"2026-02-03T20:04:44.958Z","dependency_job_id":null,"html_url":"https://github.com/qduc/chat","commit_stats":null,"previous_names":["qduc/chat"],"tags_count":97,"template":false,"template_full_name":null,"purl":"pkg:github/qduc/chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qduc%2Fchat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qduc%2Fchat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qduc%2Fchat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qduc%2Fchat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qduc","download_url":"https://codeload.github.com/qduc/chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qduc%2Fchat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33103992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","ai","chat","frontend","llm","openai"],"created_at":"2025-09-15T06:52:42.128Z","updated_at":"2026-05-16T13:07:51.292Z","avatar_url":"https://github.com/qduc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatForge\n\n\u003e A modern AI chat application with advanced tool orchestration and OpenAI-compatible API proxy\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Node.js](https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg)](https://nodejs.org)\n[![Docker](https://img.shields.io/badge/docker-ready-blue.svg)](https://www.docker.com)\n\nChatForge is a full-stack AI chat application featuring a Next.js 15 frontend and Node.js backend. It acts as an OpenAI-compatible API proxy with enhanced capabilities including conversation persistence, server-side tool orchestration, multi-provider support, model comparison mode, conversation forking, and cross-platform desktop app support.\n\n## Why ChatForge?\n\nWhile [OpenWebUI](https://github.com/open-webui/open-webui) and [LibreChat](https://github.com/danny-avila/LibreChat) are excellent options, ChatForge distinguishes itself through:\n\n| Feature | ChatForge | OpenWebUI | LibreChat |\n|---------|-----------|-----------|-----------|\n| **Architecture** | Node.js + SQLite (simple, single binary) | Python + complex stack | Node.js + MongoDB |\n| **Browser Automation** | ✅ Playwright with SPA support \u0026 specialized extractors | ❌ Basic fetch | ❌ Basic fetch |\n| **Model Comparison** | ✅ Side-by-side with judge/evaluation system | ❌ | ❌ |\n| **Conversation Forking** | ✅ Fork at any message | ❌ | ❌ |\n| **Cross-Conv Memory** | ✅ Built-in Journal tool | ❌ | ❌ |\n| **Prompt Caching** | ✅ Automatic cache breakpoints | ❌ | ❌ |\n| **Desktop App** | ✅ Native Electron with auto-login | ❌ | ❌ |\n| **Checkpoint Persistence** | ✅ Resume aborted streams | ❌ | ❌ |\n| **Usage Analytics** | ✅ Timing metrics \u0026 token insights | Limited | Limited |\n\nhttps://github.com/user-attachments/assets/ef24a533-4ceb-40ff-8d7b-27a88ac76bb1\n\n## Features\n\n### What Makes ChatForge Unique\n\n**🌐 Enhanced WebFetch with Playwright** — Unlike competitors' basic HTTP fetching, ChatForge uses real browser automation with specialized content extractors for Reddit, StackOverflow, and SPAs that block standard crawlers.\n\n**⚖️ Judge/Evaluation System** — Built-in automated model comparison with configurable judge models that provide numerical scores and reasoning for objective model evaluation.\n\n**🔀 True Model Comparison Mode** — Compare multiple models side-by-side with completely isolated conversation histories, not just message-by-message switching.\n\n**🍴 Conversation Forking** — Fork conversations at any message point to explore alternative paths without losing your original conversation thread.\n\n**📓 Journal Tool** — Persistent cross-conversation memory that allows AI to store and retrieve notes across different chat sessions.\n\n**💾 Prompt Caching Optimization** — Automatic cache breakpoint insertion (especially for Anthropic models) to reduce token costs and latency.\n\n**🔄 Streaming with Checkpoint Persistence** — Abort streaming responses anytime with automatic state preservation, allowing you to resume or branch from any point.\n\n**🖥️ Native Desktop App** — Cross-platform Electron app with auto-login and native packaging, not just a web wrapper.\n\n**⚡ Zero-Config Deployment** — Single Docker image with SQLite (no external database required) vs. complex MongoDB/PostgreSQL setups.\n\n### Core Capabilities\n- **🤖 Server-Side Tool Orchestration** - Unified tool calling with iterative workflows, thinking support, parallel execution, and intelligent error handling\n- **💬 Real-Time Streaming** - Server-Sent Events (SSE) with tool execution visibility and abort support\n- **💾 Conversation Persistence** - SQLite-backed storage with automatic retention cleanup and migration system\n- **🔌 Multi-Provider Support** - OpenAI-compatible interface with OpenAI, Anthropic, and Gemini providers\n- **🎨 Modern UI** - React 19 with markdown rendering, syntax highlighting, code wrapping, HTML preview, and responsive design\n- **🗂️ Prompt Management** - Built-in and custom system prompts with conversation-aware selection\n\n### Advanced Features\n- **🔀 Model Comparison Mode** - Side-by-side comparison of multiple models with isolated conversation histories\n- **⚖️ Judge/Evaluation System** - Automated model response evaluation with judge models providing scores and reasoning\n- **🍴 Conversation Forking** - Fork conversations at any message to explore alternative paths\n- **⚙️ Custom Request Parameters** - User-defined API parameters with multi-select support for advanced configuration\n- **⚡ Parallel Tool Execution** - Configurable concurrent tool execution for improved performance\n- **🌐 Enhanced WebFetch** - Playwright-based browser automation with SPA support and specialized extractors for Reddit, StackOverflow\n- **🔄 Streaming Control** - Abort streaming responses with automatic checkpoint persistence\n- **💾 Draft Persistence** - Automatic draft message saving across sessions\n- **🖥️ Desktop App** - Cross-platform Electron app with auto-login and native packaging\n- **🔗 Linked Conversations** - Support for conversation linking and retrieval in context\n- **📊 Usage Tracking** - Comprehensive timing metrics and token usage insights for performance optimization\n\n### Infrastructure \u0026 Security\n- **🐳 Docker Ready** - Development and production Docker configurations with hot reload support\n- **🔐 Authentication \u0026 User Management** - JWT-based authentication with registration, login, and refresh tokens\n- **👤 User-Scoped Multi-Tenancy** - Per-user provider configuration with isolated conversations and settings\n- **🔁 Retry Logic** - Exponential backoff for API calls with configurable retry strategy\n- **✅ Code Quality** - Husky pre-commit hooks enforce linting before commits\n- **🔔 Toast Notifications** - User-facing notifications for errors and success messages\n\n### AI Capabilities\n- **🖼️ Image Upload \u0026 Vision Support** - Multimodal vision support with drag-and-drop UI\n- **🎙️ Audio Upload Support** - Upload and send audio files for voice-enabled models\n- **📎 File Attachment Support** - Text file upload with content extraction\n- **🧠 Reasoning Controls** - Support for reasoning effort and extended thinking modes\n- **💾 Prompt Caching Optimization** - Automatic cache breakpoints to reduce token costs\n- **📓 Journal Tool** - Persistent memory tool for cross-conversation AI memory\n- **🎯 Model Caching** - Background refresh and batch fetching for optimal performance\n\n## Prerequisites\n\n- Node.js 18 or higher\n- Docker and Docker Compose (for containerized deployment)\n- An OpenAI (or compatible) API key that you'll enter through Settings → Providers \u0026 Tools\n\n## Quick Start\n\n### Option 1: One-Click Docker Hub Deployment (Recommended)\n\nPull pre-built images from Docker Hub - no cloning required:\n\n**With Docker Compose:**\n\nDownload it from this repository\n\n```bash\ncurl -O https://raw.githubusercontent.com/qduc/chat/main/docker-compose.yml\n```\n\nor create it manually\n\n```yml\nservices:\n  app:\n    image: qduc/chat:latest\n    environment:\n      - IMAGE_STORAGE_PATH=/data/images\n      - FILE_STORAGE_PATH=/data/files\n      - DB_URL=file:/data/prod.db\n    volumes:\n      - chatforge_data:/data\n      - chatforge_logs:/app/logs\n    ports:\n      - \"${PORT:-3000}:3000\"\n    restart: unless-stopped\n    healthcheck:\n      test: [\"CMD\", \"node\", \"-e\", \"fetch('http://127.0.0.1:3000/health').then(res =\u003e { if (res.ok) process.exit(0); process.exit(1); }).catch(() =\u003e process.exit(1));\"]\n      interval: 30s\n      timeout: 10s\n      start_period: 30s\n      retries: 3\n\nvolumes:\n  chatforge_data:\n    driver: local\n  chatforge_logs:\n    driver: local\n```\n\nThen run:\n\n```bash\n# Start the stack\ndocker compose up -d\n```\n\n**Or with Docker run (one-liner):**\n\n```bash\ndocker run -d --name chatforge -p 3000:3000 -v chatforge_data:/data -v chatforge_logs:/app/logs -e DB_URL=file:/data/prod.db qduc/chat:latest\n```\n\nVisit http://localhost:3000, register your first user, then open **Settings → Providers \u0026 Tools** to enter your API key and base URL.\n\nThe production compose file now runs a single `app` service built from the root multi-stage `Dockerfile`. That container bundles the Express API, the exported Next.js UI, and the static asset server, so there is no longer a separate frontend or nginx proxy to operate in production.\n\n**Optional infrastructure config** (add to `.env` file):\n```bash\nJWT_SECRET=your-secret-here        # Overrides auto-generated secret\nPORT=3000                          # External port (default: 3000)\n```\n\n### Option 2: Docker Development (with hot reload)\n\n```bash\n# Clone the repository\ngit clone https://github.com/qduc/chat.git \u0026\u0026 cd chat\n\n# Copy environment files\ncp backend/.env.example backend/.env\n# Edit backend/.env and set JWT_SECRET\n\n# Start with hot reload\n./dev.sh up --build\n\n# Follow logs\n./dev.sh logs -f\n```\n\nVisit http://localhost:3003. The development compose file still runs dedicated `frontend`, `backend`, and `proxy` containers to keep hot reload fast, but production images collapse into a single runtime service.\n\nFor alternative setup options, see [docs/INSTALLATION.md](docs/INSTALLATION.md).\n\n## Documentation\n\nQuick reference:\n\n- **[Installation Guide](docs/INSTALLATION.md)** - Setup instructions for local, Docker dev, and production\n- **[Development Guide](docs/DEVELOPMENT.md)** - Development scripts, testing, and workflow\n- **[Environment Variables](docs/ENVIRONMENT_VARIABLES.md)** - Complete configuration reference\n- **[Architecture](docs/ARCHITECTURE.md)** - Tech stack, components, and design principles\n- **[Tool Development](docs/TOOLS.md)** - Guide for adding new tools\n- **[API Specification](docs/backend_api_spec.md)** - Complete API endpoint documentation\n- **[Backend Code Flow](docs/backend_code_flow.md)** - Request handling and server architecture\n- **[Frontend Code Flow](docs/frontend_code_flow.md)** - UI state management and component architecture\n- **[Tool Orchestration](docs/tool_orchestration_deep_dive.md)** - Deep dive into the tool system\n- **[AI Agent Guide](AGENTS.md)** - Onboarding guide for AI assistants\n\n## Project Structure\n\n```\nchat/\n├── frontend/          # Next.js 15 + React 19 + TypeScript\n├── backend/           # Node.js + Express + SQLite\n├── electron/          # Electron desktop app packaging\n├── docs/              # Technical documentation\n├── proxy/             # Dev-only Nginx reverse proxy config\n├── integration/       # Integration tests\n├── requests/          # HTTP request examples\n├── dev.sh             # Development orchestration\n├── prod.sh            # Production management\n└── release.sh         # Release management\n```\n\n## Testing\n\n```bash\n./dev.sh test              # Run all tests\n./dev.sh test:backend      # Backend tests only\n./dev.sh test:frontend     # Frontend tests only\n```\n\n## Deployment Architecture\n\n- **Production (`docker-compose.yml`, `prod.sh`)** – Single `app` container generated by the top-level `Dockerfile`. The multi-stage build compiles the Next.js frontend to a static export and copies it into the Express backend, which serves both `/api` and the UI while persisting data/logs under `/data`.\n- **Development (`docker-compose.dev.yml`, `dev.sh`)** – Dedicated `frontend`, `backend`, `proxy`, and `adminer` services for fast iteration with hot reload. The nginx proxy that provides the http://localhost:3003 origin only exists in this dev stack.\n\n## Contributing\n\nContributions are welcome! Please follow these guidelines:\n\n1. Follow existing code patterns and conventions\n2. Write tests for new features\n3. Run linting: `./dev.sh exec backend npm run lint`\n4. Ensure all tests pass: `./dev.sh test`\n5. Update documentation as needed\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqduc%2Fchat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqduc%2Fchat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqduc%2Fchat/lists"}