Revert CLI cost display changes
This commit is contained in:
parent
1c4c0f5525
commit
2bb5e73d51
@ -8,14 +8,7 @@ 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 = {
|
||||
@ -25,12 +18,6 @@ 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");
|
||||
@ -95,24 +82,10 @@ 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;
|
||||
const cost = entry?.cost ? { ...entry.cost } : undefined;
|
||||
models.push({
|
||||
id,
|
||||
name,
|
||||
provider,
|
||||
contextWindow,
|
||||
reasoning,
|
||||
confidentialCompute,
|
||||
input,
|
||||
cost,
|
||||
});
|
||||
models.push({ id, name, provider, contextWindow, reasoning, input });
|
||||
}
|
||||
|
||||
if (models.length === 0) {
|
||||
|
||||
@ -78,19 +78,8 @@ export function toModelRow(params: {
|
||||
cfg && authStore
|
||||
? hasAuthForProvider(model.provider, cfg, authStore)
|
||||
: (availableKeys?.has(modelKey(model.provider, model.id)) ?? false);
|
||||
|
||||
const mergedTags = new Set(tags);
|
||||
|
||||
const cost = (model as any).cost;
|
||||
if (cost && (cost.input > 0 || cost.output > 0)) {
|
||||
mergedTags.add(`cost:${cost.input}/${cost.output}`);
|
||||
}
|
||||
|
||||
if ((model as any).confidentialCompute) {
|
||||
mergedTags.add("TEE");
|
||||
}
|
||||
|
||||
const aliasTags = aliases.length > 0 ? [`alias:${aliases.join(",")}`] : [];
|
||||
const mergedTags = new Set(tags);
|
||||
if (aliasTags.length > 0) {
|
||||
for (const tag of mergedTags) {
|
||||
if (tag === "alias" || tag.startsWith("alias:")) mergedTags.delete(tag);
|
||||
|
||||
@ -9,7 +9,6 @@ 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[],
|
||||
|
||||
@ -12,10 +12,6 @@ export type ModelRow = {
|
||||
contextWindow: number | null;
|
||||
local: boolean | null;
|
||||
available: boolean | null;
|
||||
cost?: {
|
||||
input: number;
|
||||
output: number;
|
||||
};
|
||||
tags: string[];
|
||||
missing: boolean;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user