{"id":31373906,"url":"https://github.com/dynstat/ollama-ai-chat-app","last_synced_at":"2026-04-05T21:01:48.545Z","repository":{"id":312022047,"uuid":"1045991031","full_name":"dynstat/Ollama-AI-chat-app","owner":"dynstat","description":"Simple container based chat app using locally running models using Ollama.","archived":false,"fork":false,"pushed_at":"2025-09-07T20:31:31.000Z","size":116,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-27T23:27:54.610Z","etag":null,"topics":["ai","chatbot","codegemma","containerization","docker","docker-compose","local","models","ollama","qwen","react","webapp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dynstat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-08-28T03:01:09.000Z","updated_at":"2025-09-07T20:31:35.000Z","dependencies_parsed_at":"2025-08-28T10:29:13.238Z","dependency_job_id":null,"html_url":"https://github.com/dynstat/Ollama-AI-chat-app","commit_stats":null,"previous_names":["dynstat/ollama-ai-chat-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dynstat/Ollama-AI-chat-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynstat%2FOllama-AI-chat-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynstat%2FOllama-AI-chat-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynstat%2FOllama-AI-chat-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynstat%2FOllama-AI-chat-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dynstat","download_url":"https://codeload.github.com/dynstat/Ollama-AI-chat-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dynstat%2FOllama-AI-chat-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31449836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T15:22:31.103Z","status":"ssl_error","status_checked_at":"2026-04-05T15:22:00.205Z","response_time":75,"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":["ai","chatbot","codegemma","containerization","docker","docker-compose","local","models","ollama","qwen","react","webapp"],"created_at":"2025-09-27T23:17:16.368Z","updated_at":"2026-04-05T21:01:48.540Z","avatar_url":"https://github.com/dynstat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ollama AI Chat App\n\nA simple real-time chat application that connects to Ollama AI models for intelligent conversations. Built with React frontend and Node.js backend, featuring concurrent request processing, syntax highlighting, and a beautiful user interface.\n\n## Screenshot:\n\u003cimg width=\"1876\" height=\"913\" alt=\"image\" src=\"https://github.com/user-attachments/assets/c1eda2f6-d46e-4d16-82ca-382104688941\" /\u003e\n\n\n## Features\n\n- **Real-time AI Chat**: Stream responses from Ollama AI models\n- **Concurrent Processing**: Handle multiple users simultaneously with request queuing\n- **Syntax Highlighting**: Beautiful code rendering with support for 20+ programming languages\n- **Conversation Management**: Save and manage multiple chat conversations\n- **Model Selection**: Switch between different Ollama models\n- **Responsive Design**: Modern UI that works on desktop and mobile\n- **Docker Support**: Easy deployment with Docker and Docker Compose\n- **Security**: Rate limiting, CORS protection, and security headers\n- **Health Monitoring**: Built-in health checks and metrics\n\n## Architecture\n\n- **Frontend**: React 19 + Vite with syntax highlighting and markdown rendering\n- **Backend**: Node.js + Express with concurrent request processing\n- **AI Integration**: Ollama API with connection pooling and request queuing\n- **Deployment**: Docker containers with Nginx reverse proxy\n\n## Prerequisites\n\n- [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/)\n- [Node.js](https://nodejs.org/) (for local development)\n- [Ollama](https://ollama.ai/) (for local AI model hosting)\n\n## 🚀 Quick Start\n\n### Option 1: Docker (Recommended)\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/dynstat/Ollama-AI-chat-app.git\n   cd Ollama-AI-chat-app\n   ```\n\n2. **Start the application**\n   ```bash\n   # Production mode\n   docker-compose up --build\n   \n   # Development mode (with hot reload)\n   ./dev-start.bat  # Windows\n   # OR\n   docker-compose -f docker-compose.dev.yml up --build  # Linux/Mac\n   ```\n\n3. **Access the application**\n   - Frontend: http://localhost:8080 (production) or http://localhost:5173 (development)\n   - Backend API: http://localhost:3001\n\n### Option 2: Local Development\n\n1. **Backend Setup**\n   ```bash\n   cd backend\n   npm install\n   npm start\n   ```\n\n2. **Frontend Setup**\n   ```bash\n   cd frontend\n   npm install\n   npm run dev\n   ```\n\n## ⚙️ Configuration\n\n### Environment Variables\n\nCreate a `.env` file in the root directory or set environment variables:\n\n```bash\n# Ollama Configuration\nOLLAMA_HOST=https://Your-Ollama-server-URL/  # Your Ollama server URL\nOLLAMA_MODEL=qwen3:1.7b                   # Default model to use\n\n# Security (Optional)\nAPI_KEY=your-secret-api-key               # API key for public exposure\nALLOWED_ORIGINS=http://localhost:3000     # CORS allowed origins\n\n# Server Configuration\nPORT=3001                                 # Backend server port\n```\n\n### Supported Models\n\nThe application supports these Ollama models:\n- `qwen3:1.7b` (default)\n- `qwen3:8b`\n- `qwen2:1.5b`\n- `codegemma:2b`\n- `codegemma:7b`\n- `deepseek-r1:7b`\n- `gpt-oss:20b`\n\n### Ollama Server Setup\n\n1. **Install Ollama**: Follow the [official installation guide](https://ollama.ai/download)\n\n2. **Pull a model**:\n   ```bash\n   ollama pull qwen3:1.7b\n   ```\n\n3. **Start Ollama server**:\n   ```bash\n   ollama serve\n   ```\n\n## 🔧 Advanced Configuration\n\n### Concurrent Processing\n\nThe application supports concurrent request processing. Configure in `backend/config.js`:\n\n```javascript\n// Request queue configuration\nexport const QUEUE_CONFIG = {\n  maxConcurrent: 4,        // Maximum concurrent requests\n  timeout: 300000,         // Request timeout (5 minutes)\n  retryAttempts: 2,        // Number of retry attempts\n  retryDelay: 1000,        // Delay between retries (ms)\n};\n```\n\n## Usage\n\n1. **Start a Conversation**: Click \"New Chat\" to begin\n2. **Select Model**: Choose from available Ollama models\n3. **Send Messages**: Type your message and press Enter\n4. **View Responses**: AI responses stream in real-time with syntax highlighting\n5. **Manage Chats**: Save, rename, or delete conversations\n6. **Code Support**: Send code snippets for analysis and explanation\n\n## 🔍 API Endpoints\n\n- `GET /health` - Health check\n- `POST /api/chat` - Send chat message\n- `GET /api/queue-status` - Get request queue status\n- `GET /metrics` - Prometheus metrics (if enabled)\n\n## 🛠️ Development\n\n### Project Structure\n\n```\nOllama-AI-chat-app/\n├── backend/                 # Node.js API server\n│   ├── server.mjs          # Main server file\n│   ├── config.js           # Configuration\n│   └── package.json        # Backend dependencies\n├── frontend/               # React application\n│   ├── src/\n│   │   ├── App.jsx         # Main application component\n│   │   └── components/     # React components\n│   └── package.json        # Frontend dependencies\n├── docker-compose.yml      # Production Docker setup\n├── docker-compose.dev.yml  # Development Docker setup\n└── dev-start.bat          # Windows development script\n```\n\n### Development Commands\n\n```bash\n# Backend development\ncd backend\nnpm install\nnpm start\n\n# Frontend development\ncd frontend\nnpm install\nnpm run dev\nnpm run build\nnpm run lint\n\n# Docker development\ndocker-compose -f docker-compose.dev.yml up --build\n```\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Ollama Connection Error**\n   - Ensure Ollama server is running\n   - Check `OLLAMA_HOST` environment variable\n   - Verify network connectivity\n\n2. **Docker Build Issues**\n   - Clear Docker cache: `docker system prune -a`\n   - Rebuild without cache: `docker-compose build --no-cache`\n\n3. **Port Conflicts**\n   - Change ports in `docker-compose.yml`\n   - Check if ports 3001, 5173, or 8080 are in use\n\n4. **Memory Issues**\n   - Increase Docker memory allocation\n   - Use smaller models for development\n\n### Health Checks\n\n- Backend health: `curl http://localhost:3001/health`\n- Frontend: Open http://localhost:8080 in browser\n- Queue status: `curl http://localhost:3001/api/queue-status`\n\n## 📊 Performance\n\n- **Concurrent Requests**: Up to 4 simultaneous users\n- **Response Time**: Depends on Ollama model and server performance\n- **Memory Usage**: ~512MB-2GB depending on model size\n- **Connection Pooling**: Up to 50 concurrent connections\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## 📄 License\n\nThis project is licensed under the ISC License.\n\n## 🙏 Acknowledgments\n\n- [Ollama](https://ollama.ai/) for the AI model hosting\n- [React](https://reactjs.org/) for the frontend framework\n- [Express](https://expressjs.com/) for the backend framework\n- [Highlight.js](https://highlightjs.org/) for syntax highlighting\n- [Marked](https://marked.js.org/) for markdown rendering\n\n## 📞 Support\n\nFor issues and questions:\n- Check the [troubleshooting section](#troubleshooting)\n- Review the [concurrent processing documentation](CONCURRENT_PROCESSING.md)\n- Open an issue on GitHub\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynstat%2Follama-ai-chat-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdynstat%2Follama-ai-chat-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynstat%2Follama-ai-chat-app/lists"}