@simplexai/localmodels-linux-arm64 0.1.0-dev.103 → 0.1.0-dev.105

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 (172) hide show
  1. package/LICENSE +201 -0
  2. package/{modules/simplex_localmodels-0.1.0.dev103.dist-info/licenses/NOTICE → NOTICE} +42 -13
  3. package/README.md +10 -0
  4. package/bootstrap.identity +1 -1
  5. package/bootstrap.sha256 +159 -158
  6. package/modules/localmodels/__init__.py +1 -1
  7. package/modules/localmodels/__main__.py +204 -86
  8. package/modules/localmodels/apple_sensors.py +23 -0
  9. package/modules/localmodels/approval.py +25 -2
  10. package/modules/localmodels/catalog.json +584 -158
  11. package/modules/localmodels/catalog.py +18 -3
  12. package/modules/localmodels/catalog_recipes.py +64 -6
  13. package/modules/localmodels/cli_help.py +10 -0
  14. package/modules/localmodels/cli_parser.py +313 -230
  15. package/modules/localmodels/component.py +21 -3
  16. package/modules/localmodels/console.py +1 -1
  17. package/modules/localmodels/context_policy.py +6 -5
  18. package/modules/localmodels/custom_probe.py +4 -2
  19. package/modules/localmodels/debug_cli.py +0 -12
  20. package/modules/localmodels/debug_mode.py +0 -6
  21. package/modules/localmodels/decode_calibration.json +3 -4
  22. package/modules/localmodels/decode_calibration.py +5 -2
  23. package/modules/localmodels/deploy.py +11 -1
  24. package/modules/localmodels/deployment_lifecycle.py +1 -1
  25. package/modules/localmodels/download-mirrors.json +1 -1
  26. package/modules/localmodels/engine_adapters/base.py +11 -1
  27. package/modules/localmodels/engine_adapters/strata_poly.py +65 -3
  28. package/modules/localmodels/engine_adapters/suite_plan.py +61 -24
  29. package/modules/localmodels/engines-b11583.json +6 -26
  30. package/modules/localmodels/engines-b12588-mix-c0c3de8.json +3 -15
  31. package/modules/localmodels/engines-b12757-mix-ef2df21.json +3 -15
  32. package/modules/localmodels/engines-prism-b12178-03ec600.json +3 -15
  33. package/modules/localmodels/engines-speechcpp-v0.11.3.json +4 -20
  34. package/modules/localmodels/engines-strata-0.1.47.json +1 -5
  35. package/modules/localmodels/engines-strata-0.1.49.2.json +1 -5
  36. package/modules/localmodels/engines-strata-0.1.59.1.json +1 -5
  37. package/modules/localmodels/engines-strata-poly-0.2.20-poly.1.json +6 -30
  38. package/modules/localmodels/engines-strata-poly-0.2.20-poly.9.json +129 -0
  39. package/modules/localmodels/engines-whisper-b5454.json +6 -30
  40. package/modules/localmodels/engines.json +13 -61
  41. package/modules/localmodels/estimator.py +10 -5
  42. package/modules/localmodels/gpu_specs.py +1 -1
  43. package/modules/localmodels/host_sensors.py +25 -2
  44. package/modules/localmodels/hosts.py +38 -21
  45. package/modules/localmodels/kokoro-tts-0.6.1.txt +1 -1
  46. package/modules/localmodels/library_cli.py +34 -16
  47. package/modules/localmodels/library_custom.py +9 -1
  48. package/modules/localmodels/library_direct.py +41 -1
  49. package/modules/localmodels/library_elastic.py +135 -6
  50. package/modules/localmodels/library_jobs.py +23 -4
  51. package/modules/localmodels/library_kept.py +9 -1
  52. package/modules/localmodels/library_model.py +174 -2
  53. package/modules/localmodels/library_order.py +175 -69
  54. package/modules/localmodels/library_poly.py +150 -21
  55. package/modules/localmodels/library_presentation.py +485 -0
  56. package/modules/localmodels/library_pricing.py +15 -4
  57. package/modules/localmodels/library_serve.py +342 -70
  58. package/modules/localmodels/library_smoke.py +63 -5
  59. package/modules/localmodels/library_state.py +48 -10
  60. package/modules/localmodels/library_status.py +37 -17
  61. package/modules/localmodels/llm_rank.py +22 -11
  62. package/modules/localmodels/metal.py +1 -2
  63. package/modules/localmodels/plan_envelope.py +40 -13
  64. package/modules/localmodels/planning/budget.py +14 -12
  65. package/modules/localmodels/planning/memory_pools.py +7 -1
  66. package/modules/localmodels/privacy_acceptance.py +6 -5
  67. package/modules/localmodels/probe.py +34 -7
  68. package/modules/localmodels/py.typed +0 -0
  69. package/modules/localmodels/quant_formats.py +10 -3
  70. package/modules/localmodels/recommend_cli.py +1 -1
  71. package/modules/localmodels/records.py +19 -2
  72. package/modules/localmodels/remote_ops_launchd.py +8 -1
  73. package/modules/localmodels/remote_ops_verify.py +91 -24
  74. package/modules/localmodels/runtime_index.py +303 -0
  75. package/modules/localmodels/runtime_process.py +1 -1
  76. package/modules/localmodels/service_deployment.py +2 -4
  77. package/modules/localmodels/service_probe.py +59 -13
  78. package/modules/localmodels/setup_inspection.py +94 -73
  79. package/modules/localmodels/setup_text.py +7 -56
  80. package/modules/localmodels/sidecar_downloads.py +34 -0
  81. package/modules/localmodels/sidecar_http.py +61 -5
  82. package/modules/localmodels/sidecar_state.py +52 -2
  83. package/modules/localmodels/speech_admission.py +20 -4
  84. package/modules/localmodels/speech_catalog.py +23 -0
  85. package/modules/localmodels/speech_cli.py +30 -16
  86. package/modules/localmodels/speech_jobs.py +42 -17
  87. package/modules/localmodels/speech_serve.py +9 -2
  88. package/modules/localmodels/speech_server.py +185 -81
  89. package/modules/localmodels/speech_state.py +4 -1
  90. package/modules/localmodels/speech_workers.py +11 -0
  91. package/modules/localmodels/stack.py +1 -1
  92. package/modules/localmodels/stack_args.py +276 -145
  93. package/modules/localmodels/stack_auto.py +91 -6
  94. package/modules/localmodels/stack_aux_gpu.py +1 -1
  95. package/modules/localmodels/stack_cleanup.py +21 -18
  96. package/modules/localmodels/stack_cli.py +120 -115
  97. package/modules/localmodels/stack_compose.py +16 -5
  98. package/modules/localmodels/stack_debug.py +15 -6
  99. package/modules/localmodels/stack_decision.py +4 -4
  100. package/modules/localmodels/stack_doctor.py +2 -2
  101. package/modules/localmodels/stack_down.py +2 -0
  102. package/modules/localmodels/stack_events.py +1 -1
  103. package/modules/localmodels/stack_gpu_memory.py +1 -1
  104. package/modules/localmodels/stack_hardware.py +17 -15
  105. package/modules/localmodels/stack_mcp.py +1 -2
  106. package/modules/localmodels/stack_mlx.py +8 -1
  107. package/modules/localmodels/stack_picks.py +20 -21
  108. package/modules/localmodels/stack_plan.py +12 -11
  109. package/modules/localmodels/stack_ports.py +31 -4
  110. package/modules/localmodels/stack_review.py +28 -7
  111. package/modules/localmodels/stack_rollback.py +1 -1
  112. package/modules/localmodels/stack_run.py +1 -1
  113. package/modules/localmodels/stack_suite.py +72 -21
  114. package/modules/localmodels/stack_up.py +2 -0
  115. package/modules/localmodels/stack_view.py +180 -35
  116. package/modules/localmodels/stack_view_agent.py +1 -1
  117. package/modules/localmodels/stack_view_demo.py +2 -0
  118. package/modules/localmodels/stack_view_gpu.py +36 -2
  119. package/modules/localmodels/stack_view_schema.py +26 -3
  120. package/modules/localmodels/stack_view_serve.py +0 -2
  121. package/modules/localmodels/stack_view_slots.py +3 -1
  122. package/modules/localmodels/stack_view_telemetry.py +90 -4
  123. package/modules/localmodels/stack_view_tick.py +246 -40
  124. package/modules/localmodels/stack_view_words.py +9 -2
  125. package/modules/localmodels/stack_warm.py +2 -2
  126. package/modules/localmodels/stack_whatif.py +524 -41
  127. package/modules/localmodels/stack_whatif_html.py +900 -0
  128. package/modules/localmodels/startlux-decide-83fe6c7d.txt +2 -2
  129. package/modules/localmodels/{strata-poly-serve-0.2.20-poly.7.txt → strata-poly-serve-0.2.20-poly.9.txt} +1 -1
  130. package/modules/localmodels/strata_poly_server.py +114 -3
  131. package/modules/localmodels/suite.py +265 -6
  132. package/modules/localmodels/telemetry_math.py +458 -18
  133. package/modules/localmodels/transport.py +8 -1
  134. package/modules/localmodels/tts_admission.py +2 -17
  135. package/modules/localmodels/tts_catalog.py +29 -1
  136. package/modules/localmodels/tts_cli.py +45 -22
  137. package/modules/localmodels/tts_http.py +10 -4
  138. package/modules/localmodels/tts_jobs.py +49 -19
  139. package/modules/localmodels/tts_serve.py +9 -2
  140. package/modules/localmodels/tts_server.py +1 -1
  141. package/modules/localmodels/tts_sidecar.py +69 -28
  142. package/modules/localmodels/tts_state.py +7 -2
  143. package/modules/localmodels/vision.py +5 -3
  144. package/modules/localmodels/web/view/ASSET-SOURCES.md +4 -7
  145. package/modules/localmodels/web/view/view.css +0 -1
  146. package/modules/localmodels/web/view/view.js +2 -5
  147. package/modules/localmodels/web/whatif/app.js +730 -0
  148. package/modules/localmodels/web/whatif/page.html +1172 -0
  149. package/modules/localmodels/web/whatif/sim.js +297 -0
  150. package/modules/localmodels/win_probe.py +89 -16
  151. package/modules/localmodels/windows_job.py +179 -11
  152. package/modules/simplex_localmodels-0.1.0.dev105.dist-info/METADATA +14 -0
  153. package/modules/{simplex_localmodels-0.1.0.dev103.dist-info → simplex_localmodels-0.1.0.dev105.dist-info}/RECORD +151 -145
  154. package/modules/simplex_localmodels-0.1.0.dev105.dist-info/licenses/LICENSE +201 -0
  155. package/modules/simplex_localmodels-0.1.0.dev105.dist-info/licenses/NOTICE +126 -0
  156. package/package.json +11 -2
  157. package/tool.json +1 -1
  158. package/modules/localmodels/engines-strata-poly-0.2.20-poly.7.json +0 -94
  159. package/modules/localmodels/fixtures/stack-research-demo-plan.json +0 -1059
  160. package/modules/localmodels/stack_research.py +0 -716
  161. package/modules/localmodels/stack_research_demo.py +0 -125
  162. package/modules/localmodels/stack_research_plan.py +0 -146
  163. package/modules/localmodels/web/index.html +0 -2605
  164. package/modules/localmodels/web/sizecalc/app.js +0 -1306
  165. package/modules/localmodels/web/sizecalc/calc.js +0 -269
  166. package/modules/localmodels/web/sizecalc/page.html +0 -520
  167. package/modules/localmodels/web/view/logo-claude.svg +0 -3
  168. package/modules/localmodels/web/view/logo-codex.png +0 -0
  169. package/modules/simplex_localmodels-0.1.0.dev103.dist-info/METADATA +0 -9
  170. /package/modules/{simplex_localmodels-0.1.0.dev103.dist-info → simplex_localmodels-0.1.0.dev105.dist-info}/WHEEL +0 -0
  171. /package/modules/{simplex_localmodels-0.1.0.dev103.dist-info → simplex_localmodels-0.1.0.dev105.dist-info}/entry_points.txt +0 -0
  172. /package/modules/{simplex_localmodels-0.1.0.dev103.dist-info → simplex_localmodels-0.1.0.dev105.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
@@ -1,520 +0,0 @@
1
- <!doctype html>
2
- <html lang="zh-CN">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1">
6
- <meta name="color-scheme" content="light dark">
7
- <title>模型体量计算器</title>
8
- <script>try{var t=localStorage.getItem("localmodels.theme")||localStorage.getItem("lm-sizecalc-theme")||localStorage.getItem("lm-theme");if(t==="light"||t==="dark")document.documentElement.dataset.theme=t;}catch(e){}</script>
9
- <style>
10
- /* Layout: a control rail on the left, the answer on the right. The answer leads with the class
11
- of device (the magnitude), then the memory ruler that shows why, then the selected device's
12
- memory, the same model in other formats, and the method. */
13
- :root {
14
- --bg: #f4f4f6;
15
- --surface: #ffffff;
16
- --surface-2: #f9f9fb;
17
- --ink: #1c1c21;
18
- --ink-2: #4a4a53;
19
- --muted: #5e5e68;
20
- --line: #e3e3e8;
21
- --line-2: #d0d0d8;
22
- --accent: #4f46e5;
23
- --accent-wash: #eeedfd;
24
- --good: #16713c;
25
- --warn: #985100;
26
- --bad: #d70015;
27
- --none: #8b8b94;
28
- --s-w: #6366f1;
29
- --s-kv: #0d9488;
30
- --s-ov: #64748b;
31
- --s-off: #d97706;
32
- --f-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, "PingFang SC",
33
- "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
34
- --f-num: var(--f-sans);
35
- --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
36
- --r: 12px;
37
- --r-sm: 8px;
38
- }
39
- @media (prefers-color-scheme: dark) {
40
- :root:not([data-theme="light"]) {
41
- --bg: #121215; --surface: #1b1b1e; --surface-2: #232327; --ink: #ececf0; --ink-2: #c2c2c9; --muted: #aaaab4;
42
- --line: #34343a; --line-2: #44444d; --accent: #9b95ff; --accent-wash: #2e2b52;
43
- --good: #4ade80; --warn: #fdba74; --bad: #fb7185; --none: #737380;
44
- --s-w: #6366f1; --s-kv: #0d9488; --s-ov: #64748b; --s-off: #f59e0b; color-scheme: dark;
45
- }
46
- }
47
- :root[data-theme="light"] { color-scheme: light; }
48
- :root[data-theme="dark"] {
49
- --bg: #121215; --surface: #1b1b1e; --surface-2: #232327; --ink: #ececf0; --ink-2: #c2c2c9; --muted: #aaaab4;
50
- --line: #34343a; --line-2: #44444d; --accent: #9b95ff; --accent-wash: #2e2b52;
51
- --good: #4ade80; --warn: #fdba74; --bad: #fb7185; --none: #737380;
52
- --s-w: #6366f1; --s-kv: #0d9488; --s-ov: #64748b; --s-off: #f59e0b; color-scheme: dark;
53
- }
54
- @media (prefers-reduced-motion: reduce) {
55
- *, *::before, *::after { animation: none !important; transition: none !important; }
56
- }
57
- * { box-sizing: border-box; }
58
- [hidden] { display: none !important; }
59
- .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
60
- html { -webkit-text-size-adjust: 100%; }
61
- body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-sans); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
62
- .page { max-width: 1320px; margin: 0 auto; padding-block: 28px 64px;
63
- padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
64
- h1, h2, h3 { text-wrap: balance; margin: 0; }
65
- h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 700; letter-spacing: -0.015em; }
66
- h2 { font-size: 16px; font-weight: 650; }
67
- h3 { font-size: 14px; font-weight: 650; }
68
- p { margin: 0; }
69
- code, .mono { font-family: var(--f-mono); font-size: 0.9em; }
70
- a { color: var(--accent); }
71
- .mast { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 22px; }
72
- .eyebrow { font-size: 12px; letter-spacing: 0.08em; color: var(--muted); font-weight: 500; text-wrap: pretty; }
73
- .lede { color: var(--ink-2); font-size: 14.5px; max-width: 76ch; }
74
- .mast-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; }
75
- .mast-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
76
- @media (max-width: 639px) { .mast-actions { margin-left: 0; } }
77
- .theme { font: inherit; font-size: 12px; padding: 5px 11px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: border-color 0.15s, background 0.15s, color 0.15s; }
78
- .theme:hover { color: var(--ink); border-color: var(--ink-2); }
79
- .theme[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); font-weight: 600; }
80
- .theme.done, .cmd button.done { border-color: color-mix(in srgb, var(--good) 50%, var(--line)); background: color-mix(in srgb, var(--good) 12%, var(--surface)); color: var(--good); }
81
- .bench { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
82
- @media (min-width: 1040px) { .bench { grid-template-columns: 320px minmax(0, 1fr); } }
83
-
84
- /* mobile sticky summary (< 1040px) */
85
- .mobile-summary {
86
- position: sticky; top: 0; z-index: 15; display: none;
87
- align-items: center; justify-content: space-between; gap: 10px;
88
- padding: 9px 12px; margin-bottom: 14px;
89
- background: color-mix(in srgb, var(--surface) 94%, transparent);
90
- backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
91
- border: 1px solid var(--line-2); border-radius: var(--r-sm);
92
- box-shadow: 0 4px 14px rgb(0 0 0 / 0.08);
93
- font-size: 12.5px; font-variant-numeric: tabular-nums;
94
- }
95
- .mobile-summary.is-stale { opacity: 0.65; border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
96
- .mobile-summary-vals { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 7px; min-width: 0; color: var(--ink-2); }
97
- .mobile-summary-vals b { color: var(--ink); font-weight: 650; }
98
- .mobile-summary-vals .ms-sep { color: var(--muted); }
99
- .mobile-summary-jump {
100
- flex: 0 0 auto; font: inherit; font-size: 12px; font-weight: 600;
101
- padding: 4px 10px; border-radius: 999px;
102
- border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
103
- background: var(--accent-wash); color: var(--accent); cursor: pointer; white-space: nowrap;
104
- transition: background 0.15s, color 0.15s, border-color 0.15s;
105
- }
106
- .mobile-summary-jump:hover { background: var(--accent); color: var(--surface); border-color: var(--accent); }
107
- @media (max-width: 1039px) {
108
- .mobile-summary { display: flex; }
109
- .results { scroll-margin-top: 56px; }
110
- }
111
-
112
- /* controls */
113
- .controls { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 16px 16px; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; }
114
- @media (min-width: 1040px) {
115
- .controls { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
116
- }
117
- .group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-block: 14px; border-bottom: 1px solid var(--line); min-width: 0; }
118
- .group:last-child { border-bottom: 0; }
119
- .group > .gt { font-size: 11px; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; }
120
- .field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; min-width: 0; }
121
- .field > label, .field > .lab { font-size: 12.5px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
122
- .field .val { font-family: var(--f-mono); color: var(--ink); font-size: 12.5px; font-variant-numeric: tabular-nums; }
123
- select, input[type="number"], input[type="text"], input[type="search"] {
124
- width: 100%; min-width: 0; font: inherit; font-size: 13.5px; color: var(--ink); background: var(--bg);
125
- border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 6px 9px; }
126
- input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
127
- select { padding-right: 28px; text-overflow: ellipsis; }
128
- select:focus-visible, input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
129
- input[type="range"] { width: 100%; accent-color: var(--accent); margin: 2px 0; }
130
- .field.is-inferred input, .field.is-inferred select { opacity: 0.56; cursor: not-allowed; border-style: dashed; }
131
- .infer-note { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11.5px; color: var(--accent); background: var(--accent-wash); border-radius: 6px; padding: 3px 7px; font-variant-numeric: tabular-nums; }
132
- .hint-row { display: inline-flex; align-items: center; gap: 6px; }
133
- .link-btn { font: inherit; font-size: 11.5px; color: var(--accent); background: transparent; border: 0; padding: 0 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
134
- .link-btn:hover { opacity: 0.8; }
135
- .seg { display: flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
136
- .seg input { position: absolute; opacity: 0; pointer-events: none; }
137
- .seg label { flex: 1 1 0; text-align: center; padding: 5px 4px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); border-right: 1px solid var(--line-2); white-space: nowrap; background: var(--bg); }
138
- .seg label:last-of-type { border-right: 0; }
139
- .seg input:checked + label { background: var(--ink); color: var(--surface); }
140
- .seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: -2px; }
141
- .row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
142
- .hint { font-size: 12px; color: var(--muted); }
143
- .err { margin-top: 10px; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); background: color-mix(in srgb, var(--bad) 9%, var(--surface)); color: var(--bad); font-size: 12px; }
144
- .presets { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
145
- .preset-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
146
- .preset-glabel { font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0.02em; }
147
- .preset-chips { display: flex; flex-wrap: wrap; gap: 5px; }
148
- .presets button { font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background 0.12s, color 0.12s, border-color 0.12s; }
149
- .presets button:hover { color: var(--ink); border-color: var(--ink-2); }
150
- .presets button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
151
-
152
- /* results */
153
- .results { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
154
- .results.is-stale > :not(.stale-banner) { opacity: 0.42; pointer-events: none; transition: opacity 0.15s; }
155
- .stale-banner { padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); color: color-mix(in srgb, var(--warn) 82%, var(--ink)); font-size: 12.5px; font-weight: 500; }
156
- .compare-bar { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; font-size: 12.5px; }
157
- .compare-base { color: var(--ink-2); }
158
- .compare-base b { color: var(--ink); }
159
- .compare-deltas { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 auto; }
160
- .compare-unpin { margin-left: auto; font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: border-color 0.12s, color 0.12s, background 0.12s; }
161
- .compare-unpin:hover { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
162
- .delta-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-family: var(--f-mono); font-size: 12px; font-variant-numeric: tabular-nums; border: 1px solid var(--line); }
163
- .delta-up { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
164
- .delta-down { color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
165
- .delta-up.better { color: var(--good); background: color-mix(in srgb, var(--good) 10%, var(--surface)); border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
166
- .delta-down.worse { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
167
- .delta-flat { color: var(--muted); background: var(--bg); }
168
- .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
169
- @media (max-width: 600px) { .panel { padding: 14px; } }
170
- .panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
171
- .panel-head p { color: var(--muted); font-size: 12.5px; }
172
- .readouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
173
- @media (max-width: 760px) { .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
174
- .tile { background: var(--surface); padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; align-content: start; min-width: 0; }
175
- .tile .tl { font-size: 12px; color: var(--muted); }
176
- .tile .tv { font-family: var(--f-num); font-size: clamp(19px, 2vw, 24px); font-weight: 650; line-height: 1.2; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; overflow-wrap: break-word; text-wrap: balance; }
177
- .tile .tv small { font-size: 0.56em; font-weight: 500; color: var(--ink-2); margin-left: 3px; }
178
- .tile .ts { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
179
- .tile.hero { background: var(--accent-wash); }
180
- .pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 1px 8px 1px 6px; border-radius: 999px; width: fit-content; white-space: nowrap; }
181
- .pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
182
- .pill.fits { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
183
- .pill.offload { color: var(--warn); background: color-mix(in srgb, var(--s-off) 18%, transparent); }
184
- .pill.no { color: var(--muted); background: color-mix(in srgb, var(--none) 18%, transparent); }
185
- .tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; white-space: nowrap; }
186
- .tag[title] { cursor: help; }
187
- .tag.convert { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
188
- .tag.fallback { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
189
-
190
- .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
191
- .legend span { display: inline-flex; align-items: center; gap: 6px; }
192
- .legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
193
- .legend i.sq { border-radius: 3px; }
194
- .legend i.over-swatch { border-radius: 3px; border: 1px solid color-mix(in srgb, var(--bad) 65%, transparent); background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 45%, transparent) 0 2px, transparent 2px 5px); }
195
- .legend i.line { width: 16px; height: 0; border-radius: 0; border-top: 2px solid var(--ink); }
196
- .legend i.dash { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed var(--muted); }
197
-
198
- /* the memory ruler */
199
- .chart-wrap { position: relative; min-width: 0; }
200
- #ruler { width: 100%; height: auto; display: block; overflow: visible; }
201
- #ruler text { font-family: var(--f-mono); font-size: 11px; fill: var(--muted); }
202
- #ruler .tl { font-family: var(--f-sans); fill: var(--ink-2); font-size: 12px; }
203
- #ruler .dl { font-family: var(--f-sans); fill: var(--ink-2); font-size: 10.5px; }
204
- #ruler .need { font-family: var(--f-sans); fill: var(--ink); font-size: 12px; font-weight: 600; }
205
- #ruler .halo { paint-order: stroke; stroke: var(--surface); stroke-width: 3.5px; stroke-linejoin: round; }
206
- #ruler .dev { cursor: pointer; outline: none; }
207
- #ruler .dev .sel-ring { fill: none; stroke: var(--accent); stroke-width: 2.2px; pointer-events: none; }
208
- #ruler .dev:focus-visible circle.dot { stroke: var(--accent); stroke-width: 3px; }
209
- .tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.16); min-width: 200px; max-width: min(290px, calc(100% - 8px)); display: grid; gap: 3px; z-index: 4; }
210
- .tip-dev { display: grid; gap: 3px; }
211
- .tip-dev + .tip-dev, .tip-dev.tip-sep { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
212
- .tip .th { font-weight: 600; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
213
- .tip .tip-cur { font-size: 10.5px; font-weight: 600; color: var(--accent); background: var(--accent-wash); border-radius: 4px; padding: 0 5px; }
214
- .tip .tip-hint { border-top: 1px dashed var(--line); padding-top: 5px; margin-top: 4px; font-size: 11px; color: var(--muted); }
215
- .tip .tr { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
216
- .tip .tr span:first-child { color: var(--ink-2); }
217
-
218
- /* device filter bar */
219
- .dev-filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 4px; }
220
- .filter-seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
221
- .filter-btn { font: inherit; font-size: 12px; padding: 5px 11px; border: 0; border-right: 1px solid var(--line-2); background: var(--bg); color: var(--ink-2); cursor: pointer; white-space: nowrap; transition: background 0.12s, color 0.12s; }
222
- .filter-btn:last-child { border-right: 0; }
223
- .filter-btn:hover { color: var(--ink); }
224
- .filter-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); font-weight: 600; }
225
- .filter-search-wrap { position: relative; flex: 1 1 180px; max-width: 280px; min-width: 0; }
226
- .filter-search-wrap input { font-size: 12.5px; padding: 5px 28px 5px 10px; }
227
- .filter-clear { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); border: 0; background: transparent; color: var(--muted); font-size: 15px; line-height: 1; padding: 2px 5px; border-radius: 4px; cursor: pointer; }
228
- .filter-clear:hover { color: var(--ink); background: var(--line); }
229
- .filter-count { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
230
- @media (max-width: 600px) {
231
- .filter-search-wrap { max-width: none; }
232
- .filter-count { margin-left: 0; }
233
- }
234
-
235
- .table-wrap, .scroll { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; }
236
- table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }
237
- th, td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
238
- th { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; white-space: nowrap; }
239
- td.n, th.n { text-align: right; font-family: var(--f-mono); font-size: 12.5px; white-space: nowrap; }
240
- tr.cur td { background: var(--accent-wash); }
241
- tr.tierhead td { font-weight: 600; color: var(--ink); padding-top: 14px; border-bottom: 1px solid var(--line-2); }
242
- tr.tierhead td span { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
243
- tr.empty-row td { text-align: center; padding: 20px 10px; color: var(--muted); }
244
- tbody tr.dev { cursor: pointer; }
245
- tbody tr.dev:hover td { background: color-mix(in srgb, var(--accent-wash) 60%, transparent); }
246
- tbody tr.dev:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
247
-
248
- /* memory bar of one device */
249
- .mbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
250
- .mbar .mh { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; font-variant-numeric: tabular-nums; }
251
- .mbar .mh b { color: var(--ink); font-weight: 600; }
252
- .mbar .mh .oom-note { color: var(--bad); }
253
- .bar-label { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
254
- .bar-label b { color: var(--ink); font-weight: 600; }
255
- .bar-label.host-label { color: color-mix(in srgb, var(--warn) 85%, var(--ink)); padding-top: 2px; }
256
- .bar { position: relative; height: 30px; display: flex; gap: 2px; margin-top: 24px; margin-bottom: 16px; }
257
- .bar.host-bar { height: 22px; margin-top: 20px; margin-bottom: 10px; }
258
- .bar.host-bar .mark { border-left-color: var(--s-off); }
259
- .bar.host-bar .mark span { color: var(--warn); }
260
- .bar > div { height: 100%; min-width: 0; border-radius: 3px; }
261
- .bar .free { border: 1px dashed var(--line-2); }
262
- .bar .over { position: absolute; top: 0; height: 100%; pointer-events: none; border-radius: 0 4px 4px 0; border: 1px solid color-mix(in srgb, var(--bad) 70%, transparent); border-left: 0; background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--bad) 36%, transparent) 0 4px, color-mix(in srgb, var(--bad) 10%, transparent) 4px 8px); z-index: 1; }
263
- .bar .mark { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 2px solid var(--ink); z-index: 2; }
264
- .bar.is-over .mark { border-left-color: var(--bad); }
265
- .bar .mark span { position: absolute; top: -19px; transform: translateX(-50%); font-size: 11px; white-space: nowrap; color: var(--ink); background: var(--surface); padding: 0 3px; font-variant-numeric: tabular-nums; }
266
- .bar.is-over .mark span { color: var(--bad); font-weight: 600; }
267
- .bar .mark.end span { transform: translateX(-100%); }
268
- .bar .mark.start span { transform: none; }
269
-
270
- /* the format ladder */
271
- .lad { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
272
- .lad .lr { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 190px); gap: 10px; align-items: center; font-size: 12.5px; padding: 4px 6px; margin: 0 -6px; border-radius: 6px; }
273
- .lad .lr.clickable { cursor: pointer; transition: background 0.12s; }
274
- .lad .lr.clickable:hover { background: color-mix(in srgb, var(--accent-wash) 75%, transparent); }
275
- .lad .lr.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
276
- .lad .lr.on { background: color-mix(in srgb, var(--accent-wash) 50%, transparent); }
277
- .lad .ln { font-family: var(--f-mono); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
278
- .lad .ln small { color: var(--muted); margin-left: 4px; }
279
- .lad .lb { display: flex; align-items: center; gap: 8px; min-width: 0; }
280
- .lad .lb > div { height: 14px; border-radius: 0 4px 4px 0; background: color-mix(in srgb, var(--s-w) 40%, var(--surface)); min-width: 2px; }
281
- .lad .lr.on .lb > div { background: var(--s-w); }
282
- .lad .lr.on .ln { font-weight: 600; }
283
- .lad .lb em { font-style: normal; font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
284
- .lad .lt { color: var(--ink-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
285
- @media (max-width: 600px) {
286
- .lad .lr { grid-template-columns: minmax(0, 1fr); gap: 2px; }
287
- }
288
-
289
- .cmd { position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 84px 10px 12px; font-family: var(--f-mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-all; color: var(--ink); }
290
- .cmd button { position: absolute; top: 7px; right: 7px; font: inherit; font-family: var(--f-sans); font-size: 12px; padding: 3px 10px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; }
291
- .two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
292
- @media (min-width: 900px) { .two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
293
- .prose { display: grid; gap: 10px; max-width: 86ch; color: var(--ink-2); font-size: 13.5px; }
294
- .prose b { color: var(--ink); }
295
- .prose ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
296
- .method-details { display: grid; grid-template-columns: minmax(0, 1fr); }
297
- .method-details > summary {
298
- list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
299
- font-size: 15px; font-weight: 650; color: var(--ink); cursor: pointer; user-select: none;
300
- padding: 2px 0; border-radius: 6px; transition: color 0.12s;
301
- }
302
- .method-details > summary::-webkit-details-marker { display: none; }
303
- .method-details > summary::after { content: "▸"; font-size: 13px; color: var(--muted); transition: transform 0.15s, color 0.15s; }
304
- .method-details[open] > summary::after { transform: rotate(90deg); color: var(--accent); }
305
- .method-details > summary:hover { color: var(--accent); }
306
- .method-details > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
307
- .method-body { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
308
- .notes { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
309
- .notes:empty { display: none; }
310
- </style>
311
- </head>
312
- <body>
313
- <div class="page">
314
- <div id="live-status" class="sr-only" role="status" aria-live="polite"></div>
315
- <header class="mast">
316
- <div class="mast-row">
317
- <div class="eyebrow">LOCALMODELS · SIZECALC · <span style="white-space:nowrap">估算,不是实测</span></div>
318
- <div class="mast-actions">
319
- <button class="theme" id="share-btn" type="button">复制链接</button>
320
- <button class="theme" id="pin-btn" type="button" aria-pressed="false">固定当前方案作对比</button>
321
- <button class="theme" id="theme" type="button">外观:跟随系统</button>
322
- </div>
323
- </div>
324
- <h1>模型体量计算器</h1>
325
- <p class="lede">给出模型是稠密还是 MoE、总参数和激活参数、量化方案,算出权重文件多大、跑起来占多少显存和内存,以及最小能放进哪一档设备:手机、轻薄本、家用 N 卡、大内存 Mac、工作站、单张服务器卡,还是 8 卡服务器。</p>
326
- </header>
327
-
328
- <div class="mobile-summary" id="mobile-summary" role="region" aria-label="实时估算摘要">
329
- <div class="mobile-summary-vals" id="mobile-summary-vals">
330
- <b id="ms-tier">—</b><span class="ms-sep" aria-hidden="true">·</span><span id="ms-run">—</span><span class="ms-sep" aria-hidden="true">·</span><span id="ms-file">—</span>
331
- </div>
332
- <button type="button" class="mobile-summary-jump" id="ms-jump">查看详情 ↓</button>
333
- </div>
334
-
335
- <div class="bench">
336
- <aside class="controls" aria-label="参数">
337
- <div class="err" id="err" role="alert" aria-live="polite" hidden></div>
338
- <div class="group">
339
- <div class="gt">预设模型</div>
340
- <div class="presets" id="presets"></div>
341
- <p class="hint">预设的 KV 每 token 取自各自 config.json;其余参数可以随意改。</p>
342
- </div>
343
- <div class="group">
344
- <div class="gt">模型形状</div>
345
- <div class="seg" role="radiogroup" aria-label="结构">
346
- <input type="radio" name="kind" id="k-dense" value="dense" checked><label for="k-dense">稠密 Dense</label>
347
- <input type="radio" name="kind" id="k-moe" value="moe"><label for="k-moe">混合专家 MoE</label>
348
- </div>
349
- <div class="row2">
350
- <div class="field" id="params-field">
351
- <label for="params">总参数 <span class="hint">B</span></label>
352
- <input type="number" id="params" min="0.05" step="any" value="27">
353
- <div class="infer-note" id="params-inferred" hidden>
354
- <span id="params-inferred-text">由文件大小反推</span>
355
- <button type="button" class="link-btn" id="clear-file-params">恢复手动</button>
356
- </div>
357
- </div>
358
- <div class="field" id="active-field"><label for="active">激活参数 <span class="hint">B</span></label><input type="number" id="active" min="0.05" step="any" value="3"></div>
359
- </div>
360
- <div class="field">
361
- <label for="attention">注意力类型 <span class="val" id="kv-val"></span></label>
362
- <select id="attention">
363
- <option value="full">全注意力 GQA(Llama、Qwen3)</option>
364
- <option value="swa">滑窗混合(Gemma 3、gpt-oss)</option>
365
- <option value="hybrid">线性 / SSM 混合(Qwen3.5+、Nemotron-H)</option>
366
- <option value="mla">MLA 潜向量(DeepSeek、Kimi)</option>
367
- </select>
368
- </div>
369
- <div class="field">
370
- <label for="kvpt">KV 每 token <span class="hint">KiB,f16,留空则按参数估</span></label>
371
- <input type="number" id="kvpt" min="0" step="any" placeholder="自动估算">
372
- </div>
373
- </div>
374
- <div class="group">
375
- <div class="gt">量化</div>
376
- <div class="field" id="quant-field">
377
- <label for="quant">量化方案 <span class="val" id="bits-val"></span></label>
378
- <select id="quant"></select>
379
- <div class="infer-note" id="quant-inferred" hidden>
380
- <span id="quant-inferred-text">由文件大小反推</span>
381
- <button type="button" class="link-btn" id="clear-file-quant">恢复手动</button>
382
- </div>
383
- </div>
384
- <div class="field" id="custom-field" hidden>
385
- <label for="custom-bits">每权重位数 <span class="hint" id="custom-bits-hint">1–32 bpw</span></label>
386
- <input type="number" id="custom-bits" min="1" max="32" step="0.05" value="4.0">
387
- </div>
388
- <div class="field">
389
- <label for="filesize">权重文件大小 <span class="hint-row"><span class="hint">GB,已知则填</span><button type="button" class="link-btn" id="clear-file" hidden>清除</button></span></label>
390
- <input type="number" id="filesize" min="0" step="any" placeholder="按参数 × 位数算">
391
- </div>
392
- <div class="seg" role="radiogroup" aria-label="已知文件大小时反推什么" id="infer-seg">
393
- <input type="radio" name="infer" id="i-bits" value="bits" checked><label for="i-bits">反推位数</label>
394
- <input type="radio" name="infer" id="i-params" value="params"><label for="i-params">反推参数量</label>
395
- </div>
396
- </div>
397
- <div class="group">
398
- <div class="gt">运行姿态</div>
399
- <div class="field">
400
- <label for="ctx">上下文 / 每路 <span class="val" id="ctx-val"></span></label>
401
- <input type="range" id="ctx" min="0" max="8" step="1" value="1" aria-valuetext="8K tokens">
402
- </div>
403
- <div class="row2">
404
- <div class="field"><label for="slots">并发路数</label><input type="number" id="slots" min="1" max="64" step="1" value="1"></div>
405
- <div class="field"><label for="kvtype">KV 类型</label>
406
- <select id="kvtype"><option value="f16">f16 / bf16</option><option value="fp8">fp8</option><option value="q8_0">q8_0</option><option value="q4_0">q4_0</option></select></div>
407
- </div>
408
- <div class="field">
409
- <label for="hostram">PC 系统内存 <span class="hint">GB,给家用卡卸载用</span></label>
410
- <input type="number" id="hostram" min="0" step="8" value="64">
411
- </div>
412
- </div>
413
- </aside>
414
-
415
- <main class="results">
416
- <div class="stale-banner" id="stale-note" role="status" hidden>当前输入有误,下方仍为上一次有效参数的计算结果。</div>
417
- <div class="compare-bar" id="compare-bar" hidden></div>
418
- <section class="readouts" aria-label="结论">
419
- <div class="tile hero"><span class="tl">量级:最小能放进</span><span class="tv" id="r-tier">—</span><span class="ts" id="r-tier-s"></span></div>
420
- <div class="tile"><span class="tl">权重文件</span><span class="tv" id="r-file">—</span><span class="ts" id="r-file-s"></span></div>
421
- <div class="tile"><span class="tl">运行占用(默认引擎)</span><span class="tv" id="r-run">—</span><span class="ts" id="r-run-s"></span></div>
422
- <div class="tile"><span class="tl">每 token 读取</span><span class="tv" id="r-read">—</span><span class="ts" id="r-read-s"></span></div>
423
- </section>
424
- <div class="notes" id="notes"></div>
425
-
426
- <section class="panel">
427
- <div class="panel-head">
428
- <h2>内存标尺:每档设备能给模型多少</h2>
429
- <p>横轴是对数内存(GiB);点是每台设备扣掉系统与引擎预留后的可用量</p>
430
- </div>
431
- <div class="legend">
432
- <span><i style="background:var(--good)"></i>放得下</span>
433
- <span><i style="background:var(--s-off)"></i>借系统内存卸载</span>
434
- <span><i style="background:var(--none)"></i>放不下</span>
435
- <span><i class="line"></i>运行所需(权重 + KV + 引擎)</span>
436
- <span><i class="dash"></i>只算权重</span>
437
- </div>
438
- <div class="chart-wrap" id="ruler-wrap">
439
- <svg id="ruler" role="group" aria-label="各档设备可用内存与模型需求"></svg>
440
- <div class="tip" id="tip" hidden></div>
441
- </div>
442
- </section>
443
-
444
- <section class="panel">
445
- <div class="panel-head">
446
- <h2 id="dev-title">设备明细</h2>
447
- <p>点一行看它的内存拆分。tok/s 是单路 decode 的带宽上限,实测通常只到它的一半到八成</p>
448
- </div>
449
- <div class="mbar" id="mbar"></div>
450
- <div class="dev-filter-bar" id="dev-filter-bar" role="region" aria-label="筛选设备">
451
- <div class="filter-seg" role="group" aria-label="运行状态筛选">
452
- <button type="button" class="filter-btn" id="dev-filter-all" data-filter="all" aria-pressed="true">全部</button>
453
- <button type="button" class="filter-btn" id="dev-filter-runnable" data-filter="runnable" aria-pressed="false">可运行</button>
454
- </div>
455
- <div class="filter-search-wrap">
456
- <input type="search" id="dev-search" placeholder="搜索设备或芯片…" aria-label="搜索设备或芯片" autocomplete="off" spellcheck="false">
457
- <button type="button" class="filter-clear" id="dev-search-clear" aria-label="清除搜索" hidden>×</button>
458
- </div>
459
- <span class="filter-count" id="dev-filter-count" aria-live="polite"></span>
460
- </div>
461
- <div class="table-wrap">
462
- <table id="devtable">
463
- <thead><tr><th scope="col">设备</th><th scope="col">引擎</th><th scope="col">格式</th><th scope="col" class="n">需要 (GiB)</th><th scope="col" class="n">可用 (GiB)</th><th scope="col">结论</th><th scope="col" class="n">tok/s ≤</th></tr></thead>
464
- <tbody></tbody>
465
- </table>
466
- </div>
467
- </section>
468
-
469
- <div class="two">
470
- <section class="panel">
471
- <div class="panel-head"><h2>同一模型换量化</h2><p>点一行切换量化;显示文件大小与最小能放进的档位</p></div>
472
- <div class="lad" id="ladder"></div>
473
- </section>
474
- <section class="panel">
475
- <div class="panel-head"><h2>命令行</h2><p>同一套表和公式</p></div>
476
- <div class="cmd"><span id="cmd"></span><button type="button" id="copy">复制</button></div>
477
- <div class="prose">
478
- <p><code>sizecalc --json</code> 输出 <code>localmodels.sizecalc/v1</code>,<code>--devices all</code> 列出每台设备。具体某个模型的上下文曲线用 <code>memcalc</code>,它也会打印真实的 KV 每 token,可以填回左边。</p>
479
- </div>
480
- </section>
481
- </div>
482
-
483
- <section class="panel">
484
- <div class="panel-head"><h2>量化方案速查</h2><p>典型文件的平均每权重位数,含嵌入和不量化的层</p></div>
485
- <div class="table-wrap">
486
- <table id="fmttable">
487
- <thead><tr><th scope="col">格式</th><th scope="col">家族</th><th scope="col" class="n">bpw</th><th scope="col">来源</th><th scope="col" class="n">1B 参数</th><th scope="col">默认引擎</th><th scope="col">说明</th></tr></thead>
488
- <tbody></tbody>
489
- </table>
490
- </div>
491
- </section>
492
-
493
- <section class="panel" id="method" aria-label="计算口径与术语说明">
494
- <details class="method-details">
495
- <summary>计算口径与术语说明(展开查看)</summary>
496
- <div class="prose method-body">
497
- <ul>
498
- <li><b>权重文件</b> = 总参数 × bpw ÷ 8。bpw 是整个文件的平均值,不是名义位宽:GGUF k-quant 把 output 和部分 attn_v / ffn_down 升到 Q6_K,分组量化每组还要存 scale(和 zero),AWQ / GPTQ / FP8 / NF4 通常把嵌入和 lm_head 留在 16 bit。表里「实测文件 (file)」是 llama.cpp README 中 Llama-3.1-8B 的整文件实测,「块公式 (block)」只算块结构(整文件会再高 0.2–0.8),「推导 (derived)」是张量结构加 16 bit 嵌入、按 30B 级模型推算,「精确 (exact)」是未量化的名义位宽。3B 以下的小模型嵌入占比大,实际文件明显更大(Qwen3-0.6B 的 Q4_K_M 是 5.30 bpw);知道真实文件大小时直接填,最准。</li>
499
- <li><b>KV 缓存</b> = KV 每 token × 上下文 × 路数 × KV 类型系数(f16 = 1,fp8 = ½,q8_0 = 34/64,q4_0 = 18/64)。没填时按激活参数估:128 KiB × (激活参数 / 8B)<sup>0.45</sup>,以 Llama-3.1-8B 为基准,对 70B、32B、235B-A22B、30B-A3B 误差在 20% 内;滑窗混合约取三分之一,线性 / SSM 混合取四分之一,MLA 取不到三分之一。只有 4 个 KV 头的模型(如 Qwen2.5-7B)实际只有估值的一半。</li>
500
- <li><b>引擎开销</b>:llama.cpp 用仓库在 CUDA 上实测的常数(进程 448 MiB + 计算缓冲 612 MiB + 上下文 × 512 × 2 字节);vLLM 估 2 GiB 且只占整卡 92%(<code>gpu_memory_utilization</code> 默认值);MLX 估 1.05 GiB。</li>
501
- <li><b>可用内存</b>:独立显卡扣 1 GiB(分配器余量 + 显示);Mac 取 Metal 默认工作集(仓库实测 16/24 GB 机型为 74%)与「总量 − 系统预留 − 2 GiB」的较小者,再扣 0.5 GiB;安卓按 Android 17 Memory Limiter 给前台 App 的上限(8 / 12 / 16 GB 机型 5 / 8 / 10 GiB);iOS 没有公开数字,暂按一半 RAM,真机以 <code>os_proc_available_memory()</code> 为准。8 卡服务器按张量并行合计。</li>
502
- <li><b>卸载</b>:只算家用 N 卡 + 系统内存,按 llama.cpp 的做法:MoE 把路由专家(<code>--n-cpu-moe</code>)挪到内存,注意力、共享部分和 KV 留在卡上;稠密模型整层连同这些层的 KV(<code>-ngl</code>)挪过去。系统内存要留 4 GiB 和 llama-server 的 0.86 GiB。MoE 按「激活参数里一半在路由专家之外」切分(Qwen3-30B-A3B 1.5 / 3.3B、gpt-oss-120b 2.5 / 5.1B、DeepSeek V3 17 / 37B),Mixtral 这类 8 选 2 的老 MoE 卡上部分会估高。</li>
503
- <li><b>速度上限</b> = 带宽 ÷ 每 token 读取的字节(激活权重 + 一路的 KV);卸载时把显卡和内存两段读取时间相加。多卡忽略通信。</li>
504
- <li><b>格式支持</b>:<span class="tag native">原生</span>(native)原生 kernel;<span class="tag fallback">回退</span>(fallback)能跑但走回退路径(如 Ampere 上的 FP8 Marlin);<span class="tag convert">需转换</span>(convert)这台设备不跑这种格式,按同样大小换成 GGUF / MLX 计算。</li>
505
- </ul>
506
- <p id="refs-intro"><b>参考与对照的现有工具</b>(逐项比较见 <code>research/2026-11-13-model-size-tools.md</code>):</p>
507
- <ul id="refs"></ul>
508
- </div>
509
- </details>
510
- </section>
511
- </main>
512
- </div>
513
- </div>
514
- <script>
515
- /*@DATA@*/
516
- /*@CALC@*/
517
- /*@APP@*/
518
- </script>
519
- </body>
520
- </html>
@@ -1,3 +0,0 @@
1
- <svg width="248" height="248" viewBox="0 0 248 248" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M52.4285 162.873L98.7844 136.879L99.5485 134.602L98.7844 133.334H96.4921L88.7237 132.862L62.2346 132.153L39.3113 131.207L17.0249 130.026L11.4214 128.844L6.2 121.873L6.7094 118.447L11.4214 115.257L18.171 115.847L33.0711 116.911L55.485 118.447L71.6586 119.392L95.728 121.873H99.5485L100.058 120.337L98.7844 119.392L97.7656 118.447L74.5877 102.732L49.4995 86.1905L36.3823 76.62L29.3779 71.7757L25.8121 67.2858L24.2839 57.3608L30.6515 50.2716L39.3113 50.8623L41.4763 51.4531L50.2636 58.1879L68.9842 72.7209L93.4357 90.6804L97.0015 93.6343L98.4374 92.6652L98.6571 91.9801L97.0015 89.2625L83.757 65.2772L69.621 40.8192L63.2534 30.6579L61.5978 24.632C60.9565 22.1032 60.579 20.0111 60.579 17.4246L67.8381 7.49965L71.9133 6.19995L81.7193 7.49965L85.7946 11.0443L91.9074 24.9865L101.714 46.8451L116.996 76.62L121.453 85.4816L123.873 93.6343L124.764 96.1155H126.292V94.6976L127.566 77.9197L129.858 57.3608L132.15 30.8942L132.915 23.4505L136.608 14.4708L143.994 9.62643L149.725 12.344L154.437 19.0788L153.8 23.4505L150.998 41.6463L145.522 70.1215L141.957 89.2625H143.994L146.414 86.7813L156.093 74.0206L172.266 53.698L179.398 45.6635L187.803 36.802L193.152 32.5484H203.34L210.726 43.6549L207.415 55.1159L196.972 68.3492L188.312 79.5739L175.896 96.2095L168.191 109.585L168.882 110.689L170.738 110.53L198.755 104.504L213.91 101.787L231.994 98.7149L240.144 102.496L241.036 106.395L237.852 114.311L218.495 119.037L195.826 123.645L162.07 131.592L161.696 131.893L162.137 132.547L177.36 133.925L183.855 134.279H199.774L229.447 136.524L237.215 141.605L241.8 147.867L241.036 152.711L229.065 158.737L213.019 154.956L175.45 145.977L162.587 142.787H160.805V143.85L171.502 154.366L191.242 172.089L215.82 195.011L217.094 200.682L213.91 205.172L210.599 204.699L188.949 188.394L180.544 181.069L161.696 165.118H160.422V166.772L164.752 173.152L187.803 207.771L188.949 218.405L187.294 221.832L181.308 223.959L174.813 222.777L161.187 203.754L147.305 182.486L136.098 163.345L134.745 164.2L128.075 235.42L125.019 239.082L117.887 241.8L111.902 237.31L108.718 229.984L111.902 215.452L115.722 196.547L118.779 181.541L121.58 162.873L123.291 156.636L123.14 156.219L121.773 156.449L107.699 175.752L86.304 204.699L69.3663 222.777L65.291 224.431L58.2867 220.768L58.9235 214.27L62.8713 208.48L86.304 178.705L100.44 160.155L109.551 149.507L109.462 147.967L108.959 147.924L46.6977 188.512L35.6182 189.93L30.7788 185.44L31.4156 178.115L33.7079 175.752L52.4285 162.873Z" fill="#D97757"/>
3
- </svg>
@@ -1,9 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: simplex-localmodels
3
- Version: 0.1.0.dev103
4
- Summary: Detect hardware, recommend and install a verified local model stack
5
- License-Expression: LicenseRef-Proprietary
6
- License-File: NOTICE
7
- License-File: localmodels/HERMES-LICENSE
8
- Classifier: Private :: Do Not Upload
9
- Requires-Python: >=3.10