Proxy in front of vLLM too; dashboard reset/clear; opencode effort variants
- Move the MLX proxy into backends/proxy.py and run it on both backends: public port 1134 is the proxy, the model server listens on 127.0.0.1:1135. On vLLM this brings the reasoning chooser, the "default" alias and the per-request table. Effort levels the model lacks map to the nearest it has (high -> xhigh on qwen3.8); vLLM's own key is sent upstream; streamed runs are counted from the usage chunk (MTP packs several tokens per chunk). - Dashboard: restore METRIC_RE (vLLM page stuck on "loading"); Statistics header with Reset, Requests header with Clear; drop the TTFT chart; rename token columns; Peak KV shows "-" when no samples cover a run. - opencode: config snippet's model points at <provider>/default, and reasoning models get variants built from the levels the template accepts. - README: proxy on both platforms; NVIDIA checklist split into verified / open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1121c3f908
commit
8879db44a0
12 changed files with 886 additions and 493 deletions
|
|
@ -49,6 +49,10 @@ h1 span { color: var(--muted); font-weight: 500; }
|
|||
.meta { color: var(--muted); font-size: 12.5px; }
|
||||
|
||||
.grid { display: grid; gap: 14px; }
|
||||
.section-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 -2px; }
|
||||
.section-head h2 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
|
||||
.section-head .sub { color: var(--muted); font-size: 12px; }
|
||||
button.small { font-size: 12px; padding: 4px 10px; }
|
||||
.top { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
|
||||
@media (max-width: 820px) { .top { grid-template-columns: minmax(0, 1fr); } }
|
||||
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; min-width: 0; }
|
||||
|
|
@ -105,9 +109,7 @@ button.danger { color: var(--bad); }
|
|||
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s; }
|
||||
|
||||
.charts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
|
||||
.charts.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
||||
@media (max-width: 1100px) { .charts.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
||||
@media (max-width: 820px) { .charts, .charts.four { grid-template-columns: minmax(0, 1fr); } }
|
||||
@media (max-width: 820px) { .charts { grid-template-columns: minmax(0, 1fr); } }
|
||||
.chart .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
|
||||
.chart .head span { font-size: 12px; color: var(--muted); }
|
||||
.chart .head b { font-size: 13px; font-variant-numeric: tabular-nums; }
|
||||
|
|
@ -126,9 +128,6 @@ button.danger { color: var(--bad); }
|
|||
.chart .axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 4px; }
|
||||
|
||||
.runs { margin-top: 14px; }
|
||||
.runs .head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
|
||||
.runs .head h2 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
|
||||
.runs .head .sub { color: var(--muted); font-size: 12px; }
|
||||
.runs .scroll { overflow-x: auto; }
|
||||
.runs table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
|
||||
.runs th, .runs td { padding: 5px 10px 5px 0; text-align: right; white-space: nowrap; }
|
||||
|
|
@ -202,6 +201,13 @@ pre {
|
|||
</section>
|
||||
</div>
|
||||
|
||||
<div class="section-head">
|
||||
<h2>Statistics</h2>
|
||||
<span class="sub" id="stats-since"></span>
|
||||
<span class="spacer"></span>
|
||||
<button id="btn-stats-reset" class="small" title="Empty the charts and count totals and averages from now">Reset</button>
|
||||
</div>
|
||||
|
||||
<div class="grid tiles">
|
||||
<div class="tile"><div class="k">Generation</div><div class="v" id="t-gen">—</div><div class="s" id="t-gen-s"></div></div>
|
||||
<div class="tile"><div class="k">Prompt processing</div><div class="v" id="t-prompt">—</div><div class="s" id="t-prompt-s"></div></div>
|
||||
|
|
@ -214,10 +220,9 @@ pre {
|
|||
<div class="tile"><div class="k">Prefix cache hits</div><div class="v" id="t-prefix">—</div><div class="s">prompt tokens reused</div></div>
|
||||
</div>
|
||||
|
||||
<div class="grid charts four">
|
||||
<div class="grid charts">
|
||||
<div class="panel chart"><div class="head"><span>Generation tok/s</span><b id="c-gen-v"></b></div><svg id="c-gen" viewBox="0 0 300 90" preserveAspectRatio="none"></svg><div class="axis"><span>10 min ago</span><span>now</span></div></div>
|
||||
<div class="panel chart"><div class="head"><span>Prompt processing tok/s</span><b id="c-prompt-v"></b></div><svg id="c-prompt" viewBox="0 0 300 90" preserveAspectRatio="none"></svg><div class="axis"><span>10 min ago</span><span>now</span></div></div>
|
||||
<div class="panel chart"><div class="head"><span>Time to first token</span><b id="c-ttft-v"></b></div><svg id="c-ttft" viewBox="0 0 300 90" preserveAspectRatio="none"></svg><div class="axis"><span>10 min ago</span><span>now</span></div></div>
|
||||
<div class="panel chart"><div class="head"><span>KV cache %</span><b id="c-kv-v"></b></div><svg id="c-kv" viewBox="0 0 300 90" preserveAspectRatio="none"></svg><div class="axis"><span>10 min ago</span><span>now</span></div></div>
|
||||
</div>
|
||||
<div class="grid charts" id="gpu-charts">
|
||||
|
|
@ -227,17 +232,20 @@ pre {
|
|||
<div class="panel chart" id="p-nogpu" hidden><div class="head"><span>GPU temperature & power</span></div><div class="empty" id="nogpu-why">not available on this hardware</div></div>
|
||||
</div>
|
||||
|
||||
<div class="section-head">
|
||||
<h2>Requests</h2>
|
||||
<span class="sub" id="runs-sub"></span>
|
||||
<span class="spacer"></span>
|
||||
<button id="btn-runs-clear" class="small" title="Empty this table">Clear</button>
|
||||
</div>
|
||||
|
||||
<section class="panel runs" id="runs">
|
||||
<div class="head">
|
||||
<h2>Completed requests</h2>
|
||||
<span class="sub" id="runs-sub"></span>
|
||||
</div>
|
||||
<div class="scroll">
|
||||
<table>
|
||||
<thead><tr>
|
||||
<th>Finished</th><th>Duration</th><th>TTFT</th>
|
||||
<th>Prompt</th><th>Prompt tok/s</th>
|
||||
<th>Generated</th><th>Gen tok/s</th><th>Peak KV</th>
|
||||
<th>Prompt tok</th><th>Prompt tok/s</th>
|
||||
<th>Generated tok</th><th>Gen tok/s</th><th>Peak KV</th>
|
||||
</tr></thead>
|
||||
<tbody id="runs-body"></tbody>
|
||||
<tfoot id="runs-foot"></tfoot>
|
||||
|
|
@ -377,6 +385,8 @@ function render(s) {
|
|||
|
||||
const m = s.metrics || {}, g = s.gpu || {};
|
||||
const live = s.phase === "ready";
|
||||
$("stats-since").textContent = s.stats_since
|
||||
? "since " + new Date(s.stats_since * 1000).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : "";
|
||||
setV("t-gen", live ? fmt.n(m.gen_tps, m.gen_tps < 10 ? 1 : 0) : "—", "tok/s");
|
||||
$("t-gen-s").textContent = live && m.gen_total != null ? fmt.big(m.gen_total) + " generated" : "";
|
||||
setV("t-prompt", live ? fmt.n(m.prompt_tps, 0) : "—", "tok/s");
|
||||
|
|
@ -406,7 +416,6 @@ function render(s) {
|
|||
chartTimes = h.map((p) => p.t);
|
||||
chart("c-gen", h.map((p) => p.gen), "var(--c1)", null, (v) => fmt.n(v, 0) + " tok/s");
|
||||
chart("c-prompt", h.map((p) => p.prompt), "var(--c6)", null, (v) => fmt.n(v, 0) + " tok/s");
|
||||
chart("c-ttft", h.map((p) => p.ttft), "var(--c7)", null, (v) => fmt.secs(v));
|
||||
chart("c-util", h.map((p) => p.util), "var(--c2)", 100, (v) => fmt.pct(v));
|
||||
chart("c-kv", h.map((p) => p.kv), "var(--c3)", null, (v) => fmt.n(v, 1) + "%");
|
||||
// Fixed scales so the shape means something: 0–100 °C, and 0 to the board power limit.
|
||||
|
|
@ -416,7 +425,6 @@ function render(s) {
|
|||
$("p-temp").hidden = !hasTP;
|
||||
$("p-power").hidden = !hasTP;
|
||||
$("p-nogpu").hidden = hasTP;
|
||||
$("gpu-charts").classList.toggle("four", false);
|
||||
if (!hasTP) {
|
||||
$("nogpu-why").textContent = s.kind === "apple"
|
||||
? "macOS only exposes GPU temperature and power to root (powermetrics), so they aren't charted here."
|
||||
|
|
@ -437,8 +445,8 @@ let effortBusy = false;
|
|||
function renderEffort(s) {
|
||||
const r = s.reasoning || {}, box = $("effort"), sel = $("effort-sel");
|
||||
const opts = r.options || [];
|
||||
// Hidden rather than disabled when there is nothing to choose: on vLLM there's no proxy
|
||||
// to inject the kwarg, and a model whose template has no switches has nothing to offer.
|
||||
// Hidden rather than disabled when there is nothing to choose: a model whose template
|
||||
// has no switches has nothing to offer.
|
||||
box.hidden = !opts.length && !r.why;
|
||||
if (!opts.length) {
|
||||
sel.innerHTML = "";
|
||||
|
|
@ -483,12 +491,12 @@ $("effort-sel").onchange = async (e) => {
|
|||
|
||||
function renderRuns(s) {
|
||||
const runs = s.runs || [], body = $("runs-body"), foot = $("runs-foot");
|
||||
$("btn-runs-clear").disabled = !runs.length;
|
||||
$("runs-empty").hidden = runs.length > 0;
|
||||
$("runs").hidden = s.backend !== "mlx" && runs.length === 0;
|
||||
body.textContent = "";
|
||||
foot.textContent = "";
|
||||
if (!runs.length) {
|
||||
$("runs-sub").textContent = s.backend === "mlx" ? "" : "per-request timings are only collected on MLX";
|
||||
$("runs-sub").textContent = "";
|
||||
return;
|
||||
}
|
||||
const clock = (t) => new Date(t * 1000).toLocaleTimeString(undefined, { hour12: false });
|
||||
|
|
@ -647,6 +655,12 @@ async function ctl(kind, confirmMsg) {
|
|||
}
|
||||
$("btn-stop").onclick = () => ctl("stop", "Stop the model server? This frees GPU memory; clients won't work until you start it again.");
|
||||
$("btn-start").onclick = () => ctl("start");
|
||||
$("btn-stats-reset").onclick = async () => {
|
||||
try { await api("/api/stats/reset", { method: "POST" }); poll(); } catch (e) { toast("Reset failed: " + e.message); }
|
||||
};
|
||||
$("btn-runs-clear").onclick = async () => {
|
||||
try { await api("/api/runs/clear", { method: "POST" }); poll(); } catch (e) { toast("Clear failed: " + e.message); }
|
||||
};
|
||||
$("btn-restart").onclick = () => ctl("restart", "Restart the model server? It takes a few minutes to come back.");
|
||||
|
||||
async function loadLogs() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue