How betagouv/comparia works
Main Components
a. Frontend Layer:
• Custom Gradio Components (customchatbot, customradiocard, frinput)
• Templates (HTML/Svelte components)
• Static Assets (DSFR design system)
b. Backend Layer:
• FastAPI Application (main.py)
• Controller Layer (controller.py)
• Languia Core Module
• API Provider
• Block Arena
• Conversation Handler
• Theme Management
c. External Services:
• LLM API Services (multiple providers)
• Database (for storing conversations and reactions)
Component Relationships
User Interface
• ↓↑
Frontend Components (Gradio)
• ↓↑
FastAPI Application
• ↓↑
Languia Core
• ↓↑
External LLM APIs
• ↓↑
Database Storage
Specific Implementation Details
a. Frontend Components:
• Custom Chat Interface (customchatbot)
• Radio Card Selection (customradiocard)
• French Input Component (frinput)
• DSFR Design System Integration
b. Backend Services:
• FastAPI Routes
• Conversation Management
• Model Selection & Comparison
• Response Processing
• Analytics & Logging
c. Data Flow:
• User Question Input
• Parallel LLM API Calls
• Response Aggregation
• User Feedback Collection
• Analytics Storage
Additional Elements
• Authentication Flow
• Error Handling Paths
• Monitoring Points
• Scaling Components
The theme management system
Use standardized symbols:
• Rectangles for services
• Double lines for API boundaries
This system design should reflect the project's focus on comparing LLM responses while maintaining a user-friendly, government-standard compliant interface through the DSFR design system.