refactor: use friendly model ids globally

Co-authored-by: Simon Shi <simonsmh@users.noreply.github.com>
This commit is contained in:
Cursor Agent
2026-08-31 16:29:52 +00:00
co-authored by Simon Shi
parent ca17a95270
commit aaac381d76
6 changed files with 125 additions and 83 deletions
+19 -14
View File
@@ -96,20 +96,25 @@ China:
### Global `qoder` ### Global `qoder`
Exposes the backing model keys returned by Qoder, including: Exposes friendly IDs derived from the catalog `display_name` (whitespace is
removed), including:
- **Tier Models**: `auto`, `ultimate`, `performance`, `efficient`, `lite` - **Tier Models**: `Auto`, `Ultimate`, `Performance`, `Efficient`, `Lite`
- **Frontier Models**: - **Frontier Models**:
- `qmodel` (Qwen3.7 Plus) - `Qwen3.7Plus`
- `cmodel` (Cantus) - `Cantus`
- `qmodel_preview` (Qwen3.8 Max Preview) - `Qwen3.8-Max`
- `qmodel_latest` (Qwen3.7 Max) - `Qwen3.7-Max`
- `dmodel` (DeepSeek V4 Pro) - `DeepSeek-V4-Pro`
- `dfmodel` (DeepSeek V4 Flash) - `DeepSeek-V4-Flash`
- `gm51model` (GLM 5.2) - `GLM-5.2`
- `kmodel` (Kimi K2.7 Code) - `Kimi-K2.7-Code`
- `kmodel_latest` (Kimi K3) - `Kimi-K3`
- `mmodel` (MiniMax M3) - `MiniMax-M3`
The original service keys remain compatibility aliases, so existing commands
such as `--model lite` and references such as `qoder/lite` still send the
upstream `lite` key.
Global models default to a 1M context window, matching the Qoder API (verified Global models default to a 1M context window, matching the Qoder API (verified
against `lite` with prompts up to 1,000K tokens). `kmodel` stays at the 256K its against `lite` with prompts up to 1,000K tokens). `kmodel` stays at the 256K its
@@ -153,7 +158,7 @@ pi --provider qoder-cn --model qwen3.7-plus
Global example: Global example:
```bash ```bash
pi --provider qoder --model auto pi --provider qoder --model Lite
``` ```
## Architecture ## Architecture
@@ -161,7 +166,7 @@ pi --provider qoder --model auto
```text ```text
src/ src/
├── index.ts # Extension registration ├── index.ts # Extension registration
├── cosy.ts # COSY signature, machine ID, region/endpoints, CN model aliases ├── cosy.ts # COSY signature, machine ID, region/endpoints, friendly model IDs
├── login.ts # OAuth device flow + PAT login sequence ├── login.ts # OAuth device flow + PAT login sequence
├── pat.ts # PAT → job-token exchange + identity resolution ├── pat.ts # PAT → job-token exchange + identity resolution
├── models.ts # Model definitions and dynamic config cache ├── models.ts # Model definitions and dynamic config cache
+8 -8
View File
@@ -14,7 +14,7 @@ import {
getQoderUserEmailFallback, getQoderUserEmailFallback,
getQoderUserInfoURL, getQoderUserInfoURL,
isQoderCNMode, isQoderCNMode,
toQoderCNModelId, toQoderModelId,
} from "../cosy.js"; } from "../cosy.js";
// ── getQoderMode ────────────────────────────────────────────────────────── // ── getQoderMode ──────────────────────────────────────────────────────────
@@ -159,24 +159,24 @@ describe("getQoderUserEmailFallback", () => {
}); });
}); });
// ── toQoderCNModelId ────────────────────────────────────────────────────── // ── toQoderModelId ────────────────────────────────────────────────────────
describe("toQoderCNModelId", () => { describe("toQoderModelId", () => {
it("strips whitespace from the upstream display_name", () => { it("strips whitespace from the upstream display_name", () => {
// The display name is used directly as the pi-visible model id, with // The display name is used directly as the pi-visible model id, with
// whitespace removed so it stays a clean token for persistence keys and // whitespace removed so it stays a clean token for persistence keys and
// search. "Qwen3.8-Flash" has no spaces already. // search. "Qwen3.8-Flash" has no spaces already.
expect(toQoderCNModelId("Qwen3.8-Flash")).toBe("Qwen3.8-Flash"); expect(toQoderModelId("Qwen3.8-Flash")).toBe("Qwen3.8-Flash");
}); });
it("collapses internal spaces", () => { it("collapses internal spaces", () => {
expect(toQoderCNModelId("Qwen 3.8 Max")).toBe("Qwen3.8Max"); expect(toQoderModelId("Qwen 3.8 Max")).toBe("Qwen3.8Max");
expect(toQoderCNModelId("DeepSeek V4 Pro")).toBe("DeepSeekV4Pro"); expect(toQoderModelId("DeepSeek V4 Pro")).toBe("DeepSeekV4Pro");
}); });
it("falls back to a default when no display name is given", () => { it("falls back to a default when no display name is given", () => {
expect(toQoderCNModelId()).toBe("QoderCNModel"); expect(toQoderModelId()).toBe("QoderModel");
expect(toQoderCNModelId("")).toBe("QoderCNModel"); expect(toQoderModelId("")).toBe("QoderModel");
}); });
}); });
+12 -5
View File
@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";
import { import {
contextWindowFromCatalog, contextWindowFromCatalog,
DEFAULT_CONTEXT_WINDOW, DEFAULT_CONTEXT_WINDOW,
getCachedModelConfig,
staticCnModels, staticCnModels,
staticModels, staticModels,
ZERO_COST, ZERO_COST,
@@ -16,7 +17,7 @@ describe("staticModels", () => {
}); });
it("has auto as first entry", () => { it("has auto as first entry", () => {
expect(staticModels[0].id).toBe("auto"); expect(staticModels[0].id).toBe("Auto");
}); });
it("every model has required fields", () => { it("every model has required fields", () => {
@@ -43,16 +44,22 @@ describe("staticModels", () => {
it("uses a 1M context window for models confirmed to support it", () => { it("uses a 1M context window for models confirmed to support it", () => {
// Global lite was live-tested through 1,000K tokens (issue #13). auto, // Global lite was live-tested through 1,000K tokens (issue #13). auto,
// efficient, and gm51model share the same Qoder 1M catalog family. // efficient, and gm51model share the same Qoder 1M catalog family.
for (const id of ["auto", "efficient", "lite", "gm51model"]) { for (const key of ["auto", "efficient", "lite", "gm51model"]) {
const model = staticModels.find((m) => m.id === id); const model = staticModels.find((m) => m.upstreamKey === key);
expect(model, id).toBeDefined(); expect(model, key).toBeDefined();
expect(model?.contextWindow).toBe(DEFAULT_CONTEXT_WINDOW); expect(model?.contextWindow).toBe(DEFAULT_CONTEXT_WINDOW);
expect(model?.contextWindow).toBe(1_000_000); expect(model?.contextWindow).toBe(1_000_000);
} }
}); });
it("keeps kmodel at the catalog-advertised 256K window", () => { it("keeps kmodel at the catalog-advertised 256K window", () => {
expect(staticModels.find((m) => m.id === "kmodel")?.contextWindow).toBe(256000); expect(staticModels.find((m) => m.upstreamKey === "kmodel")?.contextWindow).toBe(256000);
});
it("maps friendly ids and legacy keys to the same static upstream key", () => {
expect(getCachedModelConfig("Lite", "global")?.key).toBe("lite");
expect(getCachedModelConfig("lite", "global")?.key).toBe("lite");
expect(getCachedModelConfig("Qwen3.8-Max", "global")?.key).toBe("qmodel_preview");
}); });
}); });
+2 -2
View File
@@ -125,8 +125,8 @@ export function getQoderRefreshURL(mode?: string): string {
* tracks whatever upstream returns, so a renamed/upgraded model is shown * tracks whatever upstream returns, so a renamed/upgraded model is shown
* correctly without a code change. * correctly without a code change.
*/ */
export function toQoderCNModelId(displayName?: string): string { export function toQoderModelId(displayName?: string): string {
return (displayName || "QoderCNModel").replace(/\s+/g, ""); return (displayName || "QoderModel").replace(/\s+/g, "");
} }
export function getQoderManageUrl(mode?: string): string { export function getQoderManageUrl(mode?: string): string {
+80 -47
View File
@@ -8,7 +8,7 @@ import {
getQoderMode, getQoderMode,
getQoderModelListURL, getQoderModelListURL,
isQoderCNMode, isQoderCNMode,
toQoderCNModelId, toQoderModelId,
} from "./cosy.js"; } from "./cosy.js";
export const ZERO_COST = Object.freeze({ input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }); export const ZERO_COST = Object.freeze({ input: 0, output: 0, cacheRead: 0, cacheWrite: 0 });
@@ -55,6 +55,7 @@ export interface QoderModelEntry {
export interface QoderModelDef { export interface QoderModelDef {
id: string; id: string;
upstreamKey?: string;
name: string; name: string;
api: "qoder-api"; api: "qoder-api";
provider: "qoder" | "qoder-cn"; provider: "qoder" | "qoder-cn";
@@ -80,8 +81,10 @@ function getQoderCachePath(mode?: string): string {
export const staticModels: QoderModelDef[] = [ export const staticModels: QoderModelDef[] = [
{ {
id: "auto", id: "Auto",
name: "Qoder Auto", upstreamKey: "auto",
upstreamKey: "auto",
name: "Auto",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -93,8 +96,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "ultimate", id: "Ultimate",
name: "Qoder Ultimate", upstreamKey: "ultimate",
name: "Ultimate",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -106,8 +110,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "performance", id: "Performance",
name: "Qoder Performance", upstreamKey: "performance",
name: "Performance",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -119,8 +124,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "efficient", id: "Efficient",
name: "Qoder Efficient", upstreamKey: "efficient",
name: "Efficient",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -132,8 +138,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "lite", id: "Lite",
name: "Qoder Lite", upstreamKey: "lite",
name: "Lite",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -145,8 +152,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "qmodel", id: "Qwen3.7Plus",
name: "Qwen3.7 Plus (Qoder)", upstreamKey: "qmodel",
name: "Qwen3.7 Plus",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -158,8 +166,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "cmodel", id: "Cantus",
name: "Cantus (Qoder)", upstreamKey: "cmodel",
name: "Cantus",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -171,8 +180,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "qmodel_preview", id: "Qwen3.8-Max",
name: "Qwen3.8 Max Preview (Qoder)", upstreamKey: "qmodel_preview",
name: "Qwen3.8-Max",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -184,8 +194,10 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "qmodel_latest", id: "Qwen3.7-Max",
name: "Qwen3.7 Max (Qoder)", upstreamKey: "qmodel_latest",
upstreamKey: "qmodel_latest",
name: "Qwen3.7-Max",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -197,8 +209,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "dmodel", id: "DeepSeek-V4-Pro",
name: "DeepSeek V4 Pro (Qoder)", upstreamKey: "dmodel",
name: "DeepSeek-V4-Pro",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -210,8 +223,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "dfmodel", id: "DeepSeek-V4-Flash",
name: "DeepSeek V4 Flash (Qoder)", upstreamKey: "dfmodel",
name: "DeepSeek-V4-Flash",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -223,8 +237,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "gm51model", id: "GLM-5.2",
name: "GLM 5.2 (Qoder)", upstreamKey: "gm51model",
name: "GLM-5.2",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -236,8 +251,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "kmodel", id: "Kimi-K2.7-Code",
name: "Kimi K2.7 Code (Qoder)", upstreamKey: "kmodel",
name: "Kimi-K2.7-Code",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -250,8 +266,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "kmodel_latest", id: "Kimi-K3",
name: "Kimi K3 (Qoder)", upstreamKey: "kmodel_latest",
name: "Kimi-K3",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -263,8 +280,9 @@ export const staticModels: QoderModelDef[] = [
maxTokens: MAX_OUTPUT_TOKENS, maxTokens: MAX_OUTPUT_TOKENS,
}, },
{ {
id: "mmodel", id: "MiniMax-M3",
name: "MiniMax M3 (Qoder)", upstreamKey: "mmodel",
name: "MiniMax-M3",
api: "qoder-api", api: "qoder-api",
provider: "qoder", provider: "qoder",
baseUrl: "https://api3.qoder.sh/", baseUrl: "https://api3.qoder.sh/",
@@ -310,6 +328,7 @@ export const staticCnModels: QoderModelDef[] = [
}, },
{ {
id: "Qwen3.7-Plus", id: "Qwen3.7-Plus",
upstreamKey: "qmodel",
name: "Qwen3.7-Plus", name: "Qwen3.7-Plus",
api: "qoder-api", api: "qoder-api",
provider: "qoder-cn", provider: "qoder-cn",
@@ -324,6 +343,7 @@ export const staticCnModels: QoderModelDef[] = [
}, },
{ {
id: "Qwen3.6-Flash", id: "Qwen3.6-Flash",
upstreamKey: "q36fmodel",
name: "Qwen3.6-Flash", name: "Qwen3.6-Flash",
api: "qoder-api", api: "qoder-api",
provider: "qoder-cn", provider: "qoder-cn",
@@ -338,6 +358,7 @@ export const staticCnModels: QoderModelDef[] = [
}, },
{ {
id: "DeepSeek-V4-Pro", id: "DeepSeek-V4-Pro",
upstreamKey: "dmodel",
name: "DeepSeek-V4-Pro", name: "DeepSeek-V4-Pro",
api: "qoder-api", api: "qoder-api",
provider: "qoder-cn", provider: "qoder-cn",
@@ -352,6 +373,7 @@ export const staticCnModels: QoderModelDef[] = [
}, },
{ {
id: "DeepSeek-V4-Flash", id: "DeepSeek-V4-Flash",
upstreamKey: "dfmodel",
name: "DeepSeek-V4-Flash", name: "DeepSeek-V4-Flash",
api: "qoder-api", api: "qoder-api",
provider: "qoder-cn", provider: "qoder-cn",
@@ -366,6 +388,7 @@ export const staticCnModels: QoderModelDef[] = [
}, },
{ {
id: "GLM-5.2", id: "GLM-5.2",
upstreamKey: "gm51model",
name: "GLM-5.2", name: "GLM-5.2",
api: "qoder-api", api: "qoder-api",
provider: "qoder-cn", provider: "qoder-cn",
@@ -381,6 +404,7 @@ export const staticCnModels: QoderModelDef[] = [
}, },
{ {
id: "Kimi-K2.7-Code", id: "Kimi-K2.7-Code",
upstreamKey: "kmodel",
name: "Kimi-K2.7-Code", name: "Kimi-K2.7-Code",
api: "qoder-api", api: "qoder-api",
provider: "qoder-cn", provider: "qoder-cn",
@@ -396,6 +420,7 @@ export const staticCnModels: QoderModelDef[] = [
}, },
{ {
id: "MiniMax-M2.7", id: "MiniMax-M2.7",
upstreamKey: "mmodel",
name: "MiniMax-M2.7", name: "MiniMax-M2.7",
api: "qoder-api", api: "qoder-api",
provider: "qoder-cn", provider: "qoder-cn",
@@ -463,12 +488,17 @@ export function getCachedModels(mode?: string): QoderModelDef[] {
try { try {
const data = JSON.parse(readFileSync(cachePath, "utf8")); const data = JSON.parse(readFileSync(cachePath, "utf8"));
if (data && Array.isArray(data.models)) { if (data && Array.isArray(data.models)) {
const models = data.models.map((model: QoderModelDef) => {
const config = data.configs?.[model.id] as QoderModelEntry | undefined;
const display = config?.display_name;
return display ? { ...model, id: toQoderModelId(display), name: display } : model;
});
// Older releases injected `auto` without a corresponding service config. // Older releases injected `auto` without a corresponding service config.
// Keep an explicitly enabled service model, but drop the legacy fallback. // Keep an explicitly enabled service model, but drop the legacy fallback.
if (data.configs && typeof data.configs === "object" && !data.configs.auto) { if (data.configs && typeof data.configs === "object" && !data.configs.auto) {
return data.models.filter((model: QoderModelDef) => model.id !== "auto"); return models.filter((model: QoderModelDef) => model.id.toLowerCase() !== "auto");
} }
return data.models; return models;
} }
} catch {} } catch {}
} }
@@ -486,19 +516,24 @@ export function getCachedModelConfig(modelKey: string, mode?: string): QoderMode
} catch {} } catch {}
} }
// No cached config. This only happens before the first successful catalog // Static catalogs expose friendly ids too. Preserve raw keys as request-time
// fetch (e.g. not yet logged in), in which case the request cannot succeed // aliases so older commands and persisted selections continue to work.
// anyway. Return a minimal entry carrying the id as the key so callers have const staticModel = (isQoderCNMode(mode) ? staticCnModels : staticModels).find(
// something to read; reasoning is unknown so default to false. (model) => model.id.toLowerCase() === modelKey.toLowerCase() || model.upstreamKey === modelKey,
if (isQoderCNMode(mode)) { );
if (staticModel) {
return {
key: staticModel.upstreamKey || modelKey,
is_reasoning: staticModel.reasoning,
source: "system",
};
}
return { return {
key: modelKey, key: modelKey,
is_reasoning: false, is_reasoning: false,
source: "system", source: "system",
}; };
}
return null;
} }
/** Resolve contextWindow from a catalog entry. Exported for tests. */ /** Resolve contextWindow from a catalog entry. Exported for tests. */
@@ -600,12 +635,10 @@ export async function updateQoderModelsCache(
const isReasoning = !!entry.is_reasoning || !!entry.thinking_config; const isReasoning = !!entry.is_reasoning || !!entry.thinking_config;
const supportsEffort = !!entry.thinking_config?.enabled?.efforts; const supportsEffort = !!entry.thinking_config?.enabled?.efforts;
const thinkingLevelMap = buildThinkingLevelMap(entry); const thinkingLevelMap = buildThinkingLevelMap(entry);
// CN models expose the upstream display_name (whitespace-stripped) as the // Both regions expose display_name (whitespace-stripped) as the pi-visible
// pi-visible id; the original `key` is stored in `configs` and read back at // id. The original key remains indexed in configs for request-time lookup
// request time, so no key<->friendlyId mapping table is needed. // and compatibility with old CLI/persisted model references.
const modelInfo = isQoderCNMode(mode) const modelInfo = { id: toQoderModelId(display), name: display };
? { id: toQoderCNModelId(display), name: display }
: { id: key, name: display };
configs[key] = entry; configs[key] = entry;
if (modelInfo.id !== key) configs[modelInfo.id] = entry; if (modelInfo.id !== key) configs[modelInfo.id] = entry;
+4 -7
View File
@@ -137,18 +137,15 @@ export function streamQoder(
const email = ident.email || getQoderUserEmailFallback(providerMode); const email = ident.email || getQoderUserEmailFallback(providerMode);
const machineID = ident.machineID || getMachineId(); const machineID = ident.machineID || getMachineId();
// The model `id` pi exposes is the upstream display_name (whitespace // Both providers expose the upstream display_name (whitespace stripped)
// stripped) for CN, or the raw key for the international site. The // as the pi id. Read the original key from cached/static config so the
// request-time upstream `key` is read back from the cached model config // gateway still receives identifiers such as `lite` or `qmodel`.
// (which stores the original entry keyed by both `key` and `id`), so no
// key<->friendlyId mapping table is needed here.
const modelConfig = getCachedModelConfig(model.id, providerMode) || { const modelConfig = getCachedModelConfig(model.id, providerMode) || {
key: model.id, key: model.id,
is_reasoning: false, is_reasoning: false,
source: "system", source: "system",
}; };
// Use the cached entry's original upstream key when available; fall back to // Raw legacy keys are also indexed as aliases by the model config cache.
// the pi id (international site already uses the key as id).
const qoderModel = modelConfig.key || model.id; const qoderModel = modelConfig.key || model.id;
const isReasoning = !!modelConfig.is_reasoning; const isReasoning = !!modelConfig.is_reasoning;