How kazars24/large-language-sommelier works
Main Components
a) Client Layer:
• Telegram Bot (from app.py)
• REST API Clients
b) API Layer:
• FastAPI Service (src/api/main.py)
• Recommendation Service (src/api/services.py)
c) Core Components:
• RAG Engine (src/retriever/)
• Model Management (src/utils/loaders.py)
• Configuration Management (src/core/config.py)
d) External Services:
• LLM Backends (Ollama, GigaChat)
• Embedding Model (multilingual-e5-small)
e) Validation Framework:
• Testing Framework (validation/core/)
• Metrics Collection (validation/core/metrics.py)
• Validation UI (validation/ui/app.py)
[Client Layer]
• ↓
[API Layer]
• ↓
[Core Components]
• ↓
[External Services]
Component Relationships
• Data flow between components
• Dependencies between modules
• API calls to external services
Detailed Component Breakdown
RAG Pipeline (central focus):
[Document Splitter] → [Semantic Retriever] → [LLM Integration] → [Response Generation]
Specific Elements
a) Configuration Flow:
[Environment Variables] → [Config Module] → [Component Configuration]
b) Model Management:
[Model Loader] → [Model Server Selection] → [LLM Backend]
Technical Details
• FastAPI endpoints
• Telegram Bot integration
• RAG component interaction
• Database connections (if any)
• External API connections
Validation Framework Integration
How the validation framework:
• Connects to the main system
• Collects metrics
• Provides feedback through the UI
• Integrates with Langfuse
• The retrieval augmentation process
• Multiple model backend support
• API and bot interfaces
• Validation and testing capabilities