High-Level Architecture
Relevant source files
The following files were used as context for generating this wiki page:
The Eval-Platform provides a framework for evaluating large language models and AI agents. It uses a containerized microservices approach to manage data storage, backend logic, and user interface components.
The platform coordinates between a web-based frontend, a RESTful API backend, and persistent storage layers. It enables users to configure evaluation parameters, execute tests, and visualize results through a unified interface.
System Components
The platform consists of four primary services orchestrated via containerization. Each service handles a specific domain of the evaluation lifecycle.
| Service | Technology | Description |
|---|---|---|
| Frontend | React/Next.js | Provides the user interface for managing evaluations and viewing metrics. |
| Backend | FastAPI (Python) | Processes evaluation logic, manages the API, and communicates with the database. |
| Database | PostgreSQL | Stores persistent data including user profiles, evaluation results, and configurations. |
| Cache/Queue | Redis | Handles task queuing and temporary data storage for asynchronous processing. |
Sources: docker-compose.yml:4-45, frontend/package.json:1-15, backend/app/main.py:1-10
Service Orchestration
The system uses Docker Compose to manage service dependencies and networking. The backend service depends on both the database and the cache being healthy before initialization.
The diagram illustrates the request flow from the client through the application layers to the storage engines.
Sources: docker-compose.yml:5-20
Backend API Structure
The backend is built with FastAPI and follows a modular structure for configuration and routing. It utilizes a settings object to manage environment-specific variables such as database connection strings and security keys.
Core Configuration
The Settings class in backend/app/core/config.py validates environment variables using Pydantic. This ensures that the application has all necessary credentials for PostgreSQL and Redis before starting the server.
API Routing
The main entry point initializes the FastAPI application and includes routers for different functional modules. It also configures Cross-Origin Resource Sharing (CORS) to allow the frontend service to communicate with the API.
# backend/app/main.py
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.core.config import settings
app = FastAPI(title=settings.PROJECT_NAME)
app.add_middleware(
CORSMiddleware,
allow_origins=[str(origin) for origin in settings.BACKEND_CORS_ORIGINS],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
Sources: backend/app/main.py:1-25, backend/app/core/config.py:5-40
Data Flow and Persistence
Data flows from the frontend to the backend via JSON-encoded HTTP requests. The backend validates these requests using Pydantic models before performing CRUD operations on the PostgreSQL database.
The sequence diagram shows the asynchronous pattern used for long-running evaluation tasks.
Sources: backend/app/main.py:15-30, docker-compose.yml:25-35
Summary
The Eval-Platform architecture prioritizes modularity and scalability through containerized services. By separating the React-based frontend from the FastAPI backend, the system allows for independent scaling and development of the UI and the core evaluation logic. Persistent storage in PostgreSQL and task management via Redis ensure reliability during intensive model evaluation processes.