usage, gui: Codex rows tell the least they wrote at: a call in a turn of several over its whole time, a turn of one call that reasoned by its answer after the first token (Fallmonkey on Discord)
Codex's session rows told no floor. A call in a turn of several could be
timed from inside itself; the commit before this one times it from what
asked for it, before its first output item, to its last, as Claude Code's
is. So Codex joins usage.FloorAgents and app.js's LED_FLOOR_AGENTS, and
such a call tells its output over its whole time, by the same 1,000-token
rule. On 622 stripped recent rollouts only 4 of 1,367 such calls have
1,000 tokens or more, so the floors will be few, but they are true.
A Codex turn of one call that reasoned has its first token (the turn's
time_to_first_token_ms) but not its first text, so DecodeOf tells no
speed. Fallmonkey asked for its whole output, reasoning too, over the
time after the first token. That reads high: OpenAI's reasoning is
written before the first content, so it isn't in that time. On a gateway
reply of 496 tokens, 224 of them reasoning, 827 ms after a 10.2 s first
token, that is 600 tok/s against a measured answer speed of 415 (the
bug e6dd5d20b fixed). Instead the answer, its output less the reasoning,
which all came after the first token, over that time: 329, a true floor
of the answer's speed. Any size tells one, as the wait isn't in it;
DecodeWindow's bounds still hold. The Requests row's tooltip says so, and
a group's floor tooltip now says the file doesn't say when the answer
began, true of both kinds, in en, zh, zh-TW, ja and de.
The 1,000-token rule stays (Fallmonkey asked for 5 s instead): it bounds
the share of the time the wait for the first token can be, which a
duration doesn't (a 5 s reply can be 4 s of wait). On the owner's
gateway rows, where both are known, a floor of 1,000 tokens or more read
0.40 of the measured speed (n=25), one of 5 s or more 0.18 (n=550). The
reason is in Row.Floor's comment and docs/reference.md.
Tests: TestCodexRowsTellAFloor (new) and TestGroupSpeedSaysHowManyRepliesItIsOf
(sol's 259 calls in turns of several now tell 259 floors at 50) fail on
the old ledger.go. usage-speed-count.test.cjs gains a turn-of-several row
(≥50) and the 496/224 row (≥329, its tooltip) and fails on the old app.js;
usage-session-speed.test.cjs's Codex row now tells its floor.
Ran: go test ./internal/usage ./internal/gui; usage-speed-count,
usage-session-speed, usage-ledger-detail, usage-speed, reasoning-speed,
usage-ledger-fit, usage-model-at-provider, routing-request-metrics,
gui-ja, gui-de, gui-zh-tw and i18n-keys in Chromium and WebKit, at 1400
and 560 px; gofmt -l; GOOS=linux/windows go vet.
This commit is contained in:
+16
-9
@@ -301,15 +301,22 @@ shows the least its reply wrote at instead (`≥98 tok/s`): its output tokens
|
||||
over that whole time, the wait for the first token in it, so the speed after
|
||||
the first token is never under it. Only a reply of 1,000 tokens or more
|
||||
written over a second or more shows one; a shorter reply's wait is too much
|
||||
of its time to tell anything. Only Claude Code's and Claude Desktop's rows
|
||||
show one: their line that asked for a reply is written before it is sent. A
|
||||
Codex call in a turn of several is timed from the last tool output before
|
||||
its token count, and Codex can write the output of a tool that call itself
|
||||
asked for before the count, so its time can begin inside the call and a
|
||||
floor from it could read high; it shows none.
|
||||
A call whose session file timed it (a Codex
|
||||
turn of one call) shows its own speed as before. A floor never mixes into a
|
||||
measured speed: the Speed trend and `magpie usage` count timed calls only.
|
||||
of its time to tell anything; a count of tokens bounds that share, a
|
||||
duration doesn't (a 5 s reply can be 4 s of wait). Claude Code's, Claude
|
||||
Desktop's and Codex's rows show one: Claude's line that asked for a reply is
|
||||
written before it is sent, and a Codex call in a turn of several is timed
|
||||
from what the model had last been given before the call's first output
|
||||
item to its last, never from the output of a tool the call itself ran,
|
||||
which an older rollout writes before the call's token count. OpenCode's rows
|
||||
show none.
|
||||
A call whose session file timed it (a Codex turn of one call) shows its own
|
||||
speed as before. When that call reasoned, the file has its first token but
|
||||
not its first text, so no speed is measured; it shows the least its answer
|
||||
wrote at instead: its output less the reasoning, all written after the first
|
||||
token, over the time from the first token to its end. Its whole output over
|
||||
that time would count reasoning written before the first token and read
|
||||
high. A floor never mixes into a measured speed: the Speed trend and
|
||||
`magpie usage` count timed calls only.
|
||||
|
||||
A group's speed (a row of the Usage page's ranking, by model, provider or
|
||||
agent, its Output speed card, and the overview's lists) says how many
|
||||
|
||||
+19
-13
@@ -16453,7 +16453,7 @@ function ledGroupSpeed(x) {
|
||||
const n = ledNum(Math.round(v || f));
|
||||
const text = (f ? "≥" : "") + (k ? t("{n} tok/s ({k})", { n, k: ledNum(k) }) : t("{n} tok/s", { n }));
|
||||
const title = !k ? "" : v ? t(k === 1 ? "Measured on {k} reply, from its first token to its end; the others tell no speed" : "Measured on {k} replies, from their first token to their end; the others tell no speed", { k: ledNum(k) })
|
||||
: t(k === 1 ? "At least: {k} reply read from a session file, which has no first token, so the wait for it is counted too" : "At least: {k} replies read from session files, which have no first token, so the wait for it is counted too", { k: ledNum(k) });
|
||||
: t(k === 1 ? "At least: {k} reply read from a session file, which doesn't say when its answer began, so time before that is counted too" : "At least: {k} replies read from session files, which don't say when their answers began, so time before that is counted too", { k: ledNum(k) });
|
||||
return { v: v || f, text, title };
|
||||
}
|
||||
// their mean wait for the first token, 0 for none
|
||||
@@ -17103,19 +17103,24 @@ const ledRowSpeed = (r) => { const d = ledDecode(r); return d ? d.n / (d.w / 100
|
||||
// a shorter one or one asked with a tool's result, so only a reply of 1,000
|
||||
// or more is told. 0 when it tells none, and a call magpie timed tells its
|
||||
// own (ledDecode). Only the row's: the period's speed counts timed calls.
|
||||
// Claude Code's and Claude Desktop's files only: a call's time is from the
|
||||
// line that asked it, which is written before it is sent. Codex's call in a
|
||||
// turn of several is timed from the last tool output before its token count,
|
||||
// and Codex writes the output of a tool the call itself asked for before
|
||||
// that count (2,968 of 4,588 calls in a month of real rollouts), so its time
|
||||
// can begin inside the call and its tokens over it read high. OpenCode's
|
||||
// isn't checked against real sessions. They tell none.
|
||||
const LED_FLOOR_AGENTS = new Set(["claude", "claude-desktop"]);
|
||||
const ledFloorSpeed = (r) => {
|
||||
if (r.source !== "log" || !LED_FLOOR_AGENTS.has(r.agent) || ledFailed_(r) || ledRowSpeed(r)) return 0;
|
||||
if (!(r.out >= 1000 && r.ms >= 1000 && r.out * 1000 <= 10000 * r.ms)) return 0;
|
||||
return r.out / (r.ms / 1000);
|
||||
// Claude Code's, Claude Desktop's and Codex's files only (usage.FloorAgents):
|
||||
// a call's time is from what asked for it, never from inside it. OpenCode's
|
||||
// isn't checked against real sessions, and tells none.
|
||||
// A Codex turn of one call that reasoned has its first token but not its
|
||||
// first text (Fallmonkey on Discord): its answer, its output less the
|
||||
// reasoning, all came after the first token, so the answer over the time
|
||||
// after it is a floor of the answer's speed; any size tells one, as the wait
|
||||
// isn't in it. ledFloor_ says the tokens, the ms, and whether it is that.
|
||||
const LED_FLOOR_AGENTS = new Set(["claude", "claude-desktop", "codex"]);
|
||||
const ledFloor_ = (r) => {
|
||||
if (r.source !== "log" || !LED_FLOOR_AGENTS.has(r.agent) || ledFailed_(r) || ledRowSpeed(r)) return null;
|
||||
if (r.agent === "codex" && r.ttft_ms > 0) {
|
||||
const n = r.out - r.reasoning, w = r.ms - r.ttft_ms;
|
||||
return r.reasoning > 0 && n > 0 && w >= 100 && n * 1000 <= 10000 * w ? { n, w, answer: true } : null;
|
||||
}
|
||||
return r.out >= 1000 && r.ms >= 1000 && r.out * 1000 <= 10000 * r.ms ? { n: r.out, w: r.ms } : null;
|
||||
};
|
||||
const ledFloorSpeed = (r) => { const f = ledFloor_(r); return f ? f.n / (f.w / 1000) : 0; };
|
||||
|
||||
// the table as wide as the window, when leaving out what the row's details
|
||||
// say anyway makes it so: else it scrolls sideways (#799)
|
||||
@@ -17385,6 +17390,7 @@ function renderLedger() {
|
||||
td(v ? t("{n} tok/s", { n: ledNum(Math.round(v)) }) : floor ? "≥" + t("{n} tok/s", { n: ledNum(Math.round(floor)) }) : "—", "n speed" + (v || floor ? "" : " faint"),
|
||||
v ? (r.reasoning > 0 ? t("{n} answer tokens in {ms} after the first text, the {r} reasoning tokens before it left out", { n: ledNum(ledDecode(r).n), ms: ledTook(ledDecode(r).w), r: ledNum(r.reasoning) })
|
||||
: t("{n} output tokens in {ms} after the first", { n: ledNum(r.out), ms: ledTook(r.ms - r.ttft_ms) })) + " · " + t("TTFT {ms}", { ms: ledTook(r.ttft_ms) })
|
||||
: floor && ledFloor_(r).answer ? t("At least: {n} answer tokens in {ms} after the first token, the {r} reasoning tokens left out. The session file has no first text, so reasoning after the first token is counted too", { n: ledNum(ledFloor_(r).n), ms: ledTook(ledFloor_(r).w), r: ledNum(r.reasoning) }) + " · " + t("TTFT {ms}", { ms: ledTook(r.ttft_ms) })
|
||||
: floor ? t("At least: {n} output tokens in {ms}, from the line that asked for it to its last. The session file has no first token, so the wait for it is counted too", { n: ledNum(r.out), ms: ledTook(r.ms) })
|
||||
: r.ttft_ms || untimed || ledFailed_(r) ? "" : timed ? t("The session file has no first token to time a speed from") : t("Not streamed: no first token to time a speed from"));
|
||||
const st = el("span", "st");
|
||||
|
||||
@@ -3491,6 +3491,7 @@ const I18N = {
|
||||
"Sent, Effort and the cache are in each row's details": "窗口较窄:发送模型、推理强度和缓存在每行的详情里",
|
||||
"{n} output tokens in {ms} after the first": "首字后 {ms} 输出 {n} 个 token",
|
||||
"At least: {n} output tokens in {ms}, from the line that asked for it to its last. The session file has no first token, so the wait for it is counted too": "下限:从发出请求的那一行到最后一行,{ms} 输出 {n} 个 token。会话文件没有首字时间,等首字的时间也算在里面",
|
||||
"At least: {n} answer tokens in {ms} after the first token, the {r} reasoning tokens left out. The session file has no first text, so reasoning after the first token is counted too": "下限:首字后 {ms} 输出 {n} 个正文 token,{r} 个推理 token 不计。会话文件没有首个正文的时间,首字后的推理时间也算在里面",
|
||||
"The session file has no first token to time a speed from": "会话文件没有首字时间,算不出速度",
|
||||
"A reply that reasoned counts only its answer, from its first text: the reasoning was written before the stream showed it": "有推理的回复只算正文部分,从首个正文起计:推理在流里出现前就已写完",
|
||||
"{n} answer tokens in {ms} after the first text, the {r} reasoning tokens before it left out": "首个正文后 {ms} 输出 {n} 个正文 token,之前的 {r} 个推理 token 不计",
|
||||
@@ -3503,8 +3504,8 @@ const I18N = {
|
||||
"{n} tok/s ({k})": "{n} token/秒({k} 次)",
|
||||
"Measured on {k} reply, from its first token to its end; the others tell no speed": "实测 {k} 次回复:从首字到结束;其余请求测不出速度",
|
||||
"Measured on {k} replies, from their first token to their end; the others tell no speed": "实测 {k} 次回复:从首字到结束;其余请求测不出速度",
|
||||
"At least: {k} reply read from a session file, which has no first token, so the wait for it is counted too": "下限:{k} 次读自会话文件的回复。会话文件没有首字时间,等首字的时间也算在里面",
|
||||
"At least: {k} replies read from session files, which have no first token, so the wait for it is counted too": "下限:{k} 次读自会话文件的回复。会话文件没有首字时间,等首字的时间也算在里面",
|
||||
"At least: {k} reply read from a session file, which doesn't say when its answer began, so time before that is counted too": "下限:{k} 次读自会话文件的回复。会话文件不记录正文何时开始,之前的时间也算在里面",
|
||||
"At least: {k} replies read from session files, which don't say when their answers began, so time before that is counted too": "下限:{k} 次读自会话文件的回复。会话文件不记录正文何时开始,之前的时间也算在里面",
|
||||
"requested {sent} · served {served}": "请求 {sent} · 实际 {served}",
|
||||
"served {served}": "实际 {served}",
|
||||
"Upstream: {upstream}": "上游:{upstream}",
|
||||
@@ -7731,6 +7732,7 @@ const I18N = {
|
||||
"Sent, Effort and the cache are in each row's details": "視窗較窄:傳送模型、推理強度和快取在每行的詳情裡",
|
||||
"{n} output tokens in {ms} after the first": "首字後 {ms} 輸出 {n} 個 token",
|
||||
"At least: {n} output tokens in {ms}, from the line that asked for it to its last. The session file has no first token, so the wait for it is counted too": "下限:從發出請求的那一行到最後一行,{ms} 輸出 {n} 個 token。會話檔案沒有首字時間,等首字的時間也算在裡面",
|
||||
"At least: {n} answer tokens in {ms} after the first token, the {r} reasoning tokens left out. The session file has no first text, so reasoning after the first token is counted too": "下限:首字後 {ms} 輸出 {n} 個正文 token,{r} 個推理 token 不計。會話檔案沒有首個正文的時間,首字後的推理時間也算在裡面",
|
||||
"The session file has no first token to time a speed from": "會話檔案沒有首字時間,算不出速度",
|
||||
"A reply that reasoned counts only its answer, from its first text: the reasoning was written before the stream showed it": "有推理的回覆只算正文部分,從首個正文起計:推理在流裡出現前就已寫完",
|
||||
"{n} answer tokens in {ms} after the first text, the {r} reasoning tokens before it left out": "首個正文後 {ms} 輸出 {n} 個正文 token,之前的 {r} 個推理 token 不計",
|
||||
@@ -7743,8 +7745,8 @@ const I18N = {
|
||||
"{n} tok/s ({k})": "{n} token/秒({k} 次)",
|
||||
"Measured on {k} reply, from its first token to its end; the others tell no speed": "實測 {k} 次回覆:從首字到結束;其餘請求測不出速度",
|
||||
"Measured on {k} replies, from their first token to their end; the others tell no speed": "實測 {k} 次回覆:從首字到結束;其餘請求測不出速度",
|
||||
"At least: {k} reply read from a session file, which has no first token, so the wait for it is counted too": "下限:{k} 次讀自會話檔案的回覆。會話檔案沒有首字時間,等首字的時間也算在裡面",
|
||||
"At least: {k} replies read from session files, which have no first token, so the wait for it is counted too": "下限:{k} 次讀自會話檔案的回覆。會話檔案沒有首字時間,等首字的時間也算在裡面",
|
||||
"At least: {k} reply read from a session file, which doesn't say when its answer began, so time before that is counted too": "下限:{k} 次讀自會話檔案的回覆。會話檔案不記錄正文何時開始,之前的時間也算在裡面",
|
||||
"At least: {k} replies read from session files, which don't say when their answers began, so time before that is counted too": "下限:{k} 次讀自會話檔案的回覆。會話檔案不記錄正文何時開始,之前的時間也算在裡面",
|
||||
"requested {sent} · served {served}": "請求 {sent} · 實際 {served}",
|
||||
"served {served}": "實際 {served}",
|
||||
"Upstream: {upstream}": "上游:{upstream}",
|
||||
@@ -11985,6 +11987,7 @@ const I18N = {
|
||||
"Sent, Effort and the cache are in each row's details": "ウィンドウが狭いため、送信したモデル・推論レベル・キャッシュは各行の詳細にあります",
|
||||
"{n} output tokens in {ms} after the first": "最初のトークン後 {ms} で {n} トークンを出力",
|
||||
"At least: {n} output tokens in {ms}, from the line that asked for it to its last. The session file has no first token, so the wait for it is counted too": "下限:要求した行から最後の行まで {ms} で {n} トークンを出力。セッションファイルには最初のトークンの時刻がないため、それを待つ時間も含まれます",
|
||||
"At least: {n} answer tokens in {ms} after the first token, the {r} reasoning tokens left out. The session file has no first text, so reasoning after the first token is counted too": "下限:最初のトークン後 {ms} で回答 {n} トークン(推論 {r} トークンは含めず)。セッションファイルには最初の本文の時刻がないため、最初のトークン後の推論の時間も含まれます",
|
||||
"The session file has no first token to time a speed from": "セッションファイルには、速度を計れる最初のトークンの時刻がありません",
|
||||
"A reply that reasoned counts only its answer, from its first text: the reasoning was written before the stream showed it": "推論した応答は、最初の本文からの回答部分のみ数えます。推論はストリームに出る前に書き終わっています",
|
||||
"{n} answer tokens in {ms} after the first text, the {r} reasoning tokens before it left out": "最初の本文後 {ms} で回答 {n} トークン(その前の推論 {r} トークンは含めず)",
|
||||
@@ -11997,8 +12000,8 @@ const I18N = {
|
||||
"{n} tok/s ({k})": "{n} トークン/秒({k} 件)",
|
||||
"Measured on {k} reply, from its first token to its end; the others tell no speed": "{k} 件の応答で実測:最初のトークンから終わりまで。ほかのリクエストは速度を計れません",
|
||||
"Measured on {k} replies, from their first token to their end; the others tell no speed": "{k} 件の応答で実測:最初のトークンから終わりまで。ほかのリクエストは速度を計れません",
|
||||
"At least: {k} reply read from a session file, which has no first token, so the wait for it is counted too": "下限:セッションファイルから読んだ {k} 件の応答。最初のトークンの時刻がないため、それを待つ時間も含まれます",
|
||||
"At least: {k} replies read from session files, which have no first token, so the wait for it is counted too": "下限:セッションファイルから読んだ {k} 件の応答。最初のトークンの時刻がないため、それを待つ時間も含まれます",
|
||||
"At least: {k} reply read from a session file, which doesn't say when its answer began, so time before that is counted too": "下限:セッションファイルから読んだ {k} 件の応答。回答が始まった時刻がないため、その前の時間も含まれます",
|
||||
"At least: {k} replies read from session files, which don't say when their answers began, so time before that is counted too": "下限:セッションファイルから読んだ {k} 件の応答。回答が始まった時刻がないため、その前の時間も含まれます",
|
||||
"requested {sent} · served {served}": "リクエスト {sent} · 応答 {served}",
|
||||
"served {served}": "応答 {served}",
|
||||
"Upstream: {upstream}": "上流:{upstream}",
|
||||
@@ -16242,6 +16245,7 @@ const I18N = {
|
||||
"Sent, Effort and the cache are in each row's details": "Schmales Fenster: Gesendet, Effort und Cache stehen in den Details jeder Zeile",
|
||||
"{n} output tokens in {ms} after the first": "{n} Ausgabe-Token in {ms} nach dem ersten",
|
||||
"At least: {n} output tokens in {ms}, from the line that asked for it to its last. The session file has no first token, so the wait for it is counted too": "Mindestens: {n} Ausgabe-Token in {ms}, von der Zeile, die sie anforderte, bis zu ihrer letzten. Die Sitzungsdatei hat kein erstes Token, also zählt das Warten darauf mit",
|
||||
"At least: {n} answer tokens in {ms} after the first token, the {r} reasoning tokens left out. The session file has no first text, so reasoning after the first token is counted too": "Mindestens: {n} Antwort-Token in {ms} nach dem ersten Token, ohne die {r} Reasoning-Token. Die Sitzungsdatei hat keinen ersten Text, also zählt Reasoning nach dem ersten Token mit",
|
||||
"The session file has no first token to time a speed from": "Die Sitzungsdatei hat kein erstes Token, an dem sich ein Tempo messen ließe",
|
||||
"A reply that reasoned counts only its answer, from its first text: the reasoning was written before the stream showed it": "Eine Antwort mit Reasoning zählt nur ihre Antwort ab dem ersten Text: Das Reasoning entstand, bevor der Stream es zeigte",
|
||||
"{n} answer tokens in {ms} after the first text, the {r} reasoning tokens before it left out": "{n} Antwort-Token in {ms} nach dem ersten Text, ohne die {r} Reasoning-Token davor",
|
||||
@@ -16254,8 +16258,8 @@ const I18N = {
|
||||
"{n} tok/s ({k})": "{n} Token/s ({k})",
|
||||
"Measured on {k} reply, from its first token to its end; the others tell no speed": "Gemessen an {k} Antwort, vom ersten Token bis zum Ende; die übrigen Anfragen zeigen kein Tempo",
|
||||
"Measured on {k} replies, from their first token to their end; the others tell no speed": "Gemessen an {k} Antworten, vom ersten Token bis zum Ende; die übrigen Anfragen zeigen kein Tempo",
|
||||
"At least: {k} reply read from a session file, which has no first token, so the wait for it is counted too": "Mindestens: {k} Antwort aus einer Sitzungsdatei. Sie hat kein erstes Token, also zählt das Warten darauf mit",
|
||||
"At least: {k} replies read from session files, which have no first token, so the wait for it is counted too": "Mindestens: {k} Antworten aus Sitzungsdateien. Sie haben kein erstes Token, also zählt das Warten darauf mit",
|
||||
"At least: {k} reply read from a session file, which doesn't say when its answer began, so time before that is counted too": "Mindestens: {k} Antwort aus einer Sitzungsdatei. Sie sagt nicht, wann die Antwort begann, also zählt die Zeit davor mit",
|
||||
"At least: {k} replies read from session files, which don't say when their answers began, so time before that is counted too": "Mindestens: {k} Antworten aus Sitzungsdateien. Sie sagen nicht, wann die Antworten begannen, also zählt die Zeit davor mit",
|
||||
"requested {sent} · served {served}": "angefragt {sent} · geliefert {served}",
|
||||
"served {served}": "geliefert {served}",
|
||||
"Upstream: {upstream}": "Upstream: {upstream}",
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
// no speed at all, and each said "Not streamed", though the replies were
|
||||
// streamed. A long one now tells the least it wrote at, its tokens over that
|
||||
// whole time ("≥98 tok/s"); a short one says the file has no first token; a
|
||||
// call magpie timed keeps its own speed. Only Claude Code's and Claude
|
||||
// Desktop's files tell one: a Codex call in a turn of several is timed from
|
||||
// a tool output Codex can write before that call's own token count, so it tells
|
||||
// none. A narrow window shows it as a wide one does. The rows are real ledger rows read
|
||||
// call magpie timed keeps its own speed. Claude Code's, Claude Desktop's
|
||||
// and Codex's files tell one: a Codex call in a turn of several is timed
|
||||
// from what asked for it, before its first output item, to its last
|
||||
// (Fallmonkey on Discord). A narrow window shows it as a wide one does. The rows are real ledger rows read
|
||||
// from Claude Code's session files of claude-opus-5-5 replies; the first,
|
||||
// 2,558 tokens in 25,987 ms, measured 100.6 tok/s on Claude Code's own stream
|
||||
// (--include-partial-messages) from its first thinking event to its end.
|
||||
@@ -49,9 +49,9 @@ const ROWS = [
|
||||
{ ...LOG, t: at(5), out: 1500, ms: 9000, err_type: "overloaded_error", err: "Overloaded" },
|
||||
// 6: a long reply in under a second (lines written together) tells none
|
||||
{ ...LOG, t: at(6), out: 5000, ms: 300 },
|
||||
// 7: a Codex call in a turn of several: timed from the tool output before
|
||||
// it, which Codex can write before that call's own token count, so none is told
|
||||
{ ...LOG, agent: "codex", agentName: "Codex", icon: "codex-color", model: "gpt-6-astra", t: at(7), out: 1500, ms: 3000 },
|
||||
// 7: a Codex call in a turn of several, timed from what asked for it: at
|
||||
// least 1500 tokens in 60 s
|
||||
{ ...LOG, agent: "codex", agentName: "Codex", icon: "codex-color", model: "gpt-6-astra", t: at(7), out: 1500, ms: 60000 },
|
||||
// 8: Claude Desktop's Code tab writes Claude Code's file: at least 1500 / 12 s
|
||||
{ ...LOG, agent: "claude-desktop", agentName: "Claude Desktop", icon: "claude-color", t: at(8), out: 1500, ms: 12000 },
|
||||
];
|
||||
@@ -98,12 +98,12 @@ function server(lang) {
|
||||
|
||||
const L = {
|
||||
en: {
|
||||
speed: "Speed", floor: "≥98 tok/s", desktop: "≥125 tok/s", timed: "75 tok/s", codex: "150 tok/s",
|
||||
speed: "Speed", floor: "≥98 tok/s", desktop: "≥125 tok/s", codexFloor: "≥25 tok/s", timed: "75 tok/s", codex: "150 tok/s",
|
||||
floorTip: "At least: 2,558 output tokens in 26 s, from the line that asked for it to its last. The session file has no first token, so the wait for it is counted too",
|
||||
noFirst: "The session file has no first token to time a speed from", notStreamed: "Not streamed: no first token to time a speed from",
|
||||
},
|
||||
zh: {
|
||||
speed: "速度", floor: "≥98 token/秒", desktop: "≥125 token/秒", timed: "75 token/秒", codex: "150 token/秒",
|
||||
speed: "速度", floor: "≥98 token/秒", desktop: "≥125 token/秒", codexFloor: "≥25 token/秒", timed: "75 token/秒", codex: "150 token/秒",
|
||||
floorTip: "下限:从发出请求的那一行到最后一行,26 秒 输出 2,558 个 token。会话文件没有首字时间,等首字的时间也算在里面",
|
||||
noFirst: "会话文件没有首字时间,算不出速度", notStreamed: "非流式:没有首字时间,算不出速度",
|
||||
},
|
||||
@@ -151,9 +151,8 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
// a failed call, and a reply in under a second, tell none
|
||||
assert.equal(await text(5), "—");
|
||||
assert.equal(await text(6), "—");
|
||||
// a Codex call timed from inside a turn tells none, and isn't called unstreamed
|
||||
assert.equal(await text(7), "—");
|
||||
assert.equal(await tip(7), w.noFirst);
|
||||
// a Codex call in a turn of several tells its floor too
|
||||
assert.equal(await text(7), w.codexFloor);
|
||||
// Claude Desktop's file is Claude Code's
|
||||
assert.equal(await text(8), w.desktop);
|
||||
// the floor is read whole, at either width
|
||||
|
||||
@@ -7,8 +7,11 @@
|
||||
// none. A group with replies whose speed was measured now says that speed and
|
||||
// how many replies it is of, "125 tok/s (1)"; one with none, but floors, the
|
||||
// least they wrote at, "≥100 tok/s (30)"; one with neither, nothing. The
|
||||
// rows of the Requests tab say each one's the same way. Every language, a
|
||||
// wide window and a narrow one; no backend, the API is faked.
|
||||
// rows of the Requests tab say each one's the same way. Codex's rows tell a
|
||||
// floor too: a call in a turn of several, timed from what asked for it, its
|
||||
// output over that time; a turn of one call that reasoned, its answer over
|
||||
// the time after its first token. Every language, a wide window and a narrow
|
||||
// one; no backend, the API is faked.
|
||||
const assert = require("node:assert/strict");
|
||||
const fs = require("node:fs/promises");
|
||||
const path = require("node:path");
|
||||
@@ -26,12 +29,15 @@ const CC = { ...LOG, agent: "claude", agentName: "Claude Code", icon: "claudecod
|
||||
const ROWS = [
|
||||
// the one sol reply its session file timed: 500 tokens in the 4 s after its first
|
||||
{ ...SOL, t: at(0), out: 500, ms: 5000, ttft_ms: 1000 },
|
||||
// a sol call in a turn of several: no speed
|
||||
// a sol call in a turn of several: at least 1500 tokens in 30 s
|
||||
{ ...SOL, t: at(1), out: 1500, ms: 30000 },
|
||||
// a Claude Code reply: at least 2000 tokens in 20 s
|
||||
{ ...CC, t: at(2), out: 2000, ms: 20000 },
|
||||
// a short one tells nothing
|
||||
{ ...CC, t: at(3), out: 300, ms: 20000 },
|
||||
// a sol turn of one call that reasoned: its 272 answer tokens came in the
|
||||
// 827 ms after its first token, at least 329 tok/s (not its 496 tokens, 600)
|
||||
{ ...SOL, t: at(4), out: 496, reasoning: 224, ms: 11055, ttft_ms: 10228 },
|
||||
];
|
||||
// the groups as usage.Breakdown sums them (TestGroupSpeedSaysHowManyRepliesItIsOf)
|
||||
const G = {
|
||||
@@ -91,19 +97,24 @@ function server(lang) {
|
||||
const L = {
|
||||
en: { speed: "Speed", kpi: "Output speed", sol: "125 tok/s (1)", cc: "≥100 tok/s (30)", row: "125 tok/s", rowFloor: "≥100 tok/s",
|
||||
solTip: "Measured on 1 reply, from its first token to its end; the others tell no speed",
|
||||
ccTip: "At least: 30 replies read from session files, which have no first token, so the wait for it is counted too" },
|
||||
ccTip: "At least: 30 replies read from session files, which don't say when their answers began, so time before that is counted too",
|
||||
cx: "≥50 tok/s", luna: "≥329 tok/s", lunaTip: "At least: 272 answer tokens in " },
|
||||
zh: { speed: "速度", kpi: "输出速度", sol: "125 token/秒(1 次)", cc: "≥100 token/秒(30 次)", row: "125 token/秒", rowFloor: "≥100 token/秒",
|
||||
solTip: "实测 1 次回复:从首字到结束;其余请求测不出速度",
|
||||
ccTip: "下限:30 次读自会话文件的回复。会话文件没有首字时间,等首字的时间也算在里面" },
|
||||
ccTip: "下限:30 次读自会话文件的回复。会话文件不记录正文何时开始,之前的时间也算在里面",
|
||||
cx: "≥50 token/秒", luna: "≥329 token/秒", lunaTip: "输出 272 个正文 token,224 个推理 token 不计" },
|
||||
"zh-TW": { speed: "速度", kpi: null, sol: "125 token/秒(1 次)", cc: "≥100 token/秒(30 次)", row: "125 token/秒", rowFloor: "≥100 token/秒",
|
||||
solTip: "實測 1 次回覆:從首字到結束;其餘請求測不出速度",
|
||||
ccTip: "下限:30 次讀自會話檔案的回覆。會話檔案沒有首字時間,等首字的時間也算在裡面" },
|
||||
ccTip: "下限:30 次讀自會話檔案的回覆。會話檔案不記錄正文何時開始,之前的時間也算在裡面",
|
||||
cx: "≥50 token/秒", luna: "≥329 token/秒", lunaTip: "輸出 272 個正文 token,224 個推理 token 不計" },
|
||||
ja: { speed: null, kpi: null, sol: "125 トークン/秒(1 件)", cc: "≥100 トークン/秒(30 件)", row: "125 トークン/秒", rowFloor: "≥100 トークン/秒",
|
||||
solTip: "1 件の応答で実測:最初のトークンから終わりまで。ほかのリクエストは速度を計れません",
|
||||
ccTip: "下限:セッションファイルから読んだ 30 件の応答。最初のトークンの時刻がないため、それを待つ時間も含まれます" },
|
||||
ccTip: "下限:セッションファイルから読んだ 30 件の応答。回答が始まった時刻がないため、その前の時間も含まれます",
|
||||
cx: "≥50 トークン/秒", luna: "≥329 トークン/秒", lunaTip: "で回答 272 トークン(推論 224 トークンは含めず)" },
|
||||
de: { speed: null, kpi: null, sol: "125 Token/s (1)", cc: "≥100 Token/s (30)", row: "125 Token/s", rowFloor: "≥100 Token/s",
|
||||
solTip: "Gemessen an 1 Antwort, vom ersten Token bis zum Ende; die übrigen Anfragen zeigen kein Tempo",
|
||||
ccTip: "Mindestens: 30 Antworten aus Sitzungsdateien. Sie haben kein erstes Token, also zählt das Warten darauf mit" },
|
||||
ccTip: "Mindestens: 30 Antworten aus Sitzungsdateien. Sie sagen nicht, wann die Antworten begannen, also zählt die Zeit davor mit",
|
||||
cx: "≥50 Token/s", luna: "≥329 Token/s", lunaTip: "Mindestens: 272 Antwort-Token in " },
|
||||
};
|
||||
|
||||
for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium", "webkit"])) {
|
||||
@@ -137,8 +148,11 @@ for (const engine of (process.env.BROWSER ? [process.env.BROWSER] : ["chromium",
|
||||
// the rows say each one's: measured, and at least
|
||||
const cell = (i) => p.locator(".led tbody tr.led-row").nth(i).locator("td.speed");
|
||||
assert.equal((await cell(0).textContent()).trim(), w.row);
|
||||
assert.equal((await cell(1).textContent()).trim(), "—");
|
||||
assert.equal((await cell(1).textContent()).trim(), w.cx);
|
||||
assert.equal((await cell(2).textContent()).trim(), w.rowFloor);
|
||||
assert.equal((await cell(3).textContent()).trim(), "—");
|
||||
assert.equal((await cell(4).textContent()).trim(), w.luna);
|
||||
assert((await cell(4).getAttribute("title")).includes(w.lunaTip), "the answer's floor says so: " + (await cell(4).getAttribute("title")));
|
||||
|
||||
// the ranking, by tokens: each group's speed beside its requests
|
||||
const rk = (id) => p.locator("#ledRank .rk").filter({ has: p.locator(".rk-nm", { hasText: id }) });
|
||||
|
||||
+39
-12
@@ -632,20 +632,37 @@ func (t *Totals) addRow(r Row) {
|
||||
}
|
||||
}
|
||||
|
||||
// FloorAgents are the agents whose session files time a call from the line
|
||||
// that asked for it, written before it was sent, to its reply's last
|
||||
// (Claude Code's, Claude Desktop's): their calls' tokens over that time are
|
||||
// a floor of how fast the reply wrote. A Codex call in a turn of several can
|
||||
// be timed from inside the call, and OpenCode's isn't checked against real
|
||||
// sessions, so they tell none. app.js's LED_FLOOR_AGENTS has the same.
|
||||
var FloorAgents = map[string]bool{"claude": true, "claude-desktop": true}
|
||||
// FloorAgents are the agents whose session files time a call from what
|
||||
// asked for it to its reply's end, never from inside it: Claude Code's and
|
||||
// Claude Desktop's from the line that asked, written before it was sent;
|
||||
// Codex's call in a turn of several from what the model had last been given
|
||||
// before the call's first output item, to its last (sessions' codexTiming).
|
||||
// Their calls' tokens over that time are a floor of how fast the reply
|
||||
// wrote. OpenCode's isn't checked against real sessions, so it tells none.
|
||||
// app.js's LED_FLOOR_AGENTS has the same.
|
||||
var FloorAgents = map[string]bool{"claude": true, "claude-desktop": true, "codex": true}
|
||||
|
||||
// Floor is the tokens and ms a row read from a session file tells the least
|
||||
// its reply wrote at by, when its speed wasn't measured: its output over its
|
||||
// whole time, the wait for the first token in it, for a reply of 1,000
|
||||
// tokens or more over a second or more (a shorter one's wait is too much of
|
||||
// it to tell anything) and no faster than MaxDecodeSpeed. 0, 0 when it
|
||||
// tells none. app.js's ledFloorSpeed is the same rule for one row.
|
||||
// its reply wrote at by, when its speed wasn't measured. 0, 0 when it tells
|
||||
// none. app.js's ledFloorSpeed is the same rule for one row.
|
||||
//
|
||||
// Mostly it is its output over its whole time, the wait for the first token
|
||||
// in it, for a reply of 1,000 tokens or more over a second or more (a
|
||||
// shorter one's wait is too much of it to tell anything; against Claude
|
||||
// Code's own stream a floor read 2-5% under for 1,400 tokens or more, 11-33%
|
||||
// for a shorter one) and no faster than MaxDecodeSpeed. A count of tokens
|
||||
// is what bounds the share the wait can be, not a duration: a 5 s reply can
|
||||
// be 4 s of wait (Fallmonkey on Discord asked for 5 s instead).
|
||||
//
|
||||
// A Codex turn of one call that reasoned has its first token from the turn's
|
||||
// end, but not its first text, so DecodeOf tells no speed. Its answer, its
|
||||
// output less the reasoning, was all written after the first token, so the
|
||||
// answer over the time from the first token to the end is a floor of the
|
||||
// answer's speed, the reasoning written after the first token counted in
|
||||
// its time. Its output over that time, as Fallmonkey asked, would count the
|
||||
// reasoning written before the first token too and read high: a gateway
|
||||
// reply of 496 tokens, 224 of them reasoning, 827 ms after a 10.2 s first
|
||||
// token, reads 600 tok/s so, its measured answer 415, and this 329.
|
||||
func (r Row) Floor() (tokens int, ms int64) {
|
||||
if r.Source != "log" || !FloorAgents[r.Agent] || r.Failed() {
|
||||
return 0, 0
|
||||
@@ -653,6 +670,16 @@ func (r Row) Floor() (tokens int, ms int64) {
|
||||
if _, w := r.Decode(); w > 0 {
|
||||
return 0, 0
|
||||
}
|
||||
if r.Agent == "codex" && r.TTFT > 0 {
|
||||
if r.Reasoning <= 0 {
|
||||
return 0, 0
|
||||
}
|
||||
n := r.Output - r.Reasoning
|
||||
if w := DecodeWindow(n, r.Millis, r.TTFT); w > 0 {
|
||||
return n, w
|
||||
}
|
||||
return 0, 0
|
||||
}
|
||||
if r.Output < 1000 || r.Millis < 1000 || int64(r.Output)*1000 > MaxDecodeSpeed*r.Millis {
|
||||
return 0, 0
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@ func TestGroupSpeedSaysHowManyRepliesItIsOf(t *testing.T) {
|
||||
at := time.Date(2026, 10, 11, 9, 0, 0, 0, time.UTC)
|
||||
var rows []Row
|
||||
// sol: 260 Codex calls read from its session files; only a turn of one
|
||||
// call is timed, 500 tokens over the 4 s after the first, 125 tok/s
|
||||
// call is timed, 500 tokens over the 4 s after the first, 125 tok/s; the
|
||||
// rest, calls in turns of several, wrote 1,500 tokens over 30 s each, a
|
||||
// floor of 50 tok/s
|
||||
for i := 0; i < 260; i++ {
|
||||
r := Row{Source: "log", Record: Record{Time: at, Agent: "codex", Model: "gpt-6.1-sol", Input: 9000, Output: 1500, Millis: 30000}}
|
||||
if i == 0 {
|
||||
@@ -42,8 +44,8 @@ func TestGroupSpeedSaysHowManyRepliesItIsOf(t *testing.T) {
|
||||
by[s.ID] = s
|
||||
}
|
||||
sol := by["codex"]
|
||||
if sol.Calls != 260 || sol.DecodeN != 1 || sol.Speed() != 125 || sol.FloorN != 0 || sol.Floor() != 0 {
|
||||
t.Fatalf("sol: %d calls, %d measured at %v tok/s, %d floors at %v; want 260, 1 at 125, none", sol.Calls, sol.DecodeN, sol.Speed(), sol.FloorN, sol.Floor())
|
||||
if sol.Calls != 260 || sol.DecodeN != 1 || sol.Speed() != 125 || sol.FloorN != 259 || sol.Floor() != 50 {
|
||||
t.Fatalf("sol: %d calls, %d measured at %v tok/s, %d floors at %v; want 260, 1 at 125, 259 at 50", sol.Calls, sol.DecodeN, sol.Speed(), sol.FloorN, sol.Floor())
|
||||
}
|
||||
cc := by["claude"]
|
||||
if cc.Calls != 42 || cc.DecodeN != 0 || cc.Speed() != 0 || cc.FloorN != 30 || cc.FloorOut != 60000 || cc.FloorMs != 600000 || cc.Floor() != 100 {
|
||||
@@ -54,7 +56,7 @@ func TestGroupSpeedSaysHowManyRepliesItIsOf(t *testing.T) {
|
||||
for _, r := range rows {
|
||||
sum.addRow(r)
|
||||
}
|
||||
if sum.DecodeN != 1 || sum.FloorN != 30 || sum.Speed() != 125 {
|
||||
if sum.DecodeN != 1 || sum.FloorN != 289 || sum.Speed() != 125 {
|
||||
t.Fatalf("sum: %+v", sum)
|
||||
}
|
||||
// a timed Claude Code row tells its own speed, not a floor
|
||||
@@ -72,3 +74,40 @@ func TestGroupSpeedSaysHowManyRepliesItIsOf(t *testing.T) {
|
||||
t.Fatalf("summarized: %+v", m.Totals)
|
||||
}
|
||||
}
|
||||
|
||||
// Codex rows tell a floor too (Fallmonkey on Discord): a call in a turn of
|
||||
// several, timed from what asked for it, by the same rule as Claude Code's;
|
||||
// a turn of one call that reasoned, whose first text isn't in the file, by
|
||||
// its answer over the time after its first token, never its whole output
|
||||
// over it, which counts reasoning written before the first token.
|
||||
func TestCodexRowsTellAFloor(t *testing.T) {
|
||||
row := func(out, reasoning int, ms, ttft int64) Row {
|
||||
return Row{Source: "log", Record: Record{Agent: "codex", Model: "gpt-6-luna", Output: out, Reasoning: reasoning, Millis: ms, TTFT: ttft}}
|
||||
}
|
||||
for _, c := range []struct {
|
||||
name string
|
||||
r Row
|
||||
n int
|
||||
ms int64
|
||||
}{
|
||||
// the gateway measured 415 tok/s on this one's answer; 272 over 827 ms is 329
|
||||
{"one call that reasoned", row(496, 224, 11055, 10228), 272, 827},
|
||||
{"one call that reasoned, all of it after its first token", row(1200, 200, 12000, 2000), 1000, 10000},
|
||||
{"one call that didn't reason tells its own speed", row(500, 0, 5000, 1000), 0, 0},
|
||||
{"one call whose answer came too fast to tell", row(500, 100, 2050, 2000), 0, 0},
|
||||
{"one call that only reasoned", row(300, 300, 9000, 2000), 0, 0},
|
||||
{"a call of several, 1,500 over 30 s", row(1500, 600, 30000, 0), 1500, 30000},
|
||||
{"a call of several too short to tell", row(800, 100, 20000, 0), 0, 0},
|
||||
} {
|
||||
n, ms := c.r.Floor()
|
||||
if n != c.n || ms != c.ms {
|
||||
t.Errorf("%s: floor %d/%d ms, want %d/%d", c.name, n, ms, c.n, c.ms)
|
||||
}
|
||||
}
|
||||
// through the gateway a Codex row is measured, never a floor
|
||||
gw := row(496, 224, 11055, 10228)
|
||||
gw.Source = ""
|
||||
if n, ms := gw.Floor(); n != 0 || ms != 0 {
|
||||
t.Errorf("gateway row: floor %d/%d", n, ms)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -326,9 +326,9 @@ type Totals struct {
|
||||
// 260 calls whose speed is one reply's says so (Fallmonkey on Discord)
|
||||
DecodeN int `json:"decode_n,omitempty"`
|
||||
// FloorOut tokens over FloorMs are the least FloorN replies read from a
|
||||
// session file wrote at, those with no first token (Row.Floor): what a
|
||||
// group none of whose replies was measured shows, as "≥", beside how
|
||||
// many it is of. They are never in Speed.
|
||||
// session file wrote at, those whose speed wasn't measured (Row.Floor):
|
||||
// what a group shows, as "≥", beside how many it is of, after its
|
||||
// measured speed when it has one. They are never in Speed.
|
||||
FloorOut int `json:"floor_out,omitempty"`
|
||||
FloorMs int64 `json:"floor_ms,omitempty"`
|
||||
FloorN int `json:"floor_n,omitempty"`
|
||||
@@ -354,8 +354,8 @@ func (t Totals) Speed() float64 {
|
||||
return float64(t.DecodeOut) / (float64(t.DecodeMs) / 1000)
|
||||
}
|
||||
|
||||
// Floor is the least the replies with no first token wrote at, in tokens a
|
||||
// second over their whole time (Row.Floor): 0 for none.
|
||||
// Floor is the least the replies whose speed wasn't measured wrote at, in
|
||||
// tokens a second (Row.Floor): 0 for none.
|
||||
func (t Totals) Floor() float64 {
|
||||
if t.FloorMs <= 0 {
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user