llmtop 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +259 -2
  3. package/bin/llmtop.mjs +101 -0
  4. package/dashboard/dist/apple-touch-icon.png +0 -0
  5. package/dashboard/dist/assets/index-BVbAwMVB.js +9 -0
  6. package/dashboard/dist/assets/index-Cp7Swcz5.css +1 -0
  7. package/dashboard/dist/assets/llmtop-lockup-DtFPJmhv.svg +1 -0
  8. package/dashboard/dist/assets/llmtop-lockup-reversed-D9OmQIVU.svg +1 -0
  9. package/dashboard/dist/favicon.ico +0 -0
  10. package/dashboard/dist/favicon.svg +1 -0
  11. package/dashboard/dist/index.html +19 -0
  12. package/dashboard/dist/llmtop-mark-192.png +0 -0
  13. package/dashboard/dist/llmtop-mark-512.png +0 -0
  14. package/dashboard/dist/site.webmanifest +11 -0
  15. package/dashboard/src/App.tsx +213 -0
  16. package/dashboard/src/controls/DateRange.tsx +108 -0
  17. package/dashboard/src/controls/Disclosure.tsx +15 -0
  18. package/dashboard/src/controls/Search.tsx +18 -0
  19. package/dashboard/src/controls/Select.tsx +48 -0
  20. package/dashboard/src/controls/popover.tsx +31 -0
  21. package/dashboard/src/dash.ts +23 -0
  22. package/dashboard/src/extra.test.ts +9 -0
  23. package/dashboard/src/extra.ts +16 -0
  24. package/dashboard/src/format.ts +29 -0
  25. package/dashboard/src/i18n.tsx +52 -0
  26. package/dashboard/src/index.ts +7 -0
  27. package/dashboard/src/main.tsx +7 -0
  28. package/dashboard/src/model.test.ts +110 -0
  29. package/dashboard/src/model.ts +255 -0
  30. package/dashboard/src/state.test.ts +48 -0
  31. package/dashboard/src/state.ts +61 -0
  32. package/dashboard/src/styles.css +401 -0
  33. package/dashboard/src/tip.ts +51 -0
  34. package/dashboard/src/treemap.test.ts +23 -0
  35. package/dashboard/src/treemap.ts +30 -0
  36. package/dashboard/src/ui.tsx +327 -0
  37. package/dashboard/src/views/Activity.tsx +177 -0
  38. package/dashboard/src/views/Context.tsx +183 -0
  39. package/dashboard/src/views/Models.tsx +155 -0
  40. package/dashboard/src/views/Overview.tsx +83 -0
  41. package/dashboard/src/views/Projects.tsx +116 -0
  42. package/dashboard/src/views/Sessions.tsx +54 -0
  43. package/dashboard/src/views/Subagents.tsx +102 -0
  44. package/docs/brand/README.md +91 -0
  45. package/docs/brand/brand.json +67 -0
  46. package/docs/brand/favicon.ico +0 -0
  47. package/docs/brand/png/apple-touch-icon.png +0 -0
  48. package/docs/brand/png/favicon-16.png +0 -0
  49. package/docs/brand/png/favicon-32.png +0 -0
  50. package/docs/brand/png/favicon-48.png +0 -0
  51. package/docs/brand/png/llmtop-lockup-reversed@2x.png +0 -0
  52. package/docs/brand/png/llmtop-lockup@2x.png +0 -0
  53. package/docs/brand/png/llmtop-mark-1024.png +0 -0
  54. package/docs/brand/png/llmtop-mark-192.png +0 -0
  55. package/docs/brand/png/llmtop-mark-512.png +0 -0
  56. package/docs/brand/png/llmtop-wordmark@2x.png +0 -0
  57. package/docs/brand/source/build_brand.py +173 -0
  58. package/docs/brand/svg/favicon.svg +1 -0
  59. package/docs/brand/svg/llmtop-glyph.svg +1 -0
  60. package/docs/brand/svg/llmtop-lockup-reversed.svg +1 -0
  61. package/docs/brand/svg/llmtop-lockup.svg +1 -0
  62. package/docs/brand/svg/llmtop-mark-light.svg +1 -0
  63. package/docs/brand/svg/llmtop-mark.svg +1 -0
  64. package/docs/brand/svg/llmtop-wordmark-reversed.svg +1 -0
  65. package/docs/brand/svg/llmtop-wordmark.svg +1 -0
  66. package/llmtop.config.example.json +10 -0
  67. package/package.json +71 -4
  68. package/prices.md +27 -0
  69. package/src/api.mjs +53 -0
  70. package/src/archive.mjs +142 -0
  71. package/src/config.mjs +55 -0
  72. package/src/context.mjs +151 -0
  73. package/src/dashboard.mjs +61 -0
  74. package/src/db.mjs +102 -0
  75. package/src/derive.mjs +346 -0
  76. package/src/effort.mjs +18 -0
  77. package/src/format.mjs +19 -0
  78. package/src/paths.mjs +82 -0
  79. package/src/prices-command.mjs +25 -0
  80. package/src/prices.mjs +146 -0
  81. package/src/providers/agy.mjs +438 -0
  82. package/src/providers/claude.mjs +274 -0
  83. package/src/providers/codex.mjs +589 -0
  84. package/src/providers/index.mjs +25 -0
  85. package/src/rebuilds.mjs +85 -0
  86. package/src/scan.mjs +214 -0
  87. package/src/serve.mjs +44 -0
  88. package/src/show.mjs +20 -0
  89. package/src/usage-command.mjs +110 -0
  90. package/src/usage.mjs +388 -0
  91. package/src/zone.mjs +15 -0
@@ -0,0 +1,102 @@
1
+ import { useDash } from "../dash.ts";
2
+ import { mainLevel, totals, type Fact } from "../model.ts";
3
+ import { Empty, Legend, Mix, Stats, tip, type TipRow } from "../ui.tsx";
4
+
5
+ // The subagent story: how much of each model's output subagents wrote, which models each parent model's subagents
6
+ // ran on, the subagent types, and the effort they ran at, which is often not the parent's.
7
+ export function Subagents({ F }: { F: Fact[] }) {
8
+ const { M, filter, t, L, f } = useDash();
9
+ const all = totals(M, F);
10
+ const per = M.models.map((n, m) => {
11
+ const x = F.filter((y) => y.m === m), sub = x.reduce((a, y) => a + (y.sub ? y.o : 0), 0);
12
+ return { n, m, tt: totals(M, x), sub };
13
+ }).filter((r) => r.tt.q);
14
+ if (!per.length) return <section className="card"><Empty /></section>;
15
+ const sess = new Set(F.map((x) => x.s)), subs = M.subagents.filter((a) => sess.has(a.s) && (filter.model < 0 || a.m === filter.model));
16
+ const routes = M.models.map((n, p) => ({ n, p, row: M.models.map((_, m) => subs.filter((a) => a.parent === p && a.m === m).length) })).filter((r) => r.row.some(Boolean));
17
+ const types = M.types.map((n, k) => {
18
+ const list = subs.filter((a) => a.type === k), mix = M.models.map(() => 0);
19
+ list.forEach((a) => mix[a.m]++);
20
+ return { n, count: list.length, mix, o: list.reduce((x, a) => x + a.o, 0) };
21
+ }).filter((r) => r.count).sort((a, b) => b.count - a.count);
22
+ const subOut = per.reduce((n, r) => n + r.sub, 0);
23
+ const subModelIdx = new Set(subs.flatMap((a) => [a.m, a.parent]).filter((m) => m >= 0));
24
+ const models = M.models.map((n, i) => ({ n, c: M.mColor(i) })).filter((_, i) => subModelIdx.has(i));
25
+ // Requests by effort level, per model the subagents ran on.
26
+ const SF = F.filter((x) => x.sub), subLv = M.levels.filter((e) => SF.some((x) => x.e === e));
27
+ // How often a subagent ran on another model than the one that spawned it, and what subagents cost.
28
+ const moved = subs.filter((a) => a.m !== a.parent).length, subCost = SF.reduce((n, x) => n + x.c, 0);
29
+ // Subagent requests against the level the session's main thread ran most; levels past max have no order.
30
+ let lo = 0, hi = 0, same = 0;
31
+ for (const x of SF) {
32
+ const r = M.sessions[x.s].runs, p = r.length ? mainLevel(r) : -1;
33
+ if (p < 0 || p > 4 || x.e > 4) continue;
34
+ if (x.e < p) lo += x.q; else if (x.e > p) hi += x.q; else same += x.q;
35
+ }
36
+ const ranked = lo + hi + same;
37
+ const subEff = M.models.map((n, m) => ({ n, m, c: subLv.map((e) => SF.reduce((a, x) => a + (x.m === m && x.e === e ? x.q : 0), 0)) })).filter((r) => r.c.some(Boolean));
38
+ return (
39
+ <div className="stack">
40
+ <div className="grid half">
41
+ <section className="card">
42
+ <header><h2>{t("mainVsSub")}</h2><span className="hint">{t("out")}</span></header>
43
+ <ul className="legend"><li><i className="c0" />{t("mainThread")}<b>{f.pct(1 - subOut / (all.o || 1))}</b></li><li><i className="csub" />{t("subs")}<b>{f.pct(subOut / (all.o || 1))}</b></li></ul>
44
+ <div className="rows total">{per.map((r) => {
45
+ const main = r.tt.o - r.sub, w = (v: number) => `${(v / (r.tt.o || 1)) * 100}%`;
46
+ return [
47
+ <span key={`n${r.m}`} className="n">{r.n}</span>,
48
+ <span key={`b${r.m}`} className="split" style={{ margin: 0 }}>
49
+ {main ? <i className="c0" style={{ width: w(main) }} data-tip={tip(r.n, [["c0", t("mainThread"), f.cmp(main)]])}>{main / r.tt.o >= 0.14 ? f.pct(main / r.tt.o) : ""}</i> : null}
50
+ {r.sub ? <i className="csub" style={{ width: w(r.sub) }} data-tip={tip(r.n, [["csub", t("subs"), f.cmp(r.sub)]])}>{r.sub / r.tt.o >= 0.14 ? f.pct(r.sub / r.tt.o) : ""}</i> : null}
51
+ </span>,
52
+ <span key={`o${r.m}`} className="num">{f.cmp(r.tt.o)}</span>,
53
+ ];
54
+ })}</div>
55
+ </section>
56
+ <section className="card">
57
+ <header><h2>{t("routedTitle")}</h2><span className="hint">{f.int(subs.length)} {t("subs").toLowerCase()}</span></header>
58
+ {subs.length ? <Stats items={[
59
+ { label: t("otherModel"), value: f.pct(moved / subs.length), meter: [moved / subs.length, "csub"], sub: t("ofSubagents") },
60
+ { label: t("subCost"), value: f.pct(subCost / (all.c || 1)), meter: [subCost / (all.c || 1), "csub"], sub: L.ofAllCost(f.usd(subCost)) },
61
+ ]} /> : null}
62
+ <Legend groups={models} metric="sess" />
63
+ {routes.length ? <div className="rows">{routes.map((r) => {
64
+ const sum = r.row.reduce((a, b) => a + b, 0);
65
+ return [
66
+ <span key={`n${r.p}`} className="n">{r.n}</span>,
67
+ <span key={`b${r.p}`} className="split" style={{ margin: 0 }}>{r.row.map((v, m) => (v ? <i key={m} className={M.mColor(m)} style={{ width: `${(v / sum) * 100}%` }} data-tip={tip(L.spawnedOn(r.n, M.models[m]), [[M.mColor(m), t("subs"), f.int(v)]])}>{v / sum >= 0.1 ? f.int(v) : ""}</i> : null))}</span>,
68
+ ];
69
+ })}</div> : <Empty />}
70
+ </section>
71
+ </div>
72
+ <div className="grid half">
73
+ <section className="card">
74
+ <header><h2>{t("subTypes")}</h2><Legend groups={models} metric="sess" style={{ margin: 0 }} /></header>
75
+ {types.length ? <div className="scroll"><table>
76
+ <thead><tr><th>{t("subs")}</th><th className="num">{t("count")}</th><th>{t("ranOn")}</th><th className="num">{t("out")}</th></tr></thead>
77
+ <tbody>{types.map((r) => (
78
+ <tr key={r.n}><th className="name">{r.n}</th><td className="num">{r.count}</td><td><Mix arr={r.mix} className="mix wide" style={{ width: 160, marginTop: 6 }} tip={tip(r.n, r.mix.map((v, m): TipRow => [M.mColor(m), M.models[m], `${f.int(v)} · ${f.pct(v / (r.count || 1))}`]).filter((_, m) => r.mix[m]))} /></td><td className="num">{f.cmp(r.o)}</td></tr>
79
+ ))}</tbody>
80
+ </table></div> : <Empty />}
81
+ </section>
82
+ <section className="card">
83
+ <header><h2>{t("subEffort")}</h2><span className="hint">{t("requests").toLowerCase()}</span></header>
84
+ {ranked ? <Stats items={[
85
+ { label: t("belowMain"), value: f.pct(lo / ranked), meter: [lo / ranked, "v1"], sub: t("ofSubReq") },
86
+ { label: t("aboveMain"), value: f.pct(hi / ranked), meter: [hi / ranked, "v3"], sub: t("ofSubReq") },
87
+ ]} /> : null}
88
+ {subEff.length ? <>
89
+ <Legend groups={subLv.map((e) => ({ n: M.efforts[e], c: "v" + e }))} metric="sess" />
90
+ <div className="rows">{subEff.map((r) => {
91
+ const sum = r.c.reduce((a, b) => a + b, 0);
92
+ return [
93
+ <span key={`n${r.m}`} className="n">{r.n}</span>,
94
+ <span key={`b${r.m}`} className="split" style={{ margin: 0 }}>{r.c.map((v, k) => (v ? <i key={k} className={`v${subLv[k]}`} style={{ width: `${(v / sum) * 100}%` }} data-tip={tip(r.n + " · " + M.efforts[subLv[k]], [["v" + subLv[k], t("requests"), f.int(v) + " · " + f.pct(v / sum)]])}>{v / sum >= 0.12 ? f.pct(v / sum) : ""}</i> : null))}</span>,
95
+ ];
96
+ })}</div>
97
+ </> : <Empty />}
98
+ </section>
99
+ </div>
100
+ </div>
101
+ );
102
+ }
@@ -0,0 +1,91 @@
1
+ # llmtop — logo kit (Direction D: donut "o")
2
+
3
+ llmtop is a statistics tool for LLM usage (Claude, Codex, Antigravity, local models, and more).
4
+ In the logo, the "o" of the wordmark is drawn as a donut chart: usage shared across providers. The mark is the same donut on a rounded tile.
5
+
6
+ All artwork is monochrome. Text in the SVGs is converted to outlines, so no font has to be installed to display it.
7
+
8
+ ## Files
9
+
10
+ | File | Use |
11
+ |---|---|
12
+ | `svg/llmtop-lockup.svg` | Main logo: mark + wordmark, for **light** backgrounds |
13
+ | `svg/llmtop-lockup-reversed.svg` | Main logo for **dark** backgrounds |
14
+ | `svg/llmtop-wordmark.svg` | Wordmark only, light backgrounds |
15
+ | `svg/llmtop-wordmark-reversed.svg` | Wordmark only, dark backgrounds |
16
+ | `svg/llmtop-mark.svg` | App icon / avatar, dark tile (default) |
17
+ | `svg/llmtop-mark-light.svg` | App icon on a light tile |
18
+ | `svg/llmtop-glyph.svg` | Donut only, single colour via `currentColor` (inline in UI, inherits text colour) |
19
+ | `svg/favicon.svg` | Simplified 3-segment donut for 16–32 px |
20
+ | `favicon.ico` | 16/32/48 px, for browsers that need .ico |
21
+ | `png/favicon-{16,32,48}.png` | Raster favicons |
22
+ | `png/apple-touch-icon.png` | 180×180 |
23
+ | `png/llmtop-mark-{192,512,1024}.png` | PWA manifest / store icons |
24
+ | `png/llmtop-lockup@2x.png`, `png/llmtop-lockup-reversed@2x.png`, `png/llmtop-wordmark@2x.png` | Raster logos for places that cannot take SVG |
25
+ | `brand.json` | Colours, fonts, donut geometry and usage rules as data |
26
+ | `source/build_brand.py` | Script that regenerates every SVG from the spec (needs Roboto Mono .woff files) |
27
+
28
+ ## Rules
29
+
30
+ - **Colours:** monochrome only. Ink `#1A1A1A`, paper `#F2F2F2`, white `#FFFFFF`, black `#000000`.
31
+ Donut segments, largest first, clockwise from 12 o'clock:
32
+ - on light: `#1A1A1A`, `#3F3F3F`, `#7F7F7F`, `#D8D8D8`
33
+ - on dark: `#FFFFFF`, `#D8D8D8`, `#888888`, `#3F3F3F`
34
+ - **Typography:** wordmark is Roboto Mono, "llm" Regular 400 + "top" Bold 700, letter-spacing −0.03em. Any surrounding UI text uses Montserrat (400/700).
35
+ - **Clear space:** at least 0.25 × the mark's height on every side.
36
+ - **Minimum size:** lockup 120 px wide; wordmark 80 px wide; below 32 px use `favicon.svg`, not `llmtop-mark.svg`.
37
+ - **Do not:** recolour the segments, add gradients or shadows, rotate or stretch the logo, re-type the wordmark in another font, or use the theme accents clay/ochre/amber.
38
+ - The donut is a symbol, not live data: do not animate segment sizes to real stats unless explicitly designing a data view.
39
+
40
+ ## Integration snippets
41
+
42
+ **HTML `<head>`**
43
+ ```html
44
+ <link rel="icon" href="/favicon.ico" sizes="48x48">
45
+ <link rel="icon" href="/favicon.svg" type="image/svg+xml">
46
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png">
47
+ <link rel="manifest" href="/site.webmanifest">
48
+ <meta name="theme-color" content="#1A1A1A">
49
+ ```
50
+
51
+ **site.webmanifest**
52
+ ```json
53
+ {
54
+ "name": "llmtop",
55
+ "short_name": "llmtop",
56
+ "icons": [
57
+ { "src": "/llmtop-mark-192.png", "sizes": "192x192", "type": "image/png" },
58
+ { "src": "/llmtop-mark-512.png", "sizes": "512x512", "type": "image/png" }
59
+ ],
60
+ "theme_color": "#1A1A1A",
61
+ "background_color": "#F2F2F2",
62
+ "display": "standalone"
63
+ }
64
+ ```
65
+
66
+ **GitHub README header (switches with the reader's theme)**
67
+ ```html
68
+ <p align="center">
69
+ <picture>
70
+ <source media="(prefers-color-scheme: dark)" srcset="docs/brand/svg/llmtop-lockup-reversed.svg">
71
+ <img alt="llmtop" src="docs/brand/svg/llmtop-lockup.svg" width="360">
72
+ </picture>
73
+ </p>
74
+ ```
75
+
76
+ **Inline glyph that follows text colour**
77
+ ```html
78
+ <span style="color:#1A1A1A; display:inline-flex; width:1em; height:1em">
79
+ <!-- paste the contents of svg/llmtop-glyph.svg here -->
80
+ </span>
81
+ ```
82
+
83
+ ## Prompt for a coding agent (Codex, Claude Code, …)
84
+
85
+ > Add the llmtop logo kit from `docs/brand/` (this folder) to the project.
86
+ > 1. Copy the folder to `docs/brand/` unchanged, keeping `README.md` and `brand.json`.
87
+ > 2. Web app: copy `favicon.ico`, `svg/favicon.svg`, `png/apple-touch-icon.png`, `png/llmtop-mark-192.png`, `png/llmtop-mark-512.png` into the public/static folder; add the `<head>` tags and `site.webmanifest` from `docs/brand/README.md`.
88
+ > 3. Use `svg/llmtop-lockup.svg` in the light header and `svg/llmtop-lockup-reversed.svg` on dark themes; use `svg/llmtop-glyph.svg` inline where the logo should inherit text colour.
89
+ > 4. Put the `<picture>` header from the README at the top of the repository `README.md`.
90
+ > 5. Expose `brand.json` colours as design tokens (CSS variables or the project's theme file) instead of hard-coding hex values.
91
+ > 6. Follow the Rules section: no recolouring, no re-typing the wordmark, monochrome only. Do not edit the SVG files.
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "llmtop",
3
+ "direction": "D \u2014 donut o",
4
+ "fonts": {
5
+ "wordmark": "Roboto Mono",
6
+ "weights": {
7
+ "llm": 400,
8
+ "top": 700
9
+ },
10
+ "letterSpacingEm": -0.03,
11
+ "ui": "Montserrat"
12
+ },
13
+ "colors": {
14
+ "ink": "#1A1A1A",
15
+ "paper": "#F2F2F2",
16
+ "white": "#FFFFFF",
17
+ "black": "#000000",
18
+ "tileDark": "#1A1A1A",
19
+ "tileLight": "#F2F2F2",
20
+ "donutOnLight": [
21
+ "#1A1A1A",
22
+ "#3F3F3F",
23
+ "#7F7F7F",
24
+ "#D8D8D8"
25
+ ],
26
+ "donutOnDark": [
27
+ "#FFFFFF",
28
+ "#D8D8D8",
29
+ "#888888",
30
+ "#3F3F3F"
31
+ ]
32
+ },
33
+ "donut": {
34
+ "segments": [
35
+ 0.38,
36
+ 0.26,
37
+ 0.16,
38
+ 0.08
39
+ ],
40
+ "gap": 0.03,
41
+ "startAngle": "12 o'clock",
42
+ "direction": "clockwise",
43
+ "meaning": "share of usage across providers, largest first; the last segment is 'others' (e.g. local models)"
44
+ },
45
+ "mark": {
46
+ "grid": 64,
47
+ "cornerRadius": 14,
48
+ "ringRadius": 16,
49
+ "ringStroke": 8
50
+ },
51
+ "favicon": {
52
+ "segments": [
53
+ 0.46,
54
+ 0.28,
55
+ 0.14
56
+ ],
57
+ "gap": 0.04,
58
+ "ringRadius": 17,
59
+ "ringStroke": 12
60
+ },
61
+ "clearSpace": "0.25 \u00d7 mark height on every side",
62
+ "minSize": {
63
+ "mark": "16px (use favicon.svg below 32px)",
64
+ "wordmark": "80px wide",
65
+ "lockup": "120px wide"
66
+ }
67
+ }
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1,173 @@
1
+ """Build the llmtop logo kit (direction D: donut "o").
2
+
3
+ Usage: python3 -I build_brand.py <font_dir> <out_dir>
4
+ font_dir holds roboto-mono-latin-{400,700}-normal.woff
5
+ """
6
+ import json, math, os, sys
7
+ from fontTools.ttLib import TTFont
8
+ from fontTools.pens.svgPathPen import SVGPathPen
9
+ from fontTools.pens.transformPen import TransformPen
10
+ from fontTools.pens.boundsPen import BoundsPen
11
+
12
+ font_dir, out = sys.argv[1], sys.argv[2]
13
+ os.makedirs(os.path.join(out, "svg"), exist_ok=True)
14
+
15
+ F = {w: TTFont(os.path.join(font_dir, f"roboto-mono-latin-{w}-normal.woff")) for w in ("400", "700")}
16
+ UPM = 2048
17
+ ADV = 1229
18
+ XH = 1082
19
+
20
+ INK = {"light": ["#1A1A1A", "#3F3F3F", "#7F7F7F", "#D8D8D8"], # on light grounds
21
+ "dark": ["#FFFFFF", "#D8D8D8", "#888888", "#3F3F3F"]} # on dark grounds
22
+ TEXT = {"light": "#1A1A1A", "dark": "#FFFFFF"}
23
+ TILE = {"dark": "#1A1A1A", "light": "#F2F2F2"}
24
+ SEGMENTS = [0.38, 0.26, 0.16, 0.08] # share of the ring, clockwise from 12 o'clock
25
+ GAP = 0.03
26
+
27
+
28
+ def glyph_path(weight, ch, x, baseline, scale):
29
+ f = F[weight]
30
+ gs = f.getGlyphSet()
31
+ name = f.getBestCmap()[ord(ch)]
32
+ pen = SVGPathPen(gs)
33
+ gs[name].draw(TransformPen(pen, (scale, 0, 0, -scale, x, baseline)))
34
+ return pen.getCommands()
35
+
36
+
37
+ def glyph_bounds(weight, ch):
38
+ f = F[weight]
39
+ gs = f.getGlyphSet()
40
+ bp = BoundsPen(gs)
41
+ gs[f.getBestCmap()[ord(ch)]].draw(bp)
42
+ return bp.bounds
43
+
44
+
45
+ def arc(cx, cy, r, a0, a1):
46
+ """Clockwise arc from fraction a0 to a1 of a turn, 0 = 12 o'clock."""
47
+ def pt(a):
48
+ t = 2 * math.pi * a - math.pi / 2
49
+ return cx + r * math.cos(t), cy + r * math.sin(t)
50
+ x0, y0 = pt(a0)
51
+ x1, y1 = pt(a1)
52
+ large = 1 if (a1 - a0) > 0.5 else 0
53
+ return f"M{x0:.3f} {y0:.3f}A{r:.3f} {r:.3f} 0 {large} 1 {x1:.3f} {y1:.3f}"
54
+
55
+
56
+ def donut(cx, cy, r, sw, colors, segs=SEGMENTS, gap=GAP):
57
+ out, a = [], 0.0
58
+ for frac, col in zip(segs, colors):
59
+ out.append(f'<path d="{arc(cx, cy, r, a, a + frac)}" fill="none" stroke="{col}" stroke-width="{sw:.3f}"/>')
60
+ a += frac + gap
61
+ return "".join(out)
62
+
63
+
64
+ def svg(w, h, body, label):
65
+ return (f'<svg xmlns="http://www.w3.org/2000/svg" width="{w:g}" height="{h:g}" viewBox="0 0 {w:g} {h:g}" '
66
+ f'role="img" aria-label="{label}"><title>{label}</title>{body}</svg>\n')
67
+
68
+
69
+ def write(name, content):
70
+ with open(os.path.join(out, "svg", name), "w") as fh:
71
+ fh.write(content)
72
+
73
+
74
+ # ---------- mark (64 grid) ----------
75
+ def mark_body(theme, size=64):
76
+ s = size / 64
77
+ tile = f'<rect width="{size:g}" height="{size:g}" rx="{14*s:g}" fill="{TILE[theme]}"/>'
78
+ ring_colors = INK["dark"] if theme == "dark" else INK["light"]
79
+ return tile + donut(32 * s, 32 * s, 16 * s, 8 * s, ring_colors)
80
+
81
+
82
+ write("llmtop-mark.svg", svg(64, 64, mark_body("dark"), "llmtop"))
83
+ write("llmtop-mark-light.svg", svg(64, 64, mark_body("light"), "llmtop"))
84
+
85
+ # glyph only, single colour via currentColor (theme it in CSS)
86
+ glyph = ""
87
+ a = 0.0
88
+ for frac, op in zip(SEGMENTS, (1, 0.72, 0.45, 0.18)):
89
+ glyph += f'<path d="{arc(32, 32, 22, a, a + frac)}" fill="none" stroke="currentColor" stroke-opacity="{op}" stroke-width="12"/>'
90
+ a += frac + GAP
91
+ write("llmtop-glyph.svg", svg(64, 64, glyph, "llmtop"))
92
+
93
+ # favicon: simplified 3-segment ring, thicker, wider gaps (reads at 16 px)
94
+ fav = f'<rect width="64" height="64" rx="14" fill="{TILE["dark"]}"/>' + donut(
95
+ 32, 32, 17, 12, ["#FFFFFF", "#D8D8D8", "#888888"], segs=[0.46, 0.28, 0.14], gap=0.04)
96
+ write("favicon.svg", svg(64, 64, fav, "llmtop"))
97
+
98
+ # ---------- wordmark: llm(400) t(700) [donut] p(700) ----------
99
+ FS = 100 # font size in svg units
100
+ sc = FS / UPM
101
+ adv = ADV * sc
102
+ track = -0.03 * FS
103
+ ob = glyph_bounds("700", "o") # (xmin, ymin, xmax, ymax) in font units
104
+ o_h = (ob[3] - ob[1]) * sc
105
+ o_cy_font = (ob[3] + ob[1]) / 2
106
+ o_w = (ob[2] - ob[0]) * sc
107
+ asc = 1456 * sc # cap height, for vertical box
108
+ desc = 555 * sc * 0.75
109
+ pad = 0
110
+ baseline = asc + 4
111
+ height = baseline + desc
112
+
113
+
114
+ def wordmark_body(theme, x0=0.0, y0=0.0):
115
+ col = TEXT[theme]
116
+ paths, x = [], x0
117
+ for ch, w in (("l", "400"), ("l", "400"), ("m", "400"), ("t", "700"), ("o", "700"), ("p", "700")):
118
+ if ch == "o":
119
+ ring_colors = INK["light"] if theme == "light" else INK["dark"]
120
+ outer = max(o_h, o_w) / 2 + 0.6
121
+ sw = 13.5
122
+ cx = x + adv / 2
123
+ cy = y0 + baseline - o_cy_font * sc
124
+ paths.append(donut(cx, cy, outer - sw / 2, sw, ring_colors))
125
+ else:
126
+ d = glyph_path(w, ch, x, y0 + baseline, sc)
127
+ paths.append(f'<path d="{d}" fill="{col}"/>')
128
+ x += adv + track
129
+ return "".join(paths), x - track - x0
130
+
131
+
132
+ wm_light, wm_w = wordmark_body("light")
133
+ wm_dark, _ = wordmark_body("dark")
134
+ write("llmtop-wordmark.svg", svg(round(wm_w, 2), round(height, 2), wm_light, "llmtop"))
135
+ write("llmtop-wordmark-reversed.svg", svg(round(wm_w, 2), round(height, 2), wm_dark, "llmtop"))
136
+
137
+ # ---------- horizontal lockup: mark + wordmark ----------
138
+ mark_size = round(height * 1.0)
139
+ gapx = mark_size * 0.28
140
+
141
+
142
+ def lockup(theme):
143
+ tile_theme = "dark" if theme == "light" else "light"
144
+ m = f'<g>{mark_body(tile_theme, mark_size)}</g>'
145
+ wm, _ = wordmark_body(theme, x0=mark_size + gapx, y0=(mark_size - height) / 2)
146
+ return m + wm
147
+
148
+
149
+ lw = round(mark_size + gapx + wm_w, 2)
150
+ write("llmtop-lockup.svg", svg(lw, mark_size, lockup("light"), "llmtop"))
151
+ write("llmtop-lockup-reversed.svg", svg(lw, mark_size, lockup("dark"), "llmtop"))
152
+
153
+ # ---------- tokens ----------
154
+ tokens = {
155
+ "name": "llmtop",
156
+ "direction": "D — donut o",
157
+ "fonts": {"wordmark": "Roboto Mono", "weights": {"llm": 400, "top": 700},
158
+ "letterSpacingEm": -0.03, "ui": "Montserrat"},
159
+ "colors": {
160
+ "ink": "#1A1A1A", "paper": "#F2F2F2", "white": "#FFFFFF", "black": "#000000",
161
+ "tileDark": TILE["dark"], "tileLight": TILE["light"],
162
+ "donutOnLight": INK["light"], "donutOnDark": INK["dark"],
163
+ },
164
+ "donut": {"segments": SEGMENTS, "gap": GAP, "startAngle": "12 o'clock", "direction": "clockwise",
165
+ "meaning": "share of usage across providers, largest first; the last segment is 'others' (e.g. local models)"},
166
+ "mark": {"grid": 64, "cornerRadius": 14, "ringRadius": 16, "ringStroke": 8},
167
+ "favicon": {"segments": [0.46, 0.28, 0.14], "gap": 0.04, "ringRadius": 17, "ringStroke": 12},
168
+ "clearSpace": "0.25 × mark height on every side",
169
+ "minSize": {"mark": "16px (use favicon.svg below 32px)", "wordmark": "80px wide", "lockup": "120px wide"},
170
+ }
171
+ with open(os.path.join(out, "brand.json"), "w") as fh:
172
+ json.dump(tokens, fh, indent=2)
173
+ print("ok", lw, wm_w, height)
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" role="img" aria-label="llmtop"><title>llmtop</title><rect width="64" height="64" rx="14" fill="#1A1A1A"/><path d="M32.000 15.000A17.000 17.000 0 0 1 36.228 48.466" fill="none" stroke="#FFFFFF" stroke-width="12.000"/><path d="M32.000 49.000A17.000 17.000 0 0 1 15.301 28.815" fill="none" stroke="#D8D8D8" stroke-width="12.000"/><path d="M16.618 24.762A17.000 17.000 0 0 1 27.772 15.534" fill="none" stroke="#888888" stroke-width="12.000"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" role="img" aria-label="llmtop"><title>llmtop</title><path d="M32.000 10.000A22.000 22.000 0 0 1 47.060 48.037" fill="none" stroke="currentColor" stroke-opacity="1" stroke-width="12"/><path d="M43.788 50.575A22.000 22.000 0 0 1 12.721 42.599" fill="none" stroke="currentColor" stroke-opacity="0.72" stroke-width="12"/><path d="M11.077 38.798A22.000 22.000 0 0 1 15.049 17.977" fill="none" stroke="currentColor" stroke-opacity="0.45" stroke-width="12"/><path d="M17.977 15.049A22.000 22.000 0 0 1 27.878 10.390" fill="none" stroke="currentColor" stroke-opacity="0.18" stroke-width="12"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="466.66" height="95" viewBox="0 0 466.66 95" role="img" aria-label="llmtop"><title>llmtop</title><g><rect width="95" height="95" rx="20.7812" fill="#F2F2F2"/><path d="M47.500 23.750A23.750 23.750 0 0 1 63.758 64.813" fill="none" stroke="#1A1A1A" stroke-width="11.875"/><path d="M60.226 67.553A23.750 23.750 0 0 1 26.688 58.942" fill="none" stroke="#3F3F3F" stroke-width="11.875"/><path d="M24.912 54.839A23.750 23.750 0 0 1 29.200 32.361" fill="none" stroke="#7F7F7F" stroke-width="11.875"/><path d="M32.361 29.200A23.750 23.750 0 0 1 43.050 24.171" fill="none" stroke="#D8D8D8" stroke-width="11.875"/></g><path d="M131.512109375 -0.115478515625V7.745849609375H149.480859375V67.072021484375H131.512109375V74.884521484375H175.750390625V67.072021484375H158.5140625V-0.115478515625Z" fill="#FFFFFF"/><path d="M188.521875 -0.115478515625V7.745849609375H206.490625V67.072021484375H188.521875V74.884521484375H232.76015625V67.072021484375H215.523828125V-0.115478515625Z" fill="#FFFFFF"/><path d="M248.266015625 22.052490234375H240.160546875V74.884521484375H248.754296875V32.843505859375Q249.047265625 32.062255859375 249.5111328125 31.378662109375Q249.975 30.695068359375 250.609765625 30.157958984375Q251.43984375 29.474365234375 252.6361328125 29.108154296875Q253.832421875 28.741943359375 255.44375 28.741943359375Q256.90859375 28.741943359375 258.0072265625 29.108154296875Q259.105859375 29.474365234375 259.83828125 30.255615234375Q260.61953125 31.085693359375 260.9857421875 32.355224609375Q261.351953125 33.624755859375 261.351953125 35.284912109375V74.884521484375H269.945703125V34.357177734375Q270.0921875 33.136474609375 270.531640625 32.135498046875Q270.97109375 31.134521484375 271.75234375 30.353271484375Q272.53359375 29.620849609375 273.70546875 29.181396484375Q274.87734375 28.741943359375 276.488671875 28.741943359375Q278.00234375 28.741943359375 279.1498046875 29.132568359375Q280.297265625 29.523193359375 281.078515625 30.304443359375Q281.8109375 31.134521484375 282.2015625 32.404052734375Q282.5921875 33.673583984375 282.5921875 35.333740234375V74.884521484375H291.1859375V35.431396484375Q291.1859375 31.622802734375 290.30703125 28.815185546875Q289.428125 26.007568359375 287.76796875 24.249755859375Q286.254296875 22.687255859375 284.05703125 21.881591796875Q281.859765625 21.075927734375 279.125390625 21.075927734375Q277.1234375 21.124755859375 275.4388671875 21.613037109375Q273.754296875 22.101318359375 272.387109375 22.931396484375Q271.312890625 23.663818359375 270.38515625 24.640380859375Q269.457421875 25.616943359375 268.773828125 26.739990234375Q268.23671875 25.519287109375 267.4798828125 24.542724609375Q266.723046875 23.566162109375 265.7953125 22.882568359375Q264.52578125 22.003662109375 262.8412109375 21.539794921875Q261.156640625 21.075927734375 259.05703125 21.075927734375Q255.34609375 21.124755859375 252.7337890625 22.687255859375Q250.121484375 24.249755859375 248.51015625 27.032958984375Z" fill="#FFFFFF"/><path d="M324.41640625 9.113037109375H310.8421875V22.052490234375H298.781640625V32.062255859375H310.8421875V56.085693359375Q310.8421875 61.310302734375 312.209375 65.045654296875Q313.5765625 68.781005859375 316.115625 71.173583984375Q318.605859375 73.614990234375 322.1458984375 74.762451171875Q325.6859375 75.909912109375 330.031640625 75.909912109375Q332.277734375 75.909912109375 334.5970703125 75.690185546875Q336.91640625 75.470458984375 339.06484375 75.079833984375Q341.21328125 74.689208984375 343.117578125 74.078857421875Q345.021875 73.468505859375 346.437890625 72.638427734375L345.11953125 63.312255859375Q344.191796875 63.556396484375 342.8978515625 63.800537109375Q341.60390625 64.044677734375 340.1390625 64.239990234375Q338.625390625 64.484130859375 336.9896484375 64.630615234375Q335.35390625 64.777099609375 333.79140625 64.777099609375Q331.64296875 64.777099609375 329.9095703125 64.288818359375Q328.176171875 63.800537109375 326.95546875 62.628662109375Q325.734765625 61.505615234375 325.0755859375 59.576904296875Q324.41640625 57.648193359375 324.41640625 54.767333984375V32.062255859375H344.14296875V22.052490234375H324.41640625Z" fill="#FFFFFF"/><path d="M379.644 27.226A21.267 21.267 0 0 1 394.202 63.996" fill="none" stroke="#FFFFFF" stroke-width="13.500"/><path d="M391.039 66.449A21.267 21.267 0 0 1 361.008 58.738" fill="none" stroke="#D8D8D8" stroke-width="13.500"/><path d="M359.418 55.065A21.267 21.267 0 0 1 363.257 34.937" fill="none" stroke="#888888" stroke-width="13.500"/><path d="M366.088 32.106A21.267 21.267 0 0 1 375.659 27.603" fill="none" stroke="#3F3F3F" stroke-width="13.500"/><path d="M413.72890625 95.197021484375H427.303125V70.294677734375Q428.230859375 71.320068359375 429.25625 72.150146484375Q430.281640625 72.980224609375 431.4046875 73.663818359375Q433.308984375 74.738037109375 435.5306640625 75.299560546875Q437.75234375 75.861083984375 440.3890625 75.861083984375Q445.36953125 75.861083984375 449.226953125 73.810302734375Q453.084375 71.759521484375 455.72109375 68.146240234375Q458.308984375 64.581787109375 459.6517578125 59.650146484375Q460.99453125 54.718505859375 460.99453125 48.956787109375V47.931396484375Q460.99453125 41.925537109375 459.6517578125 36.969482421875Q458.308984375 32.013427734375 455.672265625 28.448974609375Q453.035546875 24.933349609375 449.178125 23.004638671875Q445.320703125 21.075927734375 440.29140625 21.075927734375Q437.85 21.075927734375 435.7259765625 21.588623046875Q433.601953125 22.101318359375 431.844140625 23.029052734375Q430.379296875 23.810302734375 429.109765625 24.860107421875Q427.840234375 25.909912109375 426.766015625 27.228271484375L426.277734375 22.052490234375H413.72890625ZM447.4203125 47.931396484375V48.956787109375Q447.4203125 52.228271484375 446.834375 55.133544921875Q446.2484375 58.038818359375 444.97890625 60.236083984375Q443.709375 62.433349609375 441.6830078125 63.702880859375Q439.656640625 64.972412109375 436.77578125 64.972412109375Q434.969140625 64.972412109375 433.504296875 64.606201171875Q432.039453125 64.239990234375 430.91640625 63.556396484375Q429.74453125 62.823974609375 428.8412109375 61.798583984375Q427.937890625 60.773193359375 427.303125 59.503662109375V37.433349609375Q427.98671875 36.066162109375 428.9388671875 35.040771484375Q429.891015625 34.015380859375 431.160546875 33.331787109375Q432.28359375 32.745849609375 433.65078125 32.428466796875Q435.01796875 32.111083984375 436.678125 32.111083984375Q439.558984375 32.111083984375 441.5853515625 33.331787109375Q443.61171875 34.552490234375 444.930078125 36.652099609375Q446.199609375 38.800537109375 446.8099609375 41.705810546875Q447.4203125 44.611083984375 447.4203125 47.931396484375Z" fill="#FFFFFF"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="466.66" height="95" viewBox="0 0 466.66 95" role="img" aria-label="llmtop"><title>llmtop</title><g><rect width="95" height="95" rx="20.7812" fill="#1A1A1A"/><path d="M47.500 23.750A23.750 23.750 0 0 1 63.758 64.813" fill="none" stroke="#FFFFFF" stroke-width="11.875"/><path d="M60.226 67.553A23.750 23.750 0 0 1 26.688 58.942" fill="none" stroke="#D8D8D8" stroke-width="11.875"/><path d="M24.912 54.839A23.750 23.750 0 0 1 29.200 32.361" fill="none" stroke="#888888" stroke-width="11.875"/><path d="M32.361 29.200A23.750 23.750 0 0 1 43.050 24.171" fill="none" stroke="#3F3F3F" stroke-width="11.875"/></g><path d="M131.512109375 -0.115478515625V7.745849609375H149.480859375V67.072021484375H131.512109375V74.884521484375H175.750390625V67.072021484375H158.5140625V-0.115478515625Z" fill="#1A1A1A"/><path d="M188.521875 -0.115478515625V7.745849609375H206.490625V67.072021484375H188.521875V74.884521484375H232.76015625V67.072021484375H215.523828125V-0.115478515625Z" fill="#1A1A1A"/><path d="M248.266015625 22.052490234375H240.160546875V74.884521484375H248.754296875V32.843505859375Q249.047265625 32.062255859375 249.5111328125 31.378662109375Q249.975 30.695068359375 250.609765625 30.157958984375Q251.43984375 29.474365234375 252.6361328125 29.108154296875Q253.832421875 28.741943359375 255.44375 28.741943359375Q256.90859375 28.741943359375 258.0072265625 29.108154296875Q259.105859375 29.474365234375 259.83828125 30.255615234375Q260.61953125 31.085693359375 260.9857421875 32.355224609375Q261.351953125 33.624755859375 261.351953125 35.284912109375V74.884521484375H269.945703125V34.357177734375Q270.0921875 33.136474609375 270.531640625 32.135498046875Q270.97109375 31.134521484375 271.75234375 30.353271484375Q272.53359375 29.620849609375 273.70546875 29.181396484375Q274.87734375 28.741943359375 276.488671875 28.741943359375Q278.00234375 28.741943359375 279.1498046875 29.132568359375Q280.297265625 29.523193359375 281.078515625 30.304443359375Q281.8109375 31.134521484375 282.2015625 32.404052734375Q282.5921875 33.673583984375 282.5921875 35.333740234375V74.884521484375H291.1859375V35.431396484375Q291.1859375 31.622802734375 290.30703125 28.815185546875Q289.428125 26.007568359375 287.76796875 24.249755859375Q286.254296875 22.687255859375 284.05703125 21.881591796875Q281.859765625 21.075927734375 279.125390625 21.075927734375Q277.1234375 21.124755859375 275.4388671875 21.613037109375Q273.754296875 22.101318359375 272.387109375 22.931396484375Q271.312890625 23.663818359375 270.38515625 24.640380859375Q269.457421875 25.616943359375 268.773828125 26.739990234375Q268.23671875 25.519287109375 267.4798828125 24.542724609375Q266.723046875 23.566162109375 265.7953125 22.882568359375Q264.52578125 22.003662109375 262.8412109375 21.539794921875Q261.156640625 21.075927734375 259.05703125 21.075927734375Q255.34609375 21.124755859375 252.7337890625 22.687255859375Q250.121484375 24.249755859375 248.51015625 27.032958984375Z" fill="#1A1A1A"/><path d="M324.41640625 9.113037109375H310.8421875V22.052490234375H298.781640625V32.062255859375H310.8421875V56.085693359375Q310.8421875 61.310302734375 312.209375 65.045654296875Q313.5765625 68.781005859375 316.115625 71.173583984375Q318.605859375 73.614990234375 322.1458984375 74.762451171875Q325.6859375 75.909912109375 330.031640625 75.909912109375Q332.277734375 75.909912109375 334.5970703125 75.690185546875Q336.91640625 75.470458984375 339.06484375 75.079833984375Q341.21328125 74.689208984375 343.117578125 74.078857421875Q345.021875 73.468505859375 346.437890625 72.638427734375L345.11953125 63.312255859375Q344.191796875 63.556396484375 342.8978515625 63.800537109375Q341.60390625 64.044677734375 340.1390625 64.239990234375Q338.625390625 64.484130859375 336.9896484375 64.630615234375Q335.35390625 64.777099609375 333.79140625 64.777099609375Q331.64296875 64.777099609375 329.9095703125 64.288818359375Q328.176171875 63.800537109375 326.95546875 62.628662109375Q325.734765625 61.505615234375 325.0755859375 59.576904296875Q324.41640625 57.648193359375 324.41640625 54.767333984375V32.062255859375H344.14296875V22.052490234375H324.41640625Z" fill="#1A1A1A"/><path d="M379.644 27.226A21.267 21.267 0 0 1 394.202 63.996" fill="none" stroke="#1A1A1A" stroke-width="13.500"/><path d="M391.039 66.449A21.267 21.267 0 0 1 361.008 58.738" fill="none" stroke="#3F3F3F" stroke-width="13.500"/><path d="M359.418 55.065A21.267 21.267 0 0 1 363.257 34.937" fill="none" stroke="#7F7F7F" stroke-width="13.500"/><path d="M366.088 32.106A21.267 21.267 0 0 1 375.659 27.603" fill="none" stroke="#D8D8D8" stroke-width="13.500"/><path d="M413.72890625 95.197021484375H427.303125V70.294677734375Q428.230859375 71.320068359375 429.25625 72.150146484375Q430.281640625 72.980224609375 431.4046875 73.663818359375Q433.308984375 74.738037109375 435.5306640625 75.299560546875Q437.75234375 75.861083984375 440.3890625 75.861083984375Q445.36953125 75.861083984375 449.226953125 73.810302734375Q453.084375 71.759521484375 455.72109375 68.146240234375Q458.308984375 64.581787109375 459.6517578125 59.650146484375Q460.99453125 54.718505859375 460.99453125 48.956787109375V47.931396484375Q460.99453125 41.925537109375 459.6517578125 36.969482421875Q458.308984375 32.013427734375 455.672265625 28.448974609375Q453.035546875 24.933349609375 449.178125 23.004638671875Q445.320703125 21.075927734375 440.29140625 21.075927734375Q437.85 21.075927734375 435.7259765625 21.588623046875Q433.601953125 22.101318359375 431.844140625 23.029052734375Q430.379296875 23.810302734375 429.109765625 24.860107421875Q427.840234375 25.909912109375 426.766015625 27.228271484375L426.277734375 22.052490234375H413.72890625ZM447.4203125 47.931396484375V48.956787109375Q447.4203125 52.228271484375 446.834375 55.133544921875Q446.2484375 58.038818359375 444.97890625 60.236083984375Q443.709375 62.433349609375 441.6830078125 63.702880859375Q439.656640625 64.972412109375 436.77578125 64.972412109375Q434.969140625 64.972412109375 433.504296875 64.606201171875Q432.039453125 64.239990234375 430.91640625 63.556396484375Q429.74453125 62.823974609375 428.8412109375 61.798583984375Q427.937890625 60.773193359375 427.303125 59.503662109375V37.433349609375Q427.98671875 36.066162109375 428.9388671875 35.040771484375Q429.891015625 34.015380859375 431.160546875 33.331787109375Q432.28359375 32.745849609375 433.65078125 32.428466796875Q435.01796875 32.111083984375 436.678125 32.111083984375Q439.558984375 32.111083984375 441.5853515625 33.331787109375Q443.61171875 34.552490234375 444.930078125 36.652099609375Q446.199609375 38.800537109375 446.8099609375 41.705810546875Q447.4203125 44.611083984375 447.4203125 47.931396484375Z" fill="#1A1A1A"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" role="img" aria-label="llmtop"><title>llmtop</title><rect width="64" height="64" rx="14" fill="#F2F2F2"/><path d="M32.000 16.000A16.000 16.000 0 0 1 42.953 43.663" fill="none" stroke="#1A1A1A" stroke-width="8.000"/><path d="M40.573 45.509A16.000 16.000 0 0 1 17.979 39.708" fill="none" stroke="#3F3F3F" stroke-width="8.000"/><path d="M16.783 36.944A16.000 16.000 0 0 1 19.672 21.801" fill="none" stroke="#7F7F7F" stroke-width="8.000"/><path d="M21.801 19.672A16.000 16.000 0 0 1 29.002 16.283" fill="none" stroke="#D8D8D8" stroke-width="8.000"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" role="img" aria-label="llmtop"><title>llmtop</title><rect width="64" height="64" rx="14" fill="#1A1A1A"/><path d="M32.000 16.000A16.000 16.000 0 0 1 42.953 43.663" fill="none" stroke="#FFFFFF" stroke-width="8.000"/><path d="M40.573 45.509A16.000 16.000 0 0 1 17.979 39.708" fill="none" stroke="#D8D8D8" stroke-width="8.000"/><path d="M16.783 36.944A16.000 16.000 0 0 1 19.672 21.801" fill="none" stroke="#888888" stroke-width="8.000"/><path d="M21.801 19.672A16.000 16.000 0 0 1 29.002 16.283" fill="none" stroke="#3F3F3F" stroke-width="8.000"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="345.06" height="95.42" viewBox="0 0 345.06 95.42" role="img" aria-label="llmtop"><title>llmtop</title><path d="M9.912109375 0.09375V7.955078125H27.880859375V67.28125H9.912109375V75.09375H54.150390625V67.28125H36.9140625V0.09375Z" fill="#FFFFFF"/><path d="M66.921875 0.09375V7.955078125H84.890625V67.28125H66.921875V75.09375H111.16015625V67.28125H93.923828125V0.09375Z" fill="#FFFFFF"/><path d="M126.666015625 22.26171875H118.560546875V75.09375H127.154296875V33.052734375Q127.447265625 32.271484375 127.9111328125 31.587890625Q128.375 30.904296875 129.009765625 30.3671875Q129.83984375 29.68359375 131.0361328125 29.3173828125Q132.232421875 28.951171875 133.84375 28.951171875Q135.30859375 28.951171875 136.4072265625 29.3173828125Q137.505859375 29.68359375 138.23828125 30.46484375Q139.01953125 31.294921875 139.3857421875 32.564453125Q139.751953125 33.833984375 139.751953125 35.494140625V75.09375H148.345703125V34.56640625Q148.4921875 33.345703125 148.931640625 32.3447265625Q149.37109375 31.34375 150.15234375 30.5625Q150.93359375 29.830078125 152.10546875 29.390625Q153.27734375 28.951171875 154.888671875 28.951171875Q156.40234375 28.951171875 157.5498046875 29.341796875Q158.697265625 29.732421875 159.478515625 30.513671875Q160.2109375 31.34375 160.6015625 32.61328125Q160.9921875 33.8828125 160.9921875 35.54296875V75.09375H169.5859375V35.640625Q169.5859375 31.83203125 168.70703125 29.0244140625Q167.828125 26.216796875 166.16796875 24.458984375Q164.654296875 22.896484375 162.45703125 22.0908203125Q160.259765625 21.28515625 157.525390625 21.28515625Q155.5234375 21.333984375 153.8388671875 21.822265625Q152.154296875 22.310546875 150.787109375 23.140625Q149.712890625 23.873046875 148.78515625 24.849609375Q147.857421875 25.826171875 147.173828125 26.94921875Q146.63671875 25.728515625 145.8798828125 24.751953125Q145.123046875 23.775390625 144.1953125 23.091796875Q142.92578125 22.212890625 141.2412109375 21.7490234375Q139.556640625 21.28515625 137.45703125 21.28515625Q133.74609375 21.333984375 131.1337890625 22.896484375Q128.521484375 24.458984375 126.91015625 27.2421875Z" fill="#FFFFFF"/><path d="M202.81640625 9.322265625H189.2421875V22.26171875H177.181640625V32.271484375H189.2421875V56.294921875Q189.2421875 61.51953125 190.609375 65.2548828125Q191.9765625 68.990234375 194.515625 71.3828125Q197.005859375 73.82421875 200.5458984375 74.9716796875Q204.0859375 76.119140625 208.431640625 76.119140625Q210.677734375 76.119140625 212.9970703125 75.8994140625Q215.31640625 75.6796875 217.46484375 75.2890625Q219.61328125 74.8984375 221.517578125 74.2880859375Q223.421875 73.677734375 224.837890625 72.84765625L223.51953125 63.521484375Q222.591796875 63.765625 221.2978515625 64.009765625Q220.00390625 64.25390625 218.5390625 64.44921875Q217.025390625 64.693359375 215.3896484375 64.83984375Q213.75390625 64.986328125 212.19140625 64.986328125Q210.04296875 64.986328125 208.3095703125 64.498046875Q206.576171875 64.009765625 205.35546875 62.837890625Q204.134765625 61.71484375 203.4755859375 59.7861328125Q202.81640625 57.857421875 202.81640625 54.9765625V32.271484375H222.54296875V22.26171875H202.81640625Z" fill="#FFFFFF"/><path d="M258.044 27.435A21.267 21.267 0 0 1 272.602 64.205" fill="none" stroke="#FFFFFF" stroke-width="13.500"/><path d="M269.439 66.658A21.267 21.267 0 0 1 239.408 58.948" fill="none" stroke="#D8D8D8" stroke-width="13.500"/><path d="M237.818 55.274A21.267 21.267 0 0 1 241.657 35.146" fill="none" stroke="#888888" stroke-width="13.500"/><path d="M244.488 32.316A21.267 21.267 0 0 1 254.059 27.812" fill="none" stroke="#3F3F3F" stroke-width="13.500"/><path d="M292.12890625 95.40625H305.703125V70.50390625Q306.630859375 71.529296875 307.65625 72.359375Q308.681640625 73.189453125 309.8046875 73.873046875Q311.708984375 74.947265625 313.9306640625 75.5087890625Q316.15234375 76.0703125 318.7890625 76.0703125Q323.76953125 76.0703125 327.626953125 74.01953125Q331.484375 71.96875 334.12109375 68.35546875Q336.708984375 64.791015625 338.0517578125 59.859375Q339.39453125 54.927734375 339.39453125 49.166015625V48.140625Q339.39453125 42.134765625 338.0517578125 37.1787109375Q336.708984375 32.22265625 334.072265625 28.658203125Q331.435546875 25.142578125 327.578125 23.2138671875Q323.720703125 21.28515625 318.69140625 21.28515625Q316.25 21.28515625 314.1259765625 21.7978515625Q312.001953125 22.310546875 310.244140625 23.23828125Q308.779296875 24.01953125 307.509765625 25.0693359375Q306.240234375 26.119140625 305.166015625 27.4375L304.677734375 22.26171875H292.12890625ZM325.8203125 48.140625V49.166015625Q325.8203125 52.4375 325.234375 55.3427734375Q324.6484375 58.248046875 323.37890625 60.4453125Q322.109375 62.642578125 320.0830078125 63.912109375Q318.056640625 65.181640625 315.17578125 65.181640625Q313.369140625 65.181640625 311.904296875 64.8154296875Q310.439453125 64.44921875 309.31640625 63.765625Q308.14453125 63.033203125 307.2412109375 62.0078125Q306.337890625 60.982421875 305.703125 59.712890625V37.642578125Q306.38671875 36.275390625 307.3388671875 35.25Q308.291015625 34.224609375 309.560546875 33.541015625Q310.68359375 32.955078125 312.05078125 32.6376953125Q313.41796875 32.3203125 315.078125 32.3203125Q317.958984375 32.3203125 319.9853515625 33.541015625Q322.01171875 34.76171875 323.330078125 36.861328125Q324.599609375 39.009765625 325.2099609375 41.9150390625Q325.8203125 44.8203125 325.8203125 48.140625Z" fill="#FFFFFF"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="345.06" height="95.42" viewBox="0 0 345.06 95.42" role="img" aria-label="llmtop"><title>llmtop</title><path d="M9.912109375 0.09375V7.955078125H27.880859375V67.28125H9.912109375V75.09375H54.150390625V67.28125H36.9140625V0.09375Z" fill="#1A1A1A"/><path d="M66.921875 0.09375V7.955078125H84.890625V67.28125H66.921875V75.09375H111.16015625V67.28125H93.923828125V0.09375Z" fill="#1A1A1A"/><path d="M126.666015625 22.26171875H118.560546875V75.09375H127.154296875V33.052734375Q127.447265625 32.271484375 127.9111328125 31.587890625Q128.375 30.904296875 129.009765625 30.3671875Q129.83984375 29.68359375 131.0361328125 29.3173828125Q132.232421875 28.951171875 133.84375 28.951171875Q135.30859375 28.951171875 136.4072265625 29.3173828125Q137.505859375 29.68359375 138.23828125 30.46484375Q139.01953125 31.294921875 139.3857421875 32.564453125Q139.751953125 33.833984375 139.751953125 35.494140625V75.09375H148.345703125V34.56640625Q148.4921875 33.345703125 148.931640625 32.3447265625Q149.37109375 31.34375 150.15234375 30.5625Q150.93359375 29.830078125 152.10546875 29.390625Q153.27734375 28.951171875 154.888671875 28.951171875Q156.40234375 28.951171875 157.5498046875 29.341796875Q158.697265625 29.732421875 159.478515625 30.513671875Q160.2109375 31.34375 160.6015625 32.61328125Q160.9921875 33.8828125 160.9921875 35.54296875V75.09375H169.5859375V35.640625Q169.5859375 31.83203125 168.70703125 29.0244140625Q167.828125 26.216796875 166.16796875 24.458984375Q164.654296875 22.896484375 162.45703125 22.0908203125Q160.259765625 21.28515625 157.525390625 21.28515625Q155.5234375 21.333984375 153.8388671875 21.822265625Q152.154296875 22.310546875 150.787109375 23.140625Q149.712890625 23.873046875 148.78515625 24.849609375Q147.857421875 25.826171875 147.173828125 26.94921875Q146.63671875 25.728515625 145.8798828125 24.751953125Q145.123046875 23.775390625 144.1953125 23.091796875Q142.92578125 22.212890625 141.2412109375 21.7490234375Q139.556640625 21.28515625 137.45703125 21.28515625Q133.74609375 21.333984375 131.1337890625 22.896484375Q128.521484375 24.458984375 126.91015625 27.2421875Z" fill="#1A1A1A"/><path d="M202.81640625 9.322265625H189.2421875V22.26171875H177.181640625V32.271484375H189.2421875V56.294921875Q189.2421875 61.51953125 190.609375 65.2548828125Q191.9765625 68.990234375 194.515625 71.3828125Q197.005859375 73.82421875 200.5458984375 74.9716796875Q204.0859375 76.119140625 208.431640625 76.119140625Q210.677734375 76.119140625 212.9970703125 75.8994140625Q215.31640625 75.6796875 217.46484375 75.2890625Q219.61328125 74.8984375 221.517578125 74.2880859375Q223.421875 73.677734375 224.837890625 72.84765625L223.51953125 63.521484375Q222.591796875 63.765625 221.2978515625 64.009765625Q220.00390625 64.25390625 218.5390625 64.44921875Q217.025390625 64.693359375 215.3896484375 64.83984375Q213.75390625 64.986328125 212.19140625 64.986328125Q210.04296875 64.986328125 208.3095703125 64.498046875Q206.576171875 64.009765625 205.35546875 62.837890625Q204.134765625 61.71484375 203.4755859375 59.7861328125Q202.81640625 57.857421875 202.81640625 54.9765625V32.271484375H222.54296875V22.26171875H202.81640625Z" fill="#1A1A1A"/><path d="M258.044 27.435A21.267 21.267 0 0 1 272.602 64.205" fill="none" stroke="#1A1A1A" stroke-width="13.500"/><path d="M269.439 66.658A21.267 21.267 0 0 1 239.408 58.948" fill="none" stroke="#3F3F3F" stroke-width="13.500"/><path d="M237.818 55.274A21.267 21.267 0 0 1 241.657 35.146" fill="none" stroke="#7F7F7F" stroke-width="13.500"/><path d="M244.488 32.316A21.267 21.267 0 0 1 254.059 27.812" fill="none" stroke="#D8D8D8" stroke-width="13.500"/><path d="M292.12890625 95.40625H305.703125V70.50390625Q306.630859375 71.529296875 307.65625 72.359375Q308.681640625 73.189453125 309.8046875 73.873046875Q311.708984375 74.947265625 313.9306640625 75.5087890625Q316.15234375 76.0703125 318.7890625 76.0703125Q323.76953125 76.0703125 327.626953125 74.01953125Q331.484375 71.96875 334.12109375 68.35546875Q336.708984375 64.791015625 338.0517578125 59.859375Q339.39453125 54.927734375 339.39453125 49.166015625V48.140625Q339.39453125 42.134765625 338.0517578125 37.1787109375Q336.708984375 32.22265625 334.072265625 28.658203125Q331.435546875 25.142578125 327.578125 23.2138671875Q323.720703125 21.28515625 318.69140625 21.28515625Q316.25 21.28515625 314.1259765625 21.7978515625Q312.001953125 22.310546875 310.244140625 23.23828125Q308.779296875 24.01953125 307.509765625 25.0693359375Q306.240234375 26.119140625 305.166015625 27.4375L304.677734375 22.26171875H292.12890625ZM325.8203125 48.140625V49.166015625Q325.8203125 52.4375 325.234375 55.3427734375Q324.6484375 58.248046875 323.37890625 60.4453125Q322.109375 62.642578125 320.0830078125 63.912109375Q318.056640625 65.181640625 315.17578125 65.181640625Q313.369140625 65.181640625 311.904296875 64.8154296875Q310.439453125 64.44921875 309.31640625 63.765625Q308.14453125 63.033203125 307.2412109375 62.0078125Q306.337890625 60.982421875 305.703125 59.712890625V37.642578125Q306.38671875 36.275390625 307.3388671875 35.25Q308.291015625 34.224609375 309.560546875 33.541015625Q310.68359375 32.955078125 312.05078125 32.6376953125Q313.41796875 32.3203125 315.078125 32.3203125Q317.958984375 32.3203125 319.9853515625 33.541015625Q322.01171875 34.76171875 323.330078125 36.861328125Q324.599609375 39.009765625 325.2099609375 41.9150390625Q325.8203125 44.8203125 325.8203125 48.140625Z" fill="#1A1A1A"/></svg>
@@ -0,0 +1,10 @@
1
+ {
2
+ "providers": {
3
+ "claude": { "transcripts": "~/.claude/projects" },
4
+ "codex": { "transcripts": "~/.codex/sessions" },
5
+ "agy": { "transcripts": "~/.gemini/antigravity-cli" }
6
+ },
7
+ "data": "data",
8
+ "port": 4310,
9
+ "timeZone": "Europe/Berlin"
10
+ }
package/package.json CHANGED
@@ -1,6 +1,73 @@
1
1
  {
2
2
  "name": "llmtop",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Local usage and cost analytics dashboard and CLI for Claude Code, Codex and Antigravity",
6
+ "author": "Trung Nguyen",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/nguyencanhtrung/llmtop.git"
11
+ },
12
+ "homepage": "https://github.com/nguyencanhtrung/llmtop#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/nguyencanhtrung/llmtop/issues"
15
+ },
16
+ "keywords": [
17
+ "llm",
18
+ "claude-code",
19
+ "codex",
20
+ "antigravity",
21
+ "ai",
22
+ "usage",
23
+ "cost",
24
+ "analytics",
25
+ "dashboard",
26
+ "cli",
27
+ "sqlite"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "engines": { "node": ">=22.15.0" },
33
+ "bin": {
34
+ "llmtop": "./bin/llmtop.mjs"
35
+ },
36
+ "files": [
37
+ "bin/",
38
+ "src/",
39
+ "dashboard/dist/",
40
+ "dashboard/src/",
41
+ "docs/brand/",
42
+ "prices.md",
43
+ "llmtop.config.example.json",
44
+ "README.md",
45
+ "LICENSE"
46
+ ],
47
+ "exports": {
48
+ "./src/*": "./src/*",
49
+ "./dashboard/src/*": "./dashboard/src/*",
50
+ "./dashboard/dist/*": "./dashboard/dist/*",
51
+ "./docs/brand/*": "./docs/brand/*",
52
+ "./package.json": "./package.json"
53
+ },
54
+ "scripts": {
55
+ "start": "npm run build && node bin/llmtop.mjs serve",
56
+ "dev": "vite dashboard",
57
+ "build": "tsc --noEmit -p dashboard && vite build dashboard",
58
+ "prepack": "npm run build",
59
+ "prepublishOnly": "npm test && npm run check",
60
+ "check": "tsc --noEmit -p dashboard",
61
+ "test": "node --test \"test/*.test.mjs\" \"dashboard/src/*.test.ts\""
62
+ },
63
+ "devDependencies": {
64
+ "@types/node": "^26.6.6",
65
+ "@types/react": "^19.3.0",
66
+ "@types/react-dom": "^19.3.0",
67
+ "@vitejs/plugin-react": "^6.3.0",
68
+ "react": "^19.3.1",
69
+ "react-dom": "^19.3.1",
70
+ "typescript": "^7.0.2",
71
+ "vite": "^8.3.7"
72
+ }
73
+ }