-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Description
The UI currently receives raw benchmark data from the backend and processes it client-side. This processing should be moved to the backend to keep the UI simpler and more maintainable.
Current Behavior
load_206_models()in app.py:1600-1624 fetches raw benchmark data fromGET /api/v1/benchmarks- Returns the full dataset as a pandas DataFrame
- UI then processes this data for:
- Displaying a searchable model catalog in the About tab (app.py:2769-2792)
- Showing model count in spinner messages (app.py:4762)
Problems with Current Approach
- UI coupled to data schema - if benchmark CSV columns change, UI code breaks
- Duplicate logic risk - multiple UI components extracting similar info leads to inconsistency
- Harder to test - data transformations in UI are harder to unit test than backend code
- Larger payloads - full benchmark data transferred when UI only needs a subset
- UI complexity - UI handles parsing, filtering, and error cases that belong in backend
Proposed Fix
Move data processing to the backend:
-
Create purpose-specific backend endpoints that return only what the UI needs:
- Model catalog endpoint (e.g.,
GET /api/v1/model-catalog) - returns model names and display metadata - Model count endpoint or include count in existing responses
- Model catalog endpoint (e.g.,
-
Update UI to consume these endpoints directly without DataFrame processing
-
Remove
load_206_models()and related DataFrame handling from UI
Benefits
- Simpler UI - just renders what it receives, no data transformation logic
- Single source of truth - data processing logic lives in one place (backend)
- Decoupled from schema - backend can adapt to data source changes without UI updates
- Smaller payloads - transfer only what's needed for each view
- Easier testing - backend transformations can be unit tested independently
Files Affected
ui/app.py- Removeload_206_models()and DataFrame processingbackend/src/api/routes.py- Add new endpoint(s) for processed data
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels