-
-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathmise.toml
More file actions
216 lines (189 loc) · 8.03 KB
/
Copy pathmise.toml
File metadata and controls
216 lines (189 loc) · 8.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
[tasks.check]
description = "Run cargo check"
run = "cargo check"
[tasks.build]
description = "Build the project"
run = "cargo build"
[tasks.build-release]
description = "Build release binary"
run = "cargo build --release"
[tasks.fmt]
description = "Format code with rustfmt"
run = "cargo fmt"
[tasks.fmt-check]
description = "Check code formatting"
run = "cargo fmt --check"
[tasks.clippy]
description = "Run clippy lints"
run = "cargo clippy --all-features -- -D warnings"
[tasks.test]
description = "Run tests"
run = "cargo test --all-features"
[tasks.run]
description = "Run the TUI application"
run = "cargo run"
[tasks.refresh-benchmarks]
description = "Fetch latest benchmark data from Artificial Analysis API"
run = """
#!/usr/bin/env bash
set -euo pipefail
if [ ! -f .env ]; then
echo "Error: .env file not found. Create one with AA_API_KEY=your_key"
exit 1
fi
source .env
if [ -z "${AA_API_KEY:-}" ]; then
echo "Error: AA_API_KEY not set in .env"
exit 1
fi
echo "Fetching from Artificial Analysis API..."
xh GET https://artificialanalysis.ai/api/v2/data/llms/models X-API-Key:"$AA_API_KEY" \
| jq '[.data[] | {
id: .id,
name: .name,
slug: .slug,
creator: (.model_creator?.slug // null),
creator_id: (.model_creator?.id // null),
creator_name: (.model_creator?.name // null),
release_date: .release_date,
intelligence_index: (.evaluations?.artificial_analysis_intelligence_index // null),
coding_index: (.evaluations?.artificial_analysis_coding_index // null),
math_index: (.evaluations?.artificial_analysis_math_index // null),
mmlu_pro: (.evaluations?.mmlu_pro // null),
gpqa: (.evaluations?.gpqa // null),
hle: (.evaluations?.hle // null),
livecodebench: (.evaluations?.livecodebench // null),
scicode: (.evaluations?.scicode // null),
ifbench: (.evaluations?.ifbench // null),
lcr: (.evaluations?.lcr // null),
terminalbench_hard: (.evaluations?.terminalbench_hard // null),
tau2: (.evaluations?.tau2 // null),
math_500: (.evaluations?.math_500 // null),
aime: (.evaluations?.aime // null),
aime_25: (.evaluations?.aime_25 // null),
output_tps: (.median_output_tokens_per_second | if . == 0 then null else . end),
ttft: (.median_time_to_first_token_seconds | if . == 0 then null else . end),
ttfat: (.median_time_to_first_answer_token | if . == 0 then null else . end),
price_input: (.pricing?.price_1m_input_tokens // null),
price_output: (.pricing?.price_1m_output_tokens // null),
price_blended: (.pricing?.price_1m_blended_3_to_1 // null)
}]' > data/benchmarks.json
echo "Updated data/benchmarks.json ($(jq length data/benchmarks.json) entries)"
"""
[tasks.refresh-sources]
description = "Fetch AA/Arena/Epoch/LLM Stats data and regenerate all v2 source files"
run = """
#!/usr/bin/env bash
set -euo pipefail
if [ ! -f .env ]; then
echo "Error: .env file not found. Create one with AA_API_KEY=... and LLM_STATS_API_KEY=..."
exit 1
fi
source .env
if [ -z "${AA_API_KEY:-}" ]; then
echo "Error: AA_API_KEY not set in .env"
exit 1
fi
if [ -z "${LLM_STATS_API_KEY:-}" ]; then
echo "Error: LLM_STATS_API_KEY not set in .env"
exit 1
fi
raw=$(mktemp)
work=$(mktemp -d)
trap 'rm -f "$raw"; rm -rf "$work"' EXIT
echo "Fetching from Artificial Analysis API..."
xh GET https://artificialanalysis.ai/api/v2/data/llms/models X-API-Key:"$AA_API_KEY" > "$raw"
# Legacy lane (frozen): byte-identical jq contract with refresh-benchmarks.
jq '[.data[] | {
id: .id,
name: .name,
slug: .slug,
creator: (.model_creator?.slug // null),
creator_id: (.model_creator?.id // null),
creator_name: (.model_creator?.name // null),
release_date: .release_date,
intelligence_index: (.evaluations?.artificial_analysis_intelligence_index // null),
coding_index: (.evaluations?.artificial_analysis_coding_index // null),
math_index: (.evaluations?.artificial_analysis_math_index // null),
mmlu_pro: (.evaluations?.mmlu_pro // null),
gpqa: (.evaluations?.gpqa // null),
hle: (.evaluations?.hle // null),
livecodebench: (.evaluations?.livecodebench // null),
scicode: (.evaluations?.scicode // null),
ifbench: (.evaluations?.ifbench // null),
lcr: (.evaluations?.lcr // null),
terminalbench_hard: (.evaluations?.terminalbench_hard // null),
tau2: (.evaluations?.tau2 // null),
math_500: (.evaluations?.math_500 // null),
aime: (.evaluations?.aime // null),
aime_25: (.evaluations?.aime_25 // null),
output_tps: (.median_output_tokens_per_second | if . == 0 then null else . end),
ttft: (.median_time_to_first_token_seconds | if . == 0 then null else . end),
ttfat: (.median_time_to_first_answer_token | if . == 0 then null else . end),
price_input: (.pricing?.price_1m_input_tokens // null),
price_output: (.pricing?.price_1m_output_tokens // null),
price_blended: (.pricing?.price_1m_blended_3_to_1 // null)
}]' "$raw" > data/benchmarks.json
mkdir -p data/v2
cargo run --features pipeline --bin transform -- aa "$raw" -o data/v2/aa.json
# --- Arena: latest.json -> snapshot dir -> 6 board JSONs --------------------
echo "Fetching Arena leaderboard snapshot..."
arena_repo="https://raw.githubusercontent.com/oolong-tea-2026/arena-ai-leaderboards/main"
snapshot=$(curl -sf "$arena_repo/data/latest.json" | jq -r '.path // .date // empty')
if [ -z "$snapshot" ]; then
echo "Error: could not resolve Arena snapshot pointer from latest.json"
exit 1
fi
mkdir -p "$work/arena_boards"
for board in text vision code agent search document; do
curl -sf "$arena_repo/data/$snapshot/$board.json" -o "$work/arena_boards/$board.json" \
|| echo "warning: Arena board $board missing in snapshot $snapshot"
done
cargo run --features pipeline --bin transform -- arena "$work/arena_boards" -o data/v2/arena.json
# --- Epoch: download ZIP -> unzip -> transform -----------------------------
echo "Fetching Epoch AI benchmark ZIP..."
curl -sf "https://epoch.ai/data/benchmark_data.zip" -o "$work/epoch.zip"
unzip -q -o "$work/epoch.zip" -d "$work/epoch_csv"
epoch_dir="$work/epoch_csv"
if [ -z "$(find "$epoch_dir" -maxdepth 1 -name '*.csv' -print -quit)" ]; then
epoch_dir=$(dirname "$(find "$work/epoch_csv" -name '*.csv' -print -quit)")
fi
cargo run --features pipeline --bin transform -- epoch "$epoch_dir" -o data/v2/epoch.json
# --- LLM Stats: bounded paged fetch (key sourced, never echoed) ------------
echo "Fetching LLM Stats rankings + models..."
ls_base="https://api.llm-stats.com/stats/v1"
ls_auth="Authorization: Bearer $LLM_STATS_API_KEY"
: > "$work/ls_rankings_parts.json"
for cat in agents code finance frontend_development general healthcare legal math multimodal reasoning vision; do
curl -sf -H "$ls_auth" "$ls_base/rankings?category=$cat&limit=50" >> "$work/ls_rankings_parts.json"
echo >> "$work/ls_rankings_parts.json"
done
jq -s '{ rankings: . }' "$work/ls_rankings_parts.json" > "$work/ls_rankings.json"
: > "$work/ls_models_parts.json"
cursor=""
page=0
while [ "$page" -lt 10 ]; do
if [ -z "$cursor" ]; then
resp=$(curl -sf -H "$ls_auth" "$ls_base/models?limit=50")
else
resp=$(curl -sf -H "$ls_auth" "$ls_base/models?limit=50&cursor=$cursor")
fi
echo "$resp" | jq -c '.models[]?' >> "$work/ls_models_parts.json"
cursor=$(echo "$resp" | jq -r '.next_cursor // empty')
page=$((page + 1))
[ -z "$cursor" ] && break
done
jq -s '{ models: . }' "$work/ls_models_parts.json" > "$work/ls_models.json"
cargo run --features pipeline --bin transform -- \
llmstats "$work/ls_rankings.json" --models "$work/ls_models.json" -o data/v2/llmstats.json
echo "Updated data/benchmarks.json ($(jq length data/benchmarks.json) entries)"
echo "Updated data/v2/aa.json ($(jq '.models | length' data/v2/aa.json) models)"
echo "Updated data/v2/arena.json ($(jq '.models | length' data/v2/arena.json) models)"
echo "Updated data/v2/epoch.json ($(jq '.models | length' data/v2/epoch.json) models)"
echo "Updated data/v2/llmstats.json ($(jq '.models | length' data/v2/llmstats.json) models)"
"""
[tasks.snapshot-stats]
description = "Snapshot daily jsDelivr CDN hits per data file into data/stats/jsdelivr-history.json (app-launch proxy)"
run = "bash scripts/snapshot-stats.sh"
[tools]
xh = "latest"