Skip to content

Commit f7b91ec

Browse files
committed
2 parents a7290e4 + bb3a791 commit f7b91ec

19 files changed

Lines changed: 216 additions & 168 deletions

‎.gemini /config.yaml‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Referred to SkyRL
2+
have_fun: true # the bot sometimes adds lighthearted / fun comments.
3+
code_review:
4+
disable: false
5+
comment_severity_threshold: MEDIUM
6+
max_review_comments: -1
7+
pull_request_opened:
8+
help: false
9+
summary: false # enable PR summaries
10+
code_review: false
11+
ignore_patterns: []

‎.github/workflows/precommit.yml‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: pre-commit
2+
on: [push, pull_request]
3+
jobs:
4+
pre-commit:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: actions/setup-python@v5
9+
with:
10+
python-version: "3.x"
11+
- run: pip install pre-commit
12+
- run: pre-commit run --all-files

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
.env.development.local
1818
.env.test.local
1919
.env.production.local
20+
.venv*/*
2021

2122
npm-debug.log*
2223
yarn-debug.log*

‎.pre-commit-config.yaml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
repos:
2+
# --- Basic hygiene ---
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v5.0.0
5+
hooks:
6+
- id: trailing-whitespace
7+
exclude: '\\.svg$'
8+
exclude_types: [svg]
9+
- id: end-of-file-fixer
10+
exclude: '\\.svg$'
11+
exclude_types: [svg]
12+
- id: check-json
13+
- id: check-yaml
14+
- id: check-added-large-files
15+
args: ["--maxkb=2048"]
16+
- id: check-merge-conflict
17+
- id: check-case-conflict
18+
- id: detect-private-key
19+
- id: mixed-line-ending
20+
21+
# --- JS/HTML formatting and linting ---
22+
- repo: https://github.com/pre-commit/mirrors-prettier
23+
rev: v4.0.0-alpha.8
24+
hooks:
25+
- id: prettier
26+
args: [--check]
27+
additional_dependencies: [prettier@3.2.5]
28+
files: '\\.(js|jsx|ts|tsx|json|css|scss|md|markdown|yml|yaml|html)$'
29+
30+
# --- Optional: spell check or link check ---
31+
- repo: https://github.com/codespell-project/codespell
32+
rev: v2.2.6
33+
hooks:
34+
- id: codespell
35+
args: ["--ignore-words-list=teh,fo"]
36+
exclude: '^package-lock\.json$'

‎README.md‎

Lines changed: 36 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
21
# Project Overview
32

4-
RouterArena is the first open platform enabling comprehensive evaluation and comparison of LLM routers. The platform features:
5-
6-
- **Principled Dataset**: 8,400 queries across 9 domains and 44 categories using Dewey Decimal Classification and Bloom's taxonomy
7-
- **Multi-Dimensional Metrics**: Arena Score, Cost Ratio, Optimality, Latency, and Robustness evaluation
8-
- **Automated Framework**: Support for both academic and commercial routers with real-time leaderboard updates
9-
- **Fair Comparison**: Unified evaluation protocol for transparent and reproducible results
3+
RouterArena is the first open platform enabling comprehensive evaluation and comparison of LLM routers. Check out the [website](https://routeworks.github.io) for more details.
104

115
## Research Team
126

@@ -20,42 +14,7 @@ RouterArena is the first open platform enabling comprehensive evaluation and com
2014
- Hongyi Liu (hl87@rice.edu)
2115
- Jiarong Xing (jxing@rice.edu)
2216

23-
## Website Features
24-
25-
### 🏠 Home Page
26-
- Project overview and key features
27-
- Dataset statistics and difficulty levels
28-
- Contact information and collaboration details
29-
- Interactive leaderboard preview
30-
31-
### 🏆 Leaderboard Page
32-
- Comprehensive router rankings across multiple metrics
33-
- Search and filter functionality
34-
- Detailed performance metrics for each router
35-
- Links to papers and source code
36-
37-
### 📝 Submit Page
38-
- Router submission form for evaluation
39-
- Clear guidelines for academic and commercial routers
40-
- Evaluation process explanation
41-
- Contact information for collaboration
42-
43-
### ℹ️ About Page
44-
- Detailed project methodology
45-
- Research team information
46-
- Citation information
47-
- Contact and collaboration details
48-
49-
## Technology Stack
50-
51-
- **Frontend**: React 19.2.0 with TypeScript
52-
- **Routing**: React Router DOM 6.8.1
53-
- **Icons**: Lucide React 0.263.1
54-
- **Charts**: Recharts 2.8.0
55-
- **Styling**: CSS3 with modern features
56-
- **Build Tool**: Create React App
57-
58-
## Getting Started
17+
## For Developers
5918

6019
### Prerequisites
6120

@@ -90,7 +49,37 @@ npm run build
9049

9150
This builds the app for production to the `build` folder.
9251

93-
## Project Structure
52+
### Coding/PR Style Check
53+
54+
We use pre-commit to ensure a consistent coding style. You can set it up by
55+
56+
```
57+
pip install pre-commit
58+
pre-commit install
59+
```
60+
61+
Before pushing your code, please run the following check and make sure your code passes all checks.
62+
63+
```
64+
pre-commit run --all-files
65+
```
66+
67+
We have set up Google Gemini to review your code. You can use it by running the following command:
68+
69+
```
70+
/gemini review
71+
```
72+
73+
### Web Stack
74+
75+
- **Frontend**: React 19.2.0 with TypeScript
76+
- **Routing**: React Router DOM 6.8.1
77+
- **Icons**: Lucide React 0.263.1
78+
- **Charts**: Recharts 2.8.0
79+
- **Styling**: CSS3 with modern features
80+
- **Build Tool**: Create React App
81+
82+
### Project Structure
9483

9584
```
9685
src/
@@ -114,8 +103,6 @@ src/
114103
└── index.tsx # Application entry point
115104
```
116105

117-
## Key Components
118-
119106
### Router Data Structure
120107
```typescript
121108
interface Router {
@@ -137,14 +124,6 @@ interface Router {
137124
}
138125
```
139126

140-
### Evaluation Metrics
141-
142-
1. **Arena Score**: Overall performance combining accuracy and cost efficiency
143-
2. **Cost Ratio Score**: Efficiency in cost optimization relative to optimal routing
144-
3. **Optimality Score**: Frequency of selecting the most efficient model for each query
145-
4. **Latency Score**: Router overhead and response time performance
146-
5. **Robustness Score**: Stability against query perturbations and noise
147-
148127
## Contributing
149128

150129
We welcome contributions to the RouterArena platform! Please see our submission guidelines on the website or contact us directly.
@@ -155,7 +134,7 @@ If you use RouterArena in your research, please cite our paper:
155134

156135
```bibtex
157136
@misc{lu2024routerarena,
158-
title={RouterArena: An Open Platform for Comprehensive Comparison of LLM Routers},
137+
title={RouterArena: An Open Platform for Comprehensive Comparison of LLM Routers},
159138
author={Yifan Lu and Rixin Liu and Jiayi Yuan and Xingqi Cui and Shenrun Zhang and Hongyi Liu and Jiarong Xing},
160139
year={2024},
161140
eprint={2510.00202},
@@ -167,9 +146,9 @@ If you use RouterArena in your research, please cite our paper:
167146

168147
## Contact
169148

170-
- **Email**: yifan.lu@rice.edu
149+
- **Email**: yifan.lu@rice.edu, jxing@rice.edu
171150
- **Paper**: https://www.arxiv.org/abs/2510.00202
172151

173152
## Acknowledgments
174153

175-
We thank all contributors who have made this project possible.
154+
We thank all contributors who have made this project possible.

‎src/App.css‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ code {
9191
.container {
9292
padding: 0 0.75rem;
9393
}
94-
94+
9595
.btn {
9696
padding: 0.625rem 1.25rem;
9797
font-size: 0.9rem;
9898
}
99-
}
99+
}

‎src/components/DatasetCompositionChart.tsx‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const categoryColors = [
8888
// Difficulty level colors
8989
const difficultyColors = {
9090
'Easy': '#22C55E',
91-
'Medium': '#F59E0B',
91+
'Medium': '#F59E0B',
9292
'Hard': '#EF4444'
9393
};
9494

@@ -166,7 +166,7 @@ const DatasetCompositionChart: React.FC = () => {
166166
const CustomTooltip = ({ active, payload }: any) => {
167167
if (active && payload && payload.length) {
168168
const data = payload[0].payload;
169-
169+
170170
// Get subcategory descriptions
171171
const getSubcategoryDescription = (name: string, parent: string) => {
172172
const descriptions: { [key: string]: { [key: string]: string } } = {
@@ -217,10 +217,10 @@ const DatasetCompositionChart: React.FC = () => {
217217
'Biography and genealogy': 'Personal histories & lineages'
218218
}
219219
};
220-
220+
221221
return descriptions[parent]?.[name] || name;
222222
};
223-
223+
224224
return (
225225
<div className="chart-tooltip">
226226
<p className="tooltip-title">{data.name}</p>
@@ -257,19 +257,19 @@ const DatasetCompositionChart: React.FC = () => {
257257
onMouseLeave={() => setHoveredSubcategory(null)}
258258
>
259259
{subcategoryData.map((entry, index) => (
260-
<Cell
261-
key={`subcell-${index}`}
260+
<Cell
261+
key={`subcell-${index}`}
262262
fill={entry.color}
263263
stroke={hoveredSubcategory === entry.name ? '#d1d5db' : '#fff'}
264264
strokeWidth={hoveredSubcategory === entry.name ? 2 : 1}
265-
style={{
265+
style={{
266266
filter: hoveredSubcategory === entry.name ? 'brightness(1.1) saturate(1.1)' : 'none',
267267
transition: 'all 0.2s ease'
268268
}}
269269
/>
270270
))}
271271
</Pie>
272-
272+
273273
{/* Outer ring - Main categories */}
274274
<Pie
275275
data={mainChartData}
@@ -286,27 +286,27 @@ const DatasetCompositionChart: React.FC = () => {
286286
onMouseLeave={() => setHoveredCategory(null)}
287287
>
288288
{mainChartData.map((entry, index) => (
289-
<Cell
290-
key={`cell-${index}`}
289+
<Cell
290+
key={`cell-${index}`}
291291
fill={entry.color}
292292
stroke={hoveredCategory === entry.category ? '#9ca3af' : '#fff'}
293293
strokeWidth={hoveredCategory === entry.category ? 2 : 1}
294-
style={{
294+
style={{
295295
filter: hoveredCategory === entry.category ? 'brightness(1.12) saturate(1.15)' : 'none',
296296
transition: 'all 0.2s ease'
297297
}}
298298
/>
299299
))}
300300
</Pie>
301-
<Tooltip
302-
content={<CustomTooltip />}
301+
<Tooltip
302+
content={<CustomTooltip />}
303303
wrapperStyle={{ zIndex: 9999 }}
304304
/>
305305
</PieChart>
306306
</ResponsiveContainer>
307-
307+
308308
{/* Independent SVG Labels Overlay */}
309-
<svg
309+
<svg
310310
className="labels-svg-overlay"
311311
style={{
312312
position: 'absolute',
@@ -322,15 +322,15 @@ const DatasetCompositionChart: React.FC = () => {
322322
{mainChartData.map((entry, index) => {
323323
const totalValue = mainChartData.reduce((sum, item) => sum + item.value, 0);
324324
let cumulativeValue = 0;
325-
325+
326326
for (let i = 0; i < index; i++) {
327327
cumulativeValue += mainChartData[i].value;
328328
}
329-
329+
330330
const startAngle = (cumulativeValue / totalValue) * 360 - 90;
331331
const endAngle = ((cumulativeValue + entry.value) / totalValue) * 360 - 90;
332332
const midAngle = (startAngle + endAngle) / 2;
333-
333+
334334
const RADIAN = Math.PI / 180;
335335
// Adaptive label radius: farther for sides, closer for top/bottom
336336
const baseOffset = 60; // baseline distance beyond pie edge
@@ -345,7 +345,7 @@ const DatasetCompositionChart: React.FC = () => {
345345
const centerY = 400; // Exact center of 800x800 viewBox
346346
const x = centerX - radius * Math.sin(midAngle * RADIAN);
347347
const y = centerY - radius * Math.cos(midAngle * RADIAN);
348-
348+
349349
// Create shortened versions of category names
350350
const getShortName = (name: string) => {
351351
const shortNames: { [key: string]: string } = {
@@ -361,9 +361,9 @@ const DatasetCompositionChart: React.FC = () => {
361361
};
362362
return shortNames[name] || name;
363363
};
364-
364+
365365
const shortName = getShortName(entry.name);
366-
366+
367367
return (
368368
<g key={index}>
369369
<rect

‎src/components/DeferralCurve.css‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,13 @@
8989
min-width: auto;
9090
justify-content: center;
9191
}
92-
92+
9393
.legend-section h4 {
9494
text-align: center;
9595
}
96-
96+
9797
.legend-items {
9898
display: grid;
9999
grid-template-columns: repeat(2, 1fr);
100100
}
101101
}
102-

0 commit comments

Comments
 (0)