diff --git a/src/agents/model-catalog.ts b/src/agents/model-catalog.ts index 5463542cb..9fbabd7af 100644 --- a/src/agents/model-catalog.ts +++ b/src/agents/model-catalog.ts @@ -8,7 +8,14 @@ export type ModelCatalogEntry = { provider: string; contextWindow?: number; reasoning?: boolean; + confidentialCompute?: boolean; input?: Array<"text" | "image">; + cost?: { + input: number; + output: number; + cacheRead: number; + cacheWrite: number; + }; }; type DiscoveredModel = { @@ -18,6 +25,12 @@ type DiscoveredModel = { contextWindow?: number; reasoning?: boolean; input?: Array<"text" | "image">; + cost?: { + input: number; + output: number; + cacheRead: number; + cacheWrite: number; + }; }; type PiSdkModule = typeof import("@mariozechner/pi-coding-agent"); @@ -82,10 +95,24 @@ export async function loadModelCatalog(params?: { ? entry.contextWindow : undefined; const reasoning = typeof entry?.reasoning === "boolean" ? entry.reasoning : undefined; + const confidentialCompute = + typeof (entry as any)?.confidentialCompute === "boolean" + ? (entry as any).confidentialCompute + : undefined; const input = Array.isArray(entry?.input) ? (entry.input as Array<"text" | "image">) : undefined; - models.push({ id, name, provider, contextWindow, reasoning, input }); + const cost = entry?.cost ? { ...entry.cost } : undefined; + models.push({ + id, + name, + provider, + contextWindow, + reasoning, + confidentialCompute, + input, + cost, + }); } if (models.length === 0) { diff --git a/src/commands/models/list.registry.ts b/src/commands/models/list.registry.ts index 95c96e40b..a7f1a9925 100644 --- a/src/commands/models/list.registry.ts +++ b/src/commands/models/list.registry.ts @@ -94,6 +94,12 @@ export function toModelRow(params: { contextWindow: model.contextWindow ?? null, local, available, + cost: (model as any).cost + ? { + input: (model as any).cost.input, + output: (model as any).cost.output, + } + : undefined, tags: Array.from(mergedTags), missing: false, }; diff --git a/src/commands/models/list.table.ts b/src/commands/models/list.table.ts index 44ed0da26..d436a0782 100644 --- a/src/commands/models/list.table.ts +++ b/src/commands/models/list.table.ts @@ -9,6 +9,7 @@ const INPUT_PAD = 10; const CTX_PAD = 8; const LOCAL_PAD = 5; const AUTH_PAD = 5; +const COST_PAD = 12; export function printModelTable( rows: ModelRow[], @@ -41,6 +42,7 @@ export function printModelTable( pad("Ctx", CTX_PAD), pad("Local", LOCAL_PAD), pad("Auth", AUTH_PAD), + pad("Cost (In/Out)", COST_PAD), "Tags", ].join(" "); runtime.log(rich ? theme.heading(header) : header); @@ -53,6 +55,8 @@ export function printModelTable( const localLabel = pad(localText, LOCAL_PAD); const authText = row.available === null ? "-" : row.available ? "yes" : "no"; const authLabel = pad(authText, AUTH_PAD); + const costText = row.cost ? `${row.cost.input}/${row.cost.output}` : "-"; + const costLabel = pad(costText, COST_PAD); const tagsLabel = row.tags.length > 0 ? rich @@ -82,6 +86,7 @@ export function printModelTable( ctxLabel, coloredLocal, coloredAuth, + costLabel, tagsLabel, ].join(" "); runtime.log(line); diff --git a/src/commands/models/list.types.ts b/src/commands/models/list.types.ts index 2f4157aaa..88bcfe460 100644 --- a/src/commands/models/list.types.ts +++ b/src/commands/models/list.types.ts @@ -12,6 +12,10 @@ export type ModelRow = { contextWindow: number | null; local: boolean | null; available: boolean | null; + cost?: { + input: number; + output: number; + }; tags: string[]; missing: boolean; };