How stu-ops/ollama_chat_application works
Project type and purpose
• This is a full-stack, containerized real-time chat application (“Ollama Chat App”) that integrates:
• A Streamlit-based frontend for the user interface
• A Flask + Socket.IO backend for asynchronous, multi-room messaging
• A local LLM inference service (Ollama running LLaMA 3.2) for AI-driven replies
• Docker Compose orchestration to bring up three services: frontend, backend, ollama
File structure
• Top level:
• .env.example, .gitignore, LICENSE, README.md
• docker-compose.yml – defines the three containers and their interconnections
• backend/:
• Dockerfile – builds the Flask + Socket.IO service
• app.py – Flask app exposing REST (health endpoints) and Socket.IO events for chat
• requirements.txt – Python dependencies: Flask, Flask-SocketIO, python-socketio, etc.
• frontend/:
• Dockerfile – builds the Streamlit service
• streamlit_app.py – UI code for username/room selection and chat input/display
• requirements.txt – Streamlit, python-socketio
README for additional insights
[Streamlit Frontend] ←→ [Flask + Socket.IO Backend] ←→ [Ollama LLM Container]
• Quick-start instructions and all URLs (8501 for UI, 5000 for backend API, 11434 for Ollama)
• Technology stack callouts (Python 3.9, Docker, Docker Compose)
• Notes on scaling (Redis, DB for chat history, load balancer, GPU)
Essential details
• Don’t omit the Docker Compose service definitions—show how environment variables (e.g., MODEL_NAME) tie into containers
• If extending for production, illustrate optional Redis, persistent storage, load balancer, GPU runtime