How surendiran2003/local-rag-llm works
Main Components
• Ollama Service: This component provides an environment to pull and run LLM models locally. It is configured with its own docker-compose.yml (in the ollama directory) and manages GPU/CPU resource settings, volume mapping (for model downloads), and network connectivity (via the “genai-network” Docker bridge).
• GenAI RAG Application: This is the core application (located in the “app” directory) where the Python app (app.py) handles PDF uploads, semantic retrieval, prompt augmentation, and LLM answer generation. It also includes its own Dockerfile, requirements, and docker-compose configuration to deploy this service.
• (Possibly) OpenWebUI: Based on the README, there is a reference to a UI running on a specified port (e.g., “http://localhost:3000/”) which appears to offer additional interactions like admin login and chatting with the local LLM. Although there is no dedicated source code directory for it, this UI is an integral user-facing piece.
Relationships & Interactions
• Both the ollama service and the RAG app run on Docker and share a common Docker network (“genai-network”), which facilitates container-to-container communications.
• The GenAI RAG app likely interacts with the ollama service by sending requests (via API calls or docker interactions) to perform tasks such as model inference or embedding generation for the uploaded documents.
• The UI component (OpenWebUI) serves as an entry point for user interaction: one UI endpoint for chatting with the LLM and another (the app) providing file upload and query processing for RAG functionality.
• Volumes are used (at least in ollama) to map a local directory for model downloads which is important for managing large LLM files.
Architectural Patterns & Technologies
• Containerization: Both major components use Docker, so depicting container boundaries clearly is important.
• Microservice/Modular Architecture: The design separates responsibilities into distinct services (LLM service vs. retrieval & generation app).
• Communication over a dedicated Docker bridge network ensures secure and isolated interactions.
• Technologies include Python (for the RAG app), Docker & docker-compose (for deployment and service orchestration), and potentially GPU resource management for accelerated LLM computations.
Clarity & Detail
• Each component should have a clear label. For example: “Ollama Service – LLM Model Management” and “GenAI RAG App – Document Query & Answer Generation.”