aboutsummaryrefslogtreecommitdiff
path: root/notebooks/llm-stats.py
blob: cf5b9fcce76c1fd001e21fd044c60505a3e83045 (plain) (blame)
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

import marimo

__generated_with = "0.23.10"
app = marimo.App(width="full")


@app.cell
def _():
    import marimo as mo
    import pandas as pd
    import altair as alt

    return alt, mo, pd


@app.cell
def _(pd):
    # Data — add new models here.
    #   price: blended $/1M tokens
    # https://artificialanalysis.ai/leaderboards/models
    MODELS = [
        {
            "name": "DeepSeek V4 Flash",
            "aai_score": 37,
            "price": 0.08,
            "tok_per_sec": 101,
        },
        {
            "name": "DeepSeek V4 Pro",
            "aai_score": 44,
            "price": 0.18,
            "tok_per_sec": 85,
        },
        {
            "name": "Claude Opus 4.7",
            "aai_score": 54,
            "price": 3.85,
            "tok_per_sec": 51,
        },
        {
            "name": "Claude Opus 4.8",
            "aai_score": 56,
            "price": 3.85,
            "tok_per_sec": 58,
        },
        {
            "name": "Claude Sonnet 4.6",
            "aai_score": 47,
            "price": 2.31,
            "tok_per_sec": 50,
        },
        {
            "name": "Claude Haiku 4.5",
            "aai_score": 30,
            "price": 0.77,
            "tok_per_sec": 93,
        },
        {
            "name": "Gemini 3.5 Flash",
            "aai_score": 50,
            "price": 1.31,
            "tok_per_sec": 161,
        },
        {
            "name": "MiMo 2.5",
            "aai_score": 40,
            "price": 0.06,
            "tok_per_sec": 79,
        },
        {
            "name": "Nemotron 3 Ultra",
            "aai_score": 38,
            "price": 0.58,
            "tok_per_sec": 164,
        },
        {
            "name": "Gemma 4 E2B (local)",
            "aai_score": 9,
            "price": 0.0,
            "tok_per_sec": 60,
        },
        {
            "name": "GLM 5.2",
            "aai_score": 51,
            "price": 0.90,
            "tok_per_sec": 82
        }
    ]

    df = pd.DataFrame(MODELS)
    return MODELS, df


@app.cell
def _(MODELS, mo):
    mo.md(f"""
    # 🤖 LLM Stats Tracker

    **{len(MODELS)} models tracked** — edit the `MODELS` list above to add more.
    """)
    return


@app.cell
def _(alt, df):
    # Price vs Quality (colour = tok/sec)
    scatter = (
        alt.Chart(df)
        .mark_circle(size=200)
        .encode(
            x=alt.X("price", title="Blended Price $/1M"),
            y=alt.Y("aai_score", title="AAI Score"),
            color=alt.Color("tok_per_sec:Q", title="tok/sec", scale=alt.Scale(scheme="viridis")),
            tooltip=["name", "aai_score", "price", "tok_per_sec"],
        )
    )
    labels = (
        alt.Chart(df)
        .mark_text(dy=-12, fontSize=10)
        .encode(
            x="price",
            y="aai_score",
            text="name",
        )
    )
    chart_price_quality = (scatter + labels).properties(width="container")
    chart_price_quality
    return


@app.cell
def _(alt, df):
    # Speed vs Quality (colour = price)
    bubble = (
        alt.Chart(df)
        .mark_circle(size=120, opacity=0.7)
        .encode(
            x=alt.X("tok_per_sec:Q", title="Tokens/sec"),
            y=alt.Y("aai_score:Q", title="AAI Score"),
            color=alt.Color("price:Q", title="Price $/1M", scale=alt.Scale(scheme="viridis")),
            tooltip=["name", "aai_score", "price", "tok_per_sec"],
        )
    )
    bubble_labels = (
        alt.Chart(df)
        .mark_text(dy=-14, fontSize=10, fontWeight="bold")
        .encode(
            x="tok_per_sec:Q",
            y="aai_score:Q",
            text="name:N",
        )
    )
    chart_speed_quality = (bubble + bubble_labels).properties(width="container")
    chart_speed_quality
    return


if __name__ == "__main__":
    app.run()