@code-yeongyu/senpi 2026.8.6 → 2026.8.7
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.
- package/CHANGELOG.md +34 -0
- package/dist/core/agent-session.d.ts +10 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +46 -38
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.d.ts +2 -2
- package/dist/core/extensions/builtin/bash-timeout/index.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/index.js +17 -20
- package/dist/core/extensions/builtin/bash-timeout/index.js.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts +7 -12
- package/dist/core/extensions/builtin/bash-timeout/timeout.d.ts.map +1 -1
- package/dist/core/extensions/builtin/bash-timeout/timeout.js +11 -19
- package/dist/core/extensions/builtin/bash-timeout/timeout.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash.d.ts.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/bash.js +22 -10
- package/dist/core/extensions/builtin/terminal/tools/bash.js.map +1 -1
- package/dist/core/extensions/builtin/terminal/tools/foreground-window.d.ts +11 -0
- package/dist/core/extensions/builtin/terminal/tools/foreground-window.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/tools/foreground-window.js +16 -0
- package/dist/core/extensions/builtin/terminal/tools/foreground-window.js.map +1 -0
- package/dist/core/extensions/builtin/terminal/tools/sleep-wait.d.ts +28 -0
- package/dist/core/extensions/builtin/terminal/tools/sleep-wait.d.ts.map +1 -0
- package/dist/core/extensions/builtin/terminal/tools/sleep-wait.js +75 -0
- package/dist/core/extensions/builtin/terminal/tools/sleep-wait.js.map +1 -0
- package/dist/core/extensions/builtin/tps.d.ts.map +1 -1
- package/dist/core/extensions/builtin/tps.js +3 -3
- package/dist/core/extensions/builtin/tps.js.map +1 -1
- package/dist/core/retry-fallback/hint-policy.d.ts +14 -0
- package/dist/core/retry-fallback/hint-policy.d.ts.map +1 -1
- package/dist/core/retry-fallback/hint-policy.js +14 -0
- package/dist/core/retry-fallback/hint-policy.js.map +1 -1
- package/node_modules/@code-yeongyu/senpi-codemode/CHANGELOG.md +17 -0
- package/node_modules/@code-yeongyu/senpi-codemode/package.json +4 -4
- package/node_modules/@code-yeongyu/senpi-codemode/src/tool/render.ts +2 -1
- package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/.manifest.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/huggingface.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/opencode.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/openrouter.json +1 -1
- package/node_modules/@earendil-works/pi-ai/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/node_modules/@earendil-works/pi-ai/package.json +1 -1
- package/node_modules/@earendil-works/pi-pty/package.json +1 -1
- package/node_modules/@earendil-works/pi-tui/package.json +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep-wait.js","sourceRoot":"","sources":["../../../../../../src/core/extensions/builtin/terminal/tools/sleep-wait.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,yEAAyE;AACzE,MAAM,CAAC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AAC/C,mFAAmF;AACnF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC;AAYnD,qFAAqF;AACrF,MAAM,aAAa,GAAG,wFAAwF,CAAC;AAC/G,qFAAqF;AACrF,MAAM,gBAAgB,GAAG,6DAA6D,CAAC;AACvF,iFAAiF;AACjF,MAAM,UAAU,GAAG,6DAA6D,CAAC;AAEjF,MAAM,IAAI,GAAG,yBAAyB,CAAC;AACvC,MAAM,OAAO,GAAG,kEAAkE,CAAC;AACnF,MAAM,IAAI,GAAG,8EAA8E,CAAC;AAC5F,MAA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;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAChD,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,SAAS,CAAC;IACrD,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IAClC,MAAM,OAAO,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC/C,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAE5C,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1B,OAAO,OAAO,IAAI,iCAAiC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/G,CAAC;IACD,IAAI,OAAO,GAAG,4BAA4B;QAAE,OAAO,SAAS,CAAC;IAC7D,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC7E,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAChF,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACjF,OAAO,SAAS,CAAC;AAClB,CAAC","sourcesContent":["/**\n * Detects commands whose whole purpose is to *wait* — `sleep 270; git log`,\n * `for ...; do ...; sleep 5; done`, a bare `sleep 30`. Such a command should not\n * hold the foreground: it detaches early so the session can keep working while\n * the wait finishes in the background and its completion notification lands.\n *\n * Settle sleeps (`pkill; sleep 1`, a 2s server warm-up) are deliberately NOT\n * sleep-waits: they are short by construction and detaching them would cost a\n * notification round-trip for nothing.\n */\n\n/** Minimum `sleep` seconds for a non-loop command to count as a wait. */\nexport const SLEEP_WAIT_THRESHOLD_SECONDS = 10;\n/** Minimum per-iteration `sleep` seconds for a polling loop to count as a wait. */\nexport const SLEEP_WAIT_LOOP_THRESHOLD_SECONDS = 2;\n\nexport type SleepWaitRule = \"R1\" | \"R2\" | \"R3\" | \"R4\";\n\nexport interface SleepWaitClassification {\n\treadonly kind: \"sleep-wait\";\n\t/** R1 pure, R2 leading chain, R3 polling loop, R4 trailing. */\n\treadonly rule: SleepWaitRule;\n\t/** Longest `sleep` argument that made the command match. */\n\treadonly seconds: number;\n}\n\n/** `env A=1 bash -lc '...'` wrappers hide the real command from every rule below. */\nconst SHELL_WRAPPER = /^(?:env\\s+(?:[\\w.]+=[^\\s]*\\s+)*)?(?:\\/(?:usr\\/)?bin\\/)?(?:ba|z|da|k)?sh\\s+-[a-z]*c\\s+/i;\n/** Power management takes a `sleep` argument that has nothing to do with waiting. */\nconst POWER_MANAGEMENT = /\\b(?:pmset|systemsetup|caffeinate|displaysleep|disksleep)\\b/;\n/** `sleep N` as a real command word — never `./sleepless 300` or `--sleep=3`. */\nconst SLEEP_CALL = /(?<![\\w.\\-/])(?:\\/(?:usr\\/)?bin\\/)?sleep\\s+(\\d+(?:\\.\\d+)?)/g;\n\nconst PURE = /^sleep\\s+\\d+(?:\\.\\d+)?$/;\nconst LEADING = /^\\(?\\s*(?:\\/(?:usr\\/)?bin\\/)?sleep\\s+\\d+(?:\\.\\d+)?\\s*(?:[;&|]|$)/;\nconst LOOP = /\\b(?:while|until|for)\\b[\\s\\S]*?(?<![\\w.\\-/])(?:\\/(?:usr\\/)?bin\\/)?sleep\\s+\\d/;\nconst TRAILING = /[;&|]\\s*(?:\\/(?:usr\\/)?bin\\/)?sleep\\s+\\d+(?:\\.\\d+)?\\s*\\)?\\s*$/;\n\nfunction unwrap(command: string): string {\n\tlet current = command.trim();\n\tfor (let depth = 0; depth < 3; depth += 1) {\n\t\tconst stripped = current.replace(SHELL_WRAPPER, \"\");\n\t\tif (stripped === current) break;\n\t\tcurrent = stripped.trim();\n\t\tconst quote = current[0];\n\t\tif ((quote === \"'\" || quote === '\"') && current.endsWith(quote) && current.length > 1) {\n\t\t\tcurrent = current.slice(1, -1).trim();\n\t\t}\n\t}\n\treturn current;\n}\n\nfunction longestSleepSeconds(command: string): number | undefined {\n\tSLEEP_CALL.lastIndex = 0;\n\tlet longest: number | undefined;\n\tfor (const match of command.matchAll(SLEEP_CALL)) {\n\t\tconst seconds = Number.parseFloat(match[1] ?? \"\");\n\t\tif (!Number.isFinite(seconds)) continue;\n\t\tif (longest === undefined || seconds > longest) longest = seconds;\n\t}\n\treturn longest;\n}\n\n/**\n * Classify a bash command as a sleep-wait, or `undefined` when it is ordinary\n * work (including short settle sleeps below the thresholds).\n */\nexport function classifySleepWait(command: string): SleepWaitClassification | undefined {\n\tif (POWER_MANAGEMENT.test(command)) return undefined;\n\tconst unwrapped = unwrap(command);\n\tconst seconds = longestSleepSeconds(unwrapped);\n\tif (seconds === undefined) return undefined;\n\n\tif (LOOP.test(unwrapped)) {\n\t\treturn seconds >= SLEEP_WAIT_LOOP_THRESHOLD_SECONDS ? { kind: \"sleep-wait\", rule: \"R3\", seconds } : undefined;\n\t}\n\tif (seconds < SLEEP_WAIT_THRESHOLD_SECONDS) return undefined;\n\tif (PURE.test(unwrapped)) return { kind: \"sleep-wait\", rule: \"R1\", seconds };\n\tif (LEADING.test(unwrapped)) return { kind: \"sleep-wait\", rule: \"R2\", seconds };\n\tif (TRAILING.test(unwrapped)) return { kind: \"sleep-wait\", rule: \"R4\", seconds };\n\treturn undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tps.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/tps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"tps.d.ts","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/tps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAkBhD,MAAM,CAAC,OAAO,WAAW,EAAE,EAAE,YAAY,QAmExC"}
|
|
@@ -47,7 +47,6 @@ export default function (pi) {
|
|
|
47
47
|
let output = 0;
|
|
48
48
|
let cacheRead = 0;
|
|
49
49
|
let cacheWrite = 0;
|
|
50
|
-
let totalTokens = 0;
|
|
51
50
|
for (const message of event.messages) {
|
|
52
51
|
if (!isAssistantMessage(message))
|
|
53
52
|
continue;
|
|
@@ -55,13 +54,14 @@ export default function (pi) {
|
|
|
55
54
|
output += message.usage?.output ?? 0;
|
|
56
55
|
cacheRead += message.usage?.cacheRead ?? 0;
|
|
57
56
|
cacheWrite += message.usage?.cacheWrite ?? 0;
|
|
58
|
-
totalTokens += message.usage?.totalTokens ?? 0;
|
|
59
57
|
}
|
|
60
58
|
if (output <= 0)
|
|
61
59
|
return;
|
|
62
60
|
const elapsedSeconds = elapsedMs / 1000;
|
|
63
61
|
const tokensPerSecond = output / elapsedSeconds;
|
|
64
|
-
const
|
|
62
|
+
const promptTokens = input + cacheRead + cacheWrite;
|
|
63
|
+
const cacheHitRate = promptTokens > 0 ? (cacheRead / promptTokens) * 100 : 0;
|
|
64
|
+
const message = `TPS ${tokensPerSecond.toFixed(1)} tok/s. Cache hit ${cacheHitRate.toFixed(1)}%, ${elapsedSeconds.toFixed(1)}s`;
|
|
65
65
|
ctx.ui.notify(message, "info");
|
|
66
66
|
});
|
|
67
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tps.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/tps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tps.js","sourceRoot":"","sources":["../../../../src/core/extensions/builtin/tps.ts"],"names":[],"mappings":"AAYA,SAAS,kBAAkB,CAAC,OAAgB;IAC3C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O,CAAC,CAAC,CAAC,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;QAChI,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import type { ExtensionAPI } from \"../types.ts\";\n\ntype AssistantMessageLike = {\n\trole: \"assistant\";\n\tusage?: {\n\t\tinput?: number;\n\t\toutput?: number;\n\t\tcacheRead?: number;\n\t\tcacheWrite?: number;\n\t};\n};\n\nfunction isAssistantMessage(message: unknown): message is AssistantMessageLike {\n\tif (!message || typeof message !== \"object\") return false;\n\tconst role = (message as { role?: unknown }).role;\n\treturn role === \"assistant\";\n}\n\nexport default function (pi: ExtensionAPI) {\n\tlet activeAssistantStartMs: number | null = null;\n\tlet assistantElapsedMs = 0;\n\n\tconst finishActiveAssistantTiming = () => {\n\t\tif (activeAssistantStartMs === null) return;\n\n\t\t// Use the monotonic clock so a wall-clock jump backward (NTP skew or\n\t\t// manual time change) between message_start and message_end cannot\n\t\t// produce a non-positive interval that suppresses a valid TPS notice.\n\t\tconst elapsedMs = performance.now() - activeAssistantStartMs;\n\t\tif (elapsedMs > 0) {\n\t\t\tassistantElapsedMs += elapsedMs;\n\t\t}\n\t\tactiveAssistantStartMs = null;\n\t};\n\n\tpi.on(\"agent_start\", () => {\n\t\tactiveAssistantStartMs = null;\n\t\tassistantElapsedMs = 0;\n\t});\n\n\tpi.on(\"message_start\", (event) => {\n\t\tif (!isAssistantMessage(event.message)) return;\n\n\t\tfinishActiveAssistantTiming();\n\t\tactiveAssistantStartMs = performance.now();\n\t});\n\n\tpi.on(\"message_end\", (event) => {\n\t\tif (!isAssistantMessage(event.message)) return;\n\n\t\tfinishActiveAssistantTiming();\n\t});\n\n\tpi.on(\"agent_end\", (event, ctx) => {\n\t\tfinishActiveAssistantTiming();\n\n\t\tconst elapsedMs = assistantElapsedMs;\n\t\tactiveAssistantStartMs = null;\n\t\tassistantElapsedMs = 0;\n\n\t\tif (!ctx.hasUI) return;\n\t\tif (elapsedMs <= 0) return;\n\n\t\tlet input = 0;\n\t\tlet output = 0;\n\t\tlet cacheRead = 0;\n\t\tlet cacheWrite = 0;\n\n\t\tfor (const message of event.messages) {\n\t\t\tif (!isAssistantMessage(message)) continue;\n\t\t\tinput += message.usage?.input ?? 0;\n\t\t\toutput += message.usage?.output ?? 0;\n\t\t\tcacheRead += message.usage?.cacheRead ?? 0;\n\t\t\tcacheWrite += message.usage?.cacheWrite ?? 0;\n\t\t}\n\n\t\tif (output <= 0) return;\n\n\t\tconst elapsedSeconds = elapsedMs / 1000;\n\t\tconst tokensPerSecond = output / elapsedSeconds;\n\t\tconst promptTokens = input + cacheRead + cacheWrite;\n\t\tconst cacheHitRate = promptTokens > 0 ? (cacheRead / promptTokens) * 100 : 0;\n\t\tconst message = `TPS ${tokensPerSecond.toFixed(1)} tok/s. Cache hit ${cacheHitRate.toFixed(1)}%, ${elapsedSeconds.toFixed(1)}s`;\n\t\tctx.ui.notify(message, \"info\");\n\t});\n}\n"]}
|
|
@@ -26,4 +26,18 @@ export interface InTurnResult {
|
|
|
26
26
|
demoteToProbeBack: boolean;
|
|
27
27
|
}
|
|
28
28
|
export declare function nextInTurnDelayMs(state: InTurnState, hintMs: number | undefined, baseDelayMs: number, hintedWaitCapMs: number, nowMs: number): InTurnResult;
|
|
29
|
+
export type DegradedRateLimitAction = {
|
|
30
|
+
kind: "in-turn";
|
|
31
|
+
delayMs: number;
|
|
32
|
+
} | {
|
|
33
|
+
kind: "fail";
|
|
34
|
+
hintMs: number;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Policy for a 429-class failure when no fallback candidate is usable: no-hint
|
|
38
|
+
* (and tier1) failures retry in-turn on the exponential schedule, tier2 hints
|
|
39
|
+
* retry in-turn with the wait clamped to the in-turn cap, and only tier3
|
|
40
|
+
* (probe-back-max or longer) hinted waits stay terminal.
|
|
41
|
+
*/
|
|
42
|
+
export declare function degradeWithoutFallback(tier: HintTier, hintMs: number | undefined, attempt: number, baseDelayMs: number, hintedWaitCapMs: number): DegradedRateLimitAction;
|
|
29
43
|
//# sourceMappingURL=hint-policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hint-policy.d.ts","sourceRoot":"","sources":["../../../src/core/retry-fallback/hint-policy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,QAAQ,GAAG,uBAAuB,GAAG,eAAe,GAAG,2BAA2B,GAAG,qBAAqB,CAAC;AAEvH,wBAAgB,uBAAuB,CACtC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,QAAQ,EAAE;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GAC3D,QAAQ,CAKV;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAE1G;AAED,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAEvD,MAAM,WAAW,WAAW;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,WAAW,GAAG,MAAM,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,OAAO,CAAC;CAC3B;AAED,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE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IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE9G;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACrB,uBAAuB,CAMzB"}
|
|
@@ -51,4 +51,18 @@ export function nextInTurnDelayMs(state, hintMs, baseDelayMs, hintedWaitCapMs, n
|
|
|
51
51
|
demoteToProbeBack: false,
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Policy for a 429-class failure when no fallback candidate is usable: no-hint
|
|
56
|
+
* (and tier1) failures retry in-turn on the exponential schedule, tier2 hints
|
|
57
|
+
* retry in-turn with the wait clamped to the in-turn cap, and only tier3
|
|
58
|
+
* (probe-back-max or longer) hinted waits stay terminal.
|
|
59
|
+
*/
|
|
60
|
+
export function degradeWithoutFallback(tier, hintMs, attempt, baseDelayMs, hintedWaitCapMs) {
|
|
61
|
+
if (tier === "tier3-fallback-only")
|
|
62
|
+
return { kind: "fail", hintMs: hintMs ?? 0 };
|
|
63
|
+
if (tier === "tier2-fallback-probe-back") {
|
|
64
|
+
return { kind: "in-turn", delayMs: Math.min(hintMs ?? hintedWaitCapMs, hintedWaitCapMs) };
|
|
65
|
+
}
|
|
66
|
+
return { kind: "in-turn", delayMs: baseDelayMs * 2 ** (attempt - 1) };
|
|
67
|
+
}
|
|
54
68
|
//# sourceMappingURL=hint-policy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hint-policy.js","sourceRoot":"","sources":["../../../src/core/retry-fallback/hint-policy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,UAAU,uBAAuB,CACtC,MAA0B,EAC1B,QAA6D;IAE7D,IAA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ACpC,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;QAClC,MAAM,aAAa,GAAG,KAAK,CAAC,sBAAsB,GAAG,KAAK,CAAC;QAC3D,OAAO;YACN,OAAO,EAAE,KAAK;YACd,UAAU,EAAE,WAAW;YACvB,cAAc,EAAE,UAAU;YAC1B,sBAAsB,EAAE,aAAa;YACrC,iBAAiB,EAAE,aAAa,GAAG,eAAe;SAClD,CAAC;IACH,CAAC;IAED,kGAAkG;IAClG,MAAM,KAAK,GAAG,MAAM,IAAI,WAAW,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IAC/D,OAAO;QACN,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,MAAM;QAClB,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,sBAAsB,EAAE,KAAK,CAAC,sBAAsB;QACpD,iBAAiB,EAAE,KAAK;KACxB,CAAC;AACH,CAAC","sourcesContent":["/**\n * Pure tier-policy and probe-schedule decisions for hint-aware 429 retry.\n * No timers, no I/O — all time values are injected by the caller.\n */\n\nexport type HintTier = \"no-hint-fast-fallback\" | \"tier1-in-turn\" | \"tier2-fallback-probe-back\" | \"tier3-fallback-only\";\n\nexport function classifyRateLimitedWait(\n\thintMs: number | undefined,\n\tsettings: { hintedWaitCapMs: number; probeBackMaxMs: number },\n): HintTier {\n\tif (hintMs === undefined) return \"no-hint-fast-fallback\";\n\tif (hintMs <= settings.hintedWaitCapMs) return \"tier1-in-turn\";\n\tif (hintMs < settings.probeBackMaxMs) return \"tier2-fallback-probe-back\";\n\treturn \"tier3-fallback-only\";\n}\n\nexport function probeBackSchedule(hintMs: number, nowMs: number): { firstAtMs: number; deadlineMs: number } {\n\treturn { firstAtMs: nowMs + Math.ceil(hintMs / 2), deadlineMs: nowMs + hintMs };\n}\n\nexport type ProbePhase = \"idle\" | \"half-used\" | \"done\";\n\nexport interface InTurnState {\n\tprobePhase: ProbePhase;\n\thintDeadlineMs?: number;\n\tattempt: number;\n\tcumulativeHintedWaitMs: number;\n}\n\nexport interface InTurnResult {\n\tdelayMs: number;\n\tprobePhase: \"half-used\" | \"done\";\n\thintDeadlineMs?: number;\n\tcumulativeHintedWaitMs: number;\n\tdemoteToProbeBack: boolean;\n}\n\nexport function nextInTurnDelayMs(\n\tstate: InTurnState,\n\thintMs: number | undefined,\n\tbaseDelayMs: number,\n\thintedWaitCapMs: number,\n\tnowMs: number,\n): InTurnResult {\n\t// Phase: half-used -> consecutive 429 with deadline sleep\n\tif (state.probePhase === \"half-used\") {\n\t\tconst deadlineMs = hintMs !== undefined ? nowMs + hintMs : (state.hintDeadlineMs ?? nowMs);\n\t\tconst remaining = Math.max(0, deadlineMs - nowMs);\n\t\tconst newCumulative = state.cumulativeHintedWaitMs + remaining;\n\t\treturn {\n\t\t\tdelayMs: remaining,\n\t\t\tprobePhase: \"done\",\n\t\t\thintDeadlineMs: deadlineMs,\n\t\t\tcumulativeHintedWaitMs: newCumulative,\n\t\t\tdemoteToProbeBack: newCumulative > hintedWaitCapMs,\n\t\t};\n\t}\n\n\t// Phase: idle -> first hinted 429, probe at hint/2\n\tif (state.probePhase === \"idle\" && hintMs !== undefined) {\n\t\tconst delay = Math.ceil(hintMs / 2);\n\t\tconst deadlineMs = nowMs + hintMs;\n\t\tconst newCumulative = state.cumulativeHintedWaitMs + delay;\n\t\treturn {\n\t\t\tdelayMs: delay,\n\t\t\tprobePhase: \"half-used\",\n\t\t\thintDeadlineMs: deadlineMs,\n\t\t\tcumulativeHintedWaitMs: newCumulative,\n\t\t\tdemoteToProbeBack: newCumulative > hintedWaitCapMs,\n\t\t};\n\t}\n\n\t// Phase: done (or idle without hint = non-429 / no-hint fallback) -> exponential or hint override\n\tconst delay = hintMs ?? baseDelayMs * 2 ** (state.attempt - 1);\n\treturn {\n\t\tdelayMs: delay,\n\t\tprobePhase: \"done\",\n\t\thintDeadlineMs: state.hintDeadlineMs,\n\t\tcumulativeHintedWaitMs: state.cumulativeHintedWait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EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,GAAG,CAAC,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC,EAAE,CAAC;AACvE,CAAC","sourcesContent":["/**\n * Pure tier-policy and probe-schedule decisions for hint-aware 429 retry.\n * No timers, no I/O — all time values are injected by the caller.\n */\n\nexport type HintTier = \"no-hint-fast-fallback\" | \"tier1-in-turn\" | \"tier2-fallback-probe-back\" | \"tier3-fallback-only\";\n\nexport function classifyRateLimitedWait(\n\thintMs: number | undefined,\n\tsettings: { hintedWaitCapMs: number; probeBackMaxMs: number },\n): HintTier {\n\tif (hintMs === undefined) return \"no-hint-fast-fallback\";\n\tif (hintMs <= settings.hintedWaitCapMs) return \"tier1-in-turn\";\n\tif (hintMs < settings.probeBackMaxMs) return \"tier2-fallback-probe-back\";\n\treturn \"tier3-fallback-only\";\n}\n\nexport function probeBackSchedule(hintMs: number, nowMs: number): { firstAtMs: number; deadlineMs: number } {\n\treturn { firstAtMs: nowMs + Math.ceil(hintMs / 2), deadlineMs: nowMs + hintMs };\n}\n\nexport type ProbePhase = \"idle\" | \"half-used\" | \"done\";\n\nexport interface InTurnState {\n\tprobePhase: ProbePhase;\n\thintDeadlineMs?: number;\n\tattempt: number;\n\tcumulativeHintedWaitMs: number;\n}\n\nexport interface InTurnResult {\n\tdelayMs: number;\n\tprobePhase: \"half-used\" | \"done\";\n\thintDeadlineMs?: number;\n\tcumulativeHintedWaitMs: number;\n\tdemoteToProbeBack: boolean;\n}\n\nexport function nextInTurnDelayMs(\n\tstate: InTurnState,\n\thintMs: number | undefined,\n\tbaseDelayMs: number,\n\thintedWaitCapMs: number,\n\tnowMs: number,\n): InTurnResult {\n\t// Phase: half-used -> consecutive 429 with deadline sleep\n\tif (state.probePhase === \"half-used\") {\n\t\tconst deadlineMs = hintMs !== undefined ? nowMs + hintMs : (state.hintDeadlineMs ?? nowMs);\n\t\tconst remaining = Math.max(0, deadlineMs - nowMs);\n\t\tconst newCumulative = state.cumulativeHintedWaitMs + remaining;\n\t\treturn {\n\t\t\tdelayMs: remaining,\n\t\t\tprobePhase: \"done\",\n\t\t\thintDeadlineMs: deadlineMs,\n\t\t\tcumulativeHintedWaitMs: newCumulative,\n\t\t\tdemoteToProbeBack: newCumulative > hintedWaitCapMs,\n\t\t};\n\t}\n\n\t// Phase: idle -> first hinted 429, probe at hint/2\n\tif (state.probePhase === \"idle\" && hintMs !== undefined) {\n\t\tconst delay = Math.ceil(hintMs / 2);\n\t\tconst deadlineMs = nowMs + hintMs;\n\t\tconst newCumulative = state.cumulativeHintedWaitMs + delay;\n\t\treturn {\n\t\t\tdelayMs: delay,\n\t\t\tprobePhase: \"half-used\",\n\t\t\thintDeadlineMs: deadlineMs,\n\t\t\tcumulativeHintedWaitMs: newCumulative,\n\t\t\tdemoteToProbeBack: newCumulative > hintedWaitCapMs,\n\t\t};\n\t}\n\n\t// Phase: done (or idle without hint = non-429 / no-hint fallback) -> exponential or hint override\n\tconst delay = hintMs ?? baseDelayMs * 2 ** (state.attempt - 1);\n\treturn {\n\t\tdelayMs: delay,\n\t\tprobePhase: \"done\",\n\t\thintDeadlineMs: state.hintDeadlineMs,\n\t\tcumulativeHintedWaitMs: state.cumulativeHintedWaitMs,\n\t\tdemoteToProbeBack: false,\n\t};\n}\n\nexport type DegradedRateLimitAction = { kind: \"in-turn\"; delayMs: number } | { kind: \"fail\"; hintMs: number };\n\n/**\n * Policy for a 429-class failure when no fallback candidate is usable: no-hint\n * (and tier1) failures retry in-turn on the exponential schedule, tier2 hints\n * retry in-turn with the wait clamped to the in-turn cap, and only tier3\n * (probe-back-max or longer) hinted waits stay terminal.\n */\nexport function degradeWithoutFallback(\n\ttier: HintTier,\n\thintMs: number | undefined,\n\tattempt: number,\n\tbaseDelayMs: number,\n\thintedWaitCapMs: number,\n): DegradedRateLimitAction {\n\tif (tier === \"tier3-fallback-only\") return { kind: \"fail\", hintMs: hintMs ?? 0 };\n\tif (tier === \"tier2-fallback-probe-back\") {\n\t\treturn { kind: \"in-turn\", delayMs: Math.min(hintMs ?? hintedWaitCapMs, hintedWaitCapMs) };\n\t}\n\treturn { kind: \"in-turn\", delayMs: baseDelayMs * 2 ** (attempt - 1) };\n}\n"]}
|
|
@@ -12,6 +12,23 @@
|
|
|
12
12
|
|
|
13
13
|
### Removed
|
|
14
14
|
|
|
15
|
+
## [2026.8.7] - 2026-08-07
|
|
16
|
+
|
|
17
|
+
### Breaking Changes
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- Formatted completed eval durations in the simple-result transcript branch with the same compact human-readable units
|
|
26
|
+
used by detailed cell headers and nested tool widgets, so sub-second, seconds, minutes, and hours values render as
|
|
27
|
+
labels such as `<1s`, `12s`, `3m 5s`, or `1h 2m` instead of raw millisecond counts. Live footer, working-status, and
|
|
28
|
+
thinking-duration policies are unchanged ([#743](https://github.com/code-yeongyu/senpi/pull/743)).
|
|
29
|
+
|
|
30
|
+
### Removed
|
|
31
|
+
|
|
15
32
|
## [2026.8.6] - 2026-08-06
|
|
16
33
|
|
|
17
34
|
### Breaking Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-yeongyu/senpi-codemode",
|
|
3
|
-
"version": "2026.8.
|
|
3
|
+
"version": "2026.8.7",
|
|
4
4
|
"description": "Source-only senpi extension package for codemode evaluation tools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/parser": "8.0.4",
|
|
33
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.
|
|
33
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.7",
|
|
34
34
|
"typebox": "1.3.8"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
37
|
+
"@code-yeongyu/senpi": "2026.8.7"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@code-yeongyu/senpi": "2026.8.
|
|
40
|
+
"@code-yeongyu/senpi": "2026.8.7"
|
|
41
41
|
},
|
|
42
42
|
"keywords": [
|
|
43
43
|
"senpi",
|
|
@@ -757,7 +757,8 @@ function resultMetadata(
|
|
|
757
757
|
): RenderBlock[] {
|
|
758
758
|
const metadata: string[] = [];
|
|
759
759
|
if (details?.phase) metadata.push(`phase ${details.phase}`);
|
|
760
|
-
if (!options.isPartial && typeof details?.durationMs === "number")
|
|
760
|
+
if (!options.isPartial && typeof details?.durationMs === "number")
|
|
761
|
+
metadata.push(`took ${formatDuration(details.durationMs)}`);
|
|
761
762
|
if (metadata.length === 0) return [];
|
|
762
763
|
return [{ kind: "text", text: style(theme, "muted", metadata.join(" | ")) }];
|
|
763
764
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-agent-core",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "2026.8.
|
|
4
|
+
"version": "2026.8.7",
|
|
5
5
|
"description": "General-purpose agent with transport abstraction, state management, and attachment support",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"prepublishOnly": "npm run build"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.
|
|
33
|
+
"@earendil-works/pi-ai": "npm:@code-yeongyu/senpi-ai@2026.8.7",
|
|
34
34
|
"diff": "9.0.0",
|
|
35
35
|
"ignore": "7.0.6",
|
|
36
36
|
"typebox": "1.3.8",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":3,"generatedAt":"2026-08-
|
|
1
|
+
{"schemaVersion":3,"generatedAt":"2026-08-07T04:42:03.340Z","structureHash":"619f6ba4d43bdf2ab942c16d591c5aa88a0e3545f74f896e0c7e71e8a6200376","files":{"alibaba-token-plan.json":"e84668baa90b6ea64fbd9a5192bd3945c5011bc79ac2b4f3e7b3b58467d4403d","amazon-bedrock.json":"d0a215122f81e4497ef45a5f65fd8df067fd22103f10049ad77f4e2f4f10edb4","ant-ling.json":"4979fe79d99ed97382d7ce40170c6132e932e77906de1eb54464c042e7d63633","anthropic.json":"5bf1deecb96805ccba8ec004680e54b1c73ac29a8bfbbf4adaf7c5e66c1ceef2","azure-openai-responses.json":"5315b6a2299fefbdbb6cc13a720544077c9498132ad5e3a7d76a8c1daa8e9335","cerebras.json":"3fd3e19b83ab4be07d27817e25e5be0ffe4158b1394f0311d6a22d9f03847728","cloudflare-ai-gateway.json":"cd050aa8cf61b73b13d532341639e1d0f22fd29d8a889ca669d412cd4b477d45","cloudflare-workers-ai.json":"03b19d69433c843512e953390d51d4578e9b91f19098a9b14ff820c001623598","deepseek.json":"0dcc807a4e5827b488c6ceac87884ff6e735e01cf4f2ddfec9dd812e6fde041b","fireworks.json":"0e10df29511e70b6987cbe27d8d1222c2c5f63b6ddb66c2401a2990a61a5999e","github-copilot.json":"08fd4f44d648f812ea4eeb2aed3e5fbbe08f482afbb51ef64eac1c8ee414f2f9","google-vertex.json":"99d0b89ac9d8dc460ed922236abffbe88c9381af4d35046d2ad3a8f08fa2560c","google.json":"bcf8a8d59ccbb75bc6fb4a261a37ac4b7c806f40ee7313b4411178964be5fa37","groq.json":"f1eb899453e70b5e4479fe6eb78869ee99121fa6d4a019a5a05ab42d2ada8992","huggingface.json":"deb4523f0526dc93ecdfc89b545bc44b56fd329d3c5a7322032e6a2783a82956","kimi-coding.json":"9d73ca15313628bb8cf80c21e6466164e350d68471e2d7205b5e21bcd2c141f3","minimax-cn.json":"8ccd71ff838f4b78bb88809babb0dc32a4fcfaec2bc4f4083841000428df4f77","minimax.json":"253edd4c910a41c8bb252400ba099f3a4de0a8900ce154319288ab091b372987","mistral.json":"4f9d84bf1ba10cb14ff2c9e23e77d63441756ef3500375dd4ad10094614b215b","moonshotai-cn.json":"1e6146ff3477883636448c0f44222f0a52b3c4562ef8f4eecf7e941cdd59d12e","moonshotai.json":"d8d5209873058ddccd37c1f026833e2ea3f9476c3dc9628b4a940d407acc0b2e","nvidia.json":"33c498ab62940fe9ca659826c35cc922a77938a5f7edbe4443c10d9133323e87","openai-codex.json":"4a73818291987693fcb53e9e61b4be3429ffd78b3f64ea877a34c5f9928c89e1","openai.json":"2c5d2354c55a80671f20f555844986ab381fee93da26e03c0e42cbae77b519a5","opencode-go.json":"5e6d8256e3b3db2ee3f6783763b8e72b415612f1aa4acf6a305cea51888dde85","opencode.json":"f23c9a4ca77471a28df7c1f0d238e022493916b7397bdf42a667b61e01185db9","openrouter.json":"219ab412b03298d71a7606659c0294cc6bde5c0ff28274e085fb2178defa8665","qwen-token-plan-cn.json":"cc345d44c31b0ba3b1b244f8b56342ede6657584653f3af176026bf8dbb37cd5","qwen-token-plan.json":"12c43b2b8032e1b64222616588daf400156f3819be4de3124fc997a69eccbda8","together.json":"c01b9a0790a0d4bc442953a9e66d733a5a058cc7b82826aa58a2946a7012d416","vercel-ai-gateway.json":"c4f5b4a2e5c450884a24b099bc296bb6af6c51f8df55504b600c0d2df4f75c6d","xai.json":"4cbdbfbbf915246369b9bacbc6f1feeb56accdac9f3444456343f750547f2f38","xiaomi-token-plan-ams.json":"b1886b741867c90a838c377e86ad64b26ca6b0e349f1a75bc5fd4ed99df03c21","xiaomi-token-plan-cn.json":"11f459b794eddd64a9d9d102f2799c364732b7f0d562e22573f4995a5d1e1a30","xiaomi-token-plan-sgp.json":"0b9953d03b75260aba0ad604cc76d7ed26d6841448819e8c7488bf0d90948d2c","xiaomi.json":"edf39e0edd9dcae23e669635ea782e5870c0b9663d4b918b8ff9bd307cfe35f8","zai-coding-cn.json":"c2d1e137238b6f248b5f620f76b64520aa2ba1543e991dd0d14b708e50c8cd66","zai.json":"cb48b354442f1e49919cd93b928216d5d881d2f98a55349ad592a8e68bb8e6c3"}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"openai-completions":{"MiniMaxAI/MiniMax-M2":{"id":"MiniMaxAI/MiniMax-M2","name":"MiniMax-M2","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.3,"output":1.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":128000},"MiniMaxAI/MiniMax-M2.1":{"id":"MiniMaxAI/MiniMax-M2.1","name":"MiniMax-M2.1","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.3,"output":1.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":131072},"MiniMaxAI/MiniMax-M2.5":{"id":"MiniMaxAI/MiniMax-M2.5","name":"MiniMax-M2.5","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.3,"output":1.2,"cacheRead":0.03,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":131072},"MiniMaxAI/MiniMax-M2.7":{"id":"MiniMaxAI/MiniMax-M2.7","name":"MiniMax-M2.7","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.3,"output":1.2,"cacheRead":0.06,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":131072},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":1.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":524288,"maxTokens":128000},"Qwen/Qwen3-235B-A22B":{"id":"Qwen/Qwen3-235B-A22B","name":"Qwen3 235B-A22B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.2,"output":0.8,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":40960,"maxTokens":16384},"Qwen/Qwen3-235B-A22B-Thinking-2507":{"id":"Qwen/Qwen3-235B-A22B-Thinking-2507","name":"Qwen3-235B-A22B-Thinking-2507","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.3,"output":3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":131072},"Qwen/Qwen3-32B":{"id":"Qwen/Qwen3-32B","name":"Qwen3 32B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.29,"output":0.59,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":16384},"Qwen/Qwen3-Coder-30B-A3B-Instruct":{"id":"Qwen/Qwen3-Coder-30B-A3B-Instruct","name":"Qwen3-Coder 30B-A3B Instruct","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.07,"output":0.26,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{"id":"Qwen/Qwen3-Coder-480B-A35B-Instruct","name":"Qwen3-Coder-480B-A35B-Instruct","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":66536},"Qwen/Qwen3-Coder-Next":{"id":"Qwen/Qwen3-Coder-Next","name":"Qwen3-Coder-Next","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.2,"output":1.5,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3-Next-80B-A3B-Instruct":{"id":"Qwen/Qwen3-Next-80B-A3B-Instruct","name":"Qwen3-Next-80B-A3B-Instruct","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.25,"output":1,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":66536},"Qwen/Qwen3-Next-80B-A3B-Thinking":{"id":"Qwen/Qwen3-Next-80B-A3B-Thinking","name":"Qwen3-Next-80B-A3B-Thinking","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.3,"output":2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":131072},"Qwen/Qwen3.5-122B-A10B":{"id":"Qwen/Qwen3.5-122B-A10B","name":"Qwen3.5 122B-A10B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.4,"output":3.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3.5-27B":{"id":"Qwen/Qwen3.5-27B","name":"Qwen3.5 27B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":2.4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3.5-35B-A3B":{"id":"Qwen/Qwen3.5-35B-A3B","name":"Qwen3.5 35B-A3B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.25,"output":2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3.5-397B-A17B":{"id":"Qwen/Qwen3.5-397B-A17B","name":"Qwen3.5-397B-A17B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.6,"output":3.6,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":32768,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"Qwen/Qwen3.5-9B":{"id":"Qwen/Qwen3.5-9B","name":"Qwen3.5 9B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.17,"output":0.25,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3.6-27B":{"id":"Qwen/Qwen3.6-27B","name":"Qwen3.6 27B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.47,"output":3.19,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3.6-35B-A3B":{"id":"Qwen/Qwen3.6-35B-A3B","name":"Qwen3.6 35B-A3B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.15,"output":0.95,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"XiaomiMiMo/MiMo-V2-Flash":{"id":"XiaomiMiMo/MiMo-V2-Flash","name":"MiMo-V2-Flash","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.1,"output":0.3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":4096},"XiaomiMiMo/MiMo-V2.5":{"id":"XiaomiMiMo/MiMo-V2.5","name":"MiMo-V2.5","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.4,"output":2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":131072,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null}},"XiaomiMiMo/MiMo-V2.5-Pro":{"id":"XiaomiMiMo/MiMo-V2.5-Pro","name":"MiMo-V2.5-Pro","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":1,"output":3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1048576,"maxTokens":131072,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null}},"deepseek-ai/DeepSeek-R1":{"id":"deepseek-ai/DeepSeek-R1","name":"DeepSeek-R1","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.7,"output":2.5,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":64000,"maxTokens":32768},"deepseek-ai/DeepSeek-R1-0528":{"id":"deepseek-ai/DeepSeek-R1-0528","name":"DeepSeek-R1-0528","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":3,"output":5,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":163840,"maxTokens":163840},"deepseek-ai/DeepSeek-V3.2":{"id":"deepseek-ai/DeepSeek-V3.2","name":"DeepSeek-V3.2","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.28,"output":0.4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":163840,"maxTokens":65536},"deepseek-ai/DeepSeek-V4-Flash":{"id":"deepseek-ai/DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.14,"output":0.28,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1048576,"maxTokens":384000},"deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.14,"output":0.28,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1048576,"maxTokens":384000,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"}},"deepseek-ai/DeepSeek-V4-Pro":{"id":"deepseek-ai/DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.435,"output":0.87,"cacheRead":0.003625,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1048576,"maxTokens":393216,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null}},"google/gemma-4-26B-A4B-it":{"id":"google/gemma-4-26B-A4B-it","name":"Gemma 4 26B A4B IT","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.13,"output":0.4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":32768},"google/gemma-4-31B-it":{"id":"google/gemma-4-31B-it","name":"Gemma 4 31B IT","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.14,"output":0.4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":32768},"meta-llama/Llama-3.3-70B-Instruct":{"id":"meta-llama/Llama-3.3-70B-Instruct","name":"Llama-3.3-70B-Instruct","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.59,"output":0.79,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":4096},"moonshotai/Kimi-K2-Instruct":{"id":"moonshotai/Kimi-K2-Instruct","name":"Kimi-K2-Instruct","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":1,"output":3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":16384},"moonshotai/Kimi-K2-Instruct-0905":{"id":"moonshotai/Kimi-K2-Instruct-0905","name":"Kimi-K2-Instruct-0905","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":1,"output":3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":16384},"moonshotai/Kimi-K2-Thinking":{"id":"moonshotai/Kimi-K2-Thinking","name":"Kimi-K2-Thinking","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.6,"output":2.5,"cacheRead":0.15,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":262144},"moonshotai/Kimi-K2.5":{"id":"moonshotai/Kimi-K2.5","name":"Kimi-K2.5","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.6,"output":3,"cacheRead":0.1,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":262144},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi-K2.6","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.95,"output":4,"cacheRead":0.16,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":262144},"moonshotai/Kimi-K2.7-Code":{"id":"moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.95,"output":4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":262144},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1000000,"maxTokens":131072,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"}},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.25,"output":0.69,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":32768,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.1,"output":0.5,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":32768,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"stepfun-ai/Step-3.5-Flash":{"id":"stepfun-ai/Step-3.5-Flash","name":"Step 3.5 Flash","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.1,"output":0.3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":256000},"stepfun-ai/Step-3.7-Flash":{"id":"stepfun-ai/Step-3.7-Flash","name":"Step 3.7 Flash","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.2,"output":1.15,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":256000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"tencent/Hy3":{"id":"tencent/Hy3","name":"Hy3","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.14,"output":0.58,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":64000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":null}},"thinkingmachines/Inkling":{"id":"thinkingmachines/Inkling","name":"Inkling","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":1,"output":4.05,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1048576,"maxTokens":1048576,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"thinkingmachines/Inkling-Small":{"id":"thinkingmachines/Inkling-Small","name":"Inkling Small","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.5,"output":1.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":524288,"maxTokens":1048576},"zai-org/GLM-4.5":{"id":"zai-org/GLM-4.5","name":"GLM-4.5","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.6,"output":2.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":98304},"zai-org/GLM-4.5-Air":{"id":"zai-org/GLM-4.5-Air","name":"GLM-4.5-Air","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.13,"output":0.85,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":98304},"zai-org/GLM-4.5V":{"id":"zai-org/GLM-4.5V","name":"GLM-4.5V","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.6,"output":1.8,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":65536,"maxTokens":16384},"zai-org/GLM-4.6":{"id":"zai-org/GLM-4.6","name":"GLM-4.6","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.55,"output":2.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":131072},"zai-org/GLM-4.7":{"id":"zai-org/GLM-4.7","name":"GLM-4.7","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.6,"output":2.2,"cacheRead":0.11,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":131072},"zai-org/GLM-4.7-Flash":{"id":"zai-org/GLM-4.7-Flash","name":"GLM-4.7-Flash","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":200000,"maxTokens":128000},"zai-org/GLM-5":{"id":"zai-org/GLM-5","name":"GLM-5","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":1,"output":3.2,"cacheRead":0.2,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":202752,"maxTokens":131072},"zai-org/GLM-5.1":{"id":"zai-org/GLM-5.1","name":"GLM-5.1","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":1,"output":3.2,"cacheRead":0.2,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":202752,"maxTokens":131072},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":131072}}}
|
|
1
|
+
{"openai-completions":{"MiniMaxAI/MiniMax-M2":{"id":"MiniMaxAI/MiniMax-M2","name":"MiniMax-M2","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.3,"output":1.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":128000},"MiniMaxAI/MiniMax-M2.1":{"id":"MiniMaxAI/MiniMax-M2.1","name":"MiniMax-M2.1","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.3,"output":1.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":131072},"MiniMaxAI/MiniMax-M2.5":{"id":"MiniMaxAI/MiniMax-M2.5","name":"MiniMax-M2.5","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.3,"output":1.2,"cacheRead":0.03,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":131072},"MiniMaxAI/MiniMax-M2.7":{"id":"MiniMaxAI/MiniMax-M2.7","name":"MiniMax-M2.7","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.3,"output":1.2,"cacheRead":0.06,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":131072},"MiniMaxAI/MiniMax-M3":{"id":"MiniMaxAI/MiniMax-M3","name":"MiniMax-M3","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":1.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":524288,"maxTokens":128000},"Qwen/Qwen3-235B-A22B":{"id":"Qwen/Qwen3-235B-A22B","name":"Qwen3 235B-A22B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.2,"output":0.8,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":40960,"maxTokens":16384},"Qwen/Qwen3-235B-A22B-Instruct-2507":{"id":"Qwen/Qwen3-235B-A22B-Instruct-2507","name":"Qwen3 235B-A22B Instruct 2507","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.855,"output":2.565,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":16384},"Qwen/Qwen3-235B-A22B-Thinking-2507":{"id":"Qwen/Qwen3-235B-A22B-Thinking-2507","name":"Qwen3-235B-A22B-Thinking-2507","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.3,"output":3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":131072},"Qwen/Qwen3-32B":{"id":"Qwen/Qwen3-32B","name":"Qwen3 32B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.29,"output":0.59,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":16384},"Qwen/Qwen3-Coder-30B-A3B-Instruct":{"id":"Qwen/Qwen3-Coder-30B-A3B-Instruct","name":"Qwen3-Coder 30B-A3B Instruct","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.07,"output":0.26,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3-Coder-480B-A35B-Instruct":{"id":"Qwen/Qwen3-Coder-480B-A35B-Instruct","name":"Qwen3-Coder-480B-A35B-Instruct","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":2,"output":2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":66536},"Qwen/Qwen3-Coder-Next":{"id":"Qwen/Qwen3-Coder-Next","name":"Qwen3-Coder-Next","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.2,"output":1.5,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3-Next-80B-A3B-Instruct":{"id":"Qwen/Qwen3-Next-80B-A3B-Instruct","name":"Qwen3-Next-80B-A3B-Instruct","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.25,"output":1,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":66536},"Qwen/Qwen3-Next-80B-A3B-Thinking":{"id":"Qwen/Qwen3-Next-80B-A3B-Thinking","name":"Qwen3-Next-80B-A3B-Thinking","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.3,"output":2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":131072},"Qwen/Qwen3.5-122B-A10B":{"id":"Qwen/Qwen3.5-122B-A10B","name":"Qwen3.5 122B-A10B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.4,"output":3.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3.5-27B":{"id":"Qwen/Qwen3.5-27B","name":"Qwen3.5 27B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.3,"output":2.4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3.5-35B-A3B":{"id":"Qwen/Qwen3.5-35B-A3B","name":"Qwen3.5 35B-A3B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.25,"output":2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3.5-397B-A17B":{"id":"Qwen/Qwen3.5-397B-A17B","name":"Qwen3.5-397B-A17B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.6,"output":3.6,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":32768,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"Qwen/Qwen3.5-9B":{"id":"Qwen/Qwen3.5-9B","name":"Qwen3.5 9B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.17,"output":0.25,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3.6-27B":{"id":"Qwen/Qwen3.6-27B","name":"Qwen3.6 27B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.47,"output":3.19,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"Qwen/Qwen3.6-35B-A3B":{"id":"Qwen/Qwen3.6-35B-A3B","name":"Qwen3.6 35B-A3B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.15,"output":0.95,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":65536},"XiaomiMiMo/MiMo-V2-Flash":{"id":"XiaomiMiMo/MiMo-V2-Flash","name":"MiMo-V2-Flash","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.1,"output":0.3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":4096},"XiaomiMiMo/MiMo-V2.5":{"id":"XiaomiMiMo/MiMo-V2.5","name":"MiMo-V2.5","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.4,"output":2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":131072,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null}},"XiaomiMiMo/MiMo-V2.5-Pro":{"id":"XiaomiMiMo/MiMo-V2.5-Pro","name":"MiMo-V2.5-Pro","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":1,"output":3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1048576,"maxTokens":131072,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":"medium","high":"high","xhigh":"xhigh","max":null}},"deepseek-ai/DeepSeek-R1":{"id":"deepseek-ai/DeepSeek-R1","name":"DeepSeek-R1","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.7,"output":2.5,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":64000,"maxTokens":32768},"deepseek-ai/DeepSeek-R1-0528":{"id":"deepseek-ai/DeepSeek-R1-0528","name":"DeepSeek-R1-0528","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":3,"output":5,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":163840,"maxTokens":163840},"deepseek-ai/DeepSeek-V3":{"id":"deepseek-ai/DeepSeek-V3","name":"DeepSeek-V3","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.4,"output":1.3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":64000,"maxTokens":8192},"deepseek-ai/DeepSeek-V3.1":{"id":"deepseek-ai/DeepSeek-V3.1","name":"DeepSeek-V3.1","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.27,"output":1,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":8192},"deepseek-ai/DeepSeek-V3.2":{"id":"deepseek-ai/DeepSeek-V3.2","name":"DeepSeek-V3.2","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.28,"output":0.4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":163840,"maxTokens":65536},"deepseek-ai/DeepSeek-V4-Flash":{"id":"deepseek-ai/DeepSeek-V4-Flash","name":"DeepSeek V4 Flash","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.14,"output":0.28,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1048576,"maxTokens":384000},"deepseek-ai/DeepSeek-V4-Flash-0731":{"id":"deepseek-ai/DeepSeek-V4-Flash-0731","name":"DeepSeek V4 Flash 0731","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.14,"output":0.28,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1048576,"maxTokens":384000,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":"max"}},"deepseek-ai/DeepSeek-V4-Pro":{"id":"deepseek-ai/DeepSeek-V4-Pro","name":"DeepSeek V4 Pro","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.435,"output":0.87,"cacheRead":0.003625,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1048576,"maxTokens":393216,"thinkingLevelMap":{"off":null,"minimal":null,"low":null,"medium":null,"high":"high","xhigh":null,"max":null}},"google/gemma-4-26B-A4B-it":{"id":"google/gemma-4-26B-A4B-it","name":"Gemma 4 26B A4B IT","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.13,"output":0.4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":32768},"google/gemma-4-31B-it":{"id":"google/gemma-4-31B-it","name":"Gemma 4 31B IT","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.14,"output":0.4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":32768},"meta-llama/Llama-3.3-70B-Instruct":{"id":"meta-llama/Llama-3.3-70B-Instruct","name":"Llama-3.3-70B-Instruct","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":0.59,"output":0.79,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":4096},"moonshotai/Kimi-K2-Instruct":{"id":"moonshotai/Kimi-K2-Instruct","name":"Kimi-K2-Instruct","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":1,"output":3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":16384},"moonshotai/Kimi-K2-Instruct-0905":{"id":"moonshotai/Kimi-K2-Instruct-0905","name":"Kimi-K2-Instruct-0905","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":false,"input":["text"],"cost":{"input":1,"output":3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":16384},"moonshotai/Kimi-K2-Thinking":{"id":"moonshotai/Kimi-K2-Thinking","name":"Kimi-K2-Thinking","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.6,"output":2.5,"cacheRead":0.15,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":262144},"moonshotai/Kimi-K2.5":{"id":"moonshotai/Kimi-K2.5","name":"Kimi-K2.5","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.6,"output":3,"cacheRead":0.1,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":262144},"moonshotai/Kimi-K2.6":{"id":"moonshotai/Kimi-K2.6","name":"Kimi-K2.6","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.95,"output":4,"cacheRead":0.16,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":262144},"moonshotai/Kimi-K2.7-Code":{"id":"moonshotai/Kimi-K2.7-Code","name":"Kimi K2.7 Code","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.95,"output":4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":262144},"moonshotai/Kimi-K3":{"id":"moonshotai/Kimi-K3","name":"Kimi K3","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":3,"output":15,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1000000,"maxTokens":131072,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":"max"}},"openai/gpt-oss-120b":{"id":"openai/gpt-oss-120b","name":"GPT OSS 120B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.25,"output":0.69,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":32768,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"openai/gpt-oss-20b":{"id":"openai/gpt-oss-20b","name":"GPT OSS 20B","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.1,"output":0.5,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":32768,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"stepfun-ai/Step-3.5-Flash":{"id":"stepfun-ai/Step-3.5-Flash","name":"Step 3.5 Flash","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.1,"output":0.3,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":256000},"stepfun-ai/Step-3.7-Flash":{"id":"stepfun-ai/Step-3.7-Flash","name":"Step 3.7 Flash","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.2,"output":1.15,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":256000,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"tencent/Hy3":{"id":"tencent/Hy3","name":"Hy3","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.14,"output":0.58,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":64000,"thinkingLevelMap":{"off":"none","minimal":null,"low":"low","medium":null,"high":"high","xhigh":null,"max":null}},"thinkingmachines/Inkling":{"id":"thinkingmachines/Inkling","name":"Inkling","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":1,"output":4.05,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":1048576,"maxTokens":1048576,"thinkingLevelMap":{"off":null,"minimal":null,"low":"low","medium":"medium","high":"high","xhigh":null,"max":null}},"thinkingmachines/Inkling-Small":{"id":"thinkingmachines/Inkling-Small","name":"Inkling Small","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.5,"output":1.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":524288,"maxTokens":1048576},"zai-org/GLM-4.5":{"id":"zai-org/GLM-4.5","name":"GLM-4.5","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.6,"output":2.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":98304},"zai-org/GLM-4.5-Air":{"id":"zai-org/GLM-4.5-Air","name":"GLM-4.5-Air","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.13,"output":0.85,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":131072,"maxTokens":98304},"zai-org/GLM-4.5V":{"id":"zai-org/GLM-4.5V","name":"GLM-4.5V","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text","image"],"cost":{"input":0.6,"output":1.8,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":65536,"maxTokens":16384},"zai-org/GLM-4.6":{"id":"zai-org/GLM-4.6","name":"GLM-4.6","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.55,"output":2.2,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":131072},"zai-org/GLM-4.7":{"id":"zai-org/GLM-4.7","name":"GLM-4.7","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0.6,"output":2.2,"cacheRead":0.11,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":204800,"maxTokens":131072},"zai-org/GLM-4.7-Flash":{"id":"zai-org/GLM-4.7-Flash","name":"GLM-4.7-Flash","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":0,"output":0,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":200000,"maxTokens":128000},"zai-org/GLM-5":{"id":"zai-org/GLM-5","name":"GLM-5","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":1,"output":3.2,"cacheRead":0.2,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":202752,"maxTokens":131072},"zai-org/GLM-5.1":{"id":"zai-org/GLM-5.1","name":"GLM-5.1","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":1,"output":3.2,"cacheRead":0.2,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":202752,"maxTokens":131072},"zai-org/GLM-5.2":{"id":"zai-org/GLM-5.2","name":"GLM-5.2","api":"openai-completions","provider":"huggingface","baseUrl":"https://router.huggingface.co/v1","reasoning":true,"input":["text"],"cost":{"input":1.4,"output":4.4,"cacheRead":0,"cacheWrite":0},"compat":{"supportsDeveloperRole":false},"contextWindow":262144,"maxTokens":131072}}}
|