Provider: standardize Chutes integration for merge readiness

This commit is contained in:
Veightor 2026-01-26 16:19:00 -05:00
parent 053c160b6b
commit a16fa318f9
3 changed files with 12 additions and 2 deletions

View File

@ -8,6 +8,7 @@ export type ModelCatalogEntry = {
provider: string;
contextWindow?: number;
reasoning?: boolean;
confidentialCompute?: boolean;
input?: Array<"text" | "image">;
};
@ -17,6 +18,7 @@ type DiscoveredModel = {
provider: string;
contextWindow?: number;
reasoning?: boolean;
confidentialCompute?: boolean;
input?: Array<"text" | "image">;
};
@ -82,10 +84,12 @@ export async function loadModelCatalog(params?: {
? entry.contextWindow
: undefined;
const reasoning = typeof entry?.reasoning === "boolean" ? entry.reasoning : undefined;
const confidentialCompute =
typeof entry?.confidentialCompute === "boolean" ? entry.confidentialCompute : undefined;
const input = Array.isArray(entry?.input)
? (entry.input as Array<"text" | "image">)
: undefined;
models.push({ id, name, provider, contextWindow, reasoning, input });
models.push({ id, name, provider, contextWindow, reasoning, confidentialCompute, input });
}
if (models.length === 0) {

View File

@ -205,6 +205,7 @@ export async function promptDefaultModel(
name?: string;
contextWindow?: number;
reasoning?: boolean;
confidentialCompute?: boolean;
}) => {
const key = modelKey(entry.provider, entry.id);
if (seen.has(key)) return;
@ -214,7 +215,7 @@ export async function promptDefaultModel(
if (entry.name && entry.name !== entry.id) hints.push(entry.name);
if (entry.contextWindow) hints.push(`ctx ${formatTokenK(entry.contextWindow)}`);
if (entry.reasoning) hints.push("reasoning");
if ((entry as any).confidentialCompute) hints.push("TEE");
if (entry.confidentialCompute) hints.push("TEE");
const aliases = aliasIndex.byKey.get(key);
if (aliases?.length) hints.push(`alias: ${aliases.join(", ")}`);
if (!hasAuth(entry.provider)) hints.push("auth missing");

View File

@ -80,6 +80,11 @@ export function toModelRow(params: {
: (availableKeys?.has(modelKey(model.provider, model.id)) ?? false);
const aliasTags = aliases.length > 0 ? [`alias:${aliases.join(",")}`] : [];
const mergedTags = new Set(tags);
if ((model as any).confidentialCompute) {
mergedTags.add("TEE");
}
if (aliasTags.length > 0) {
for (const tag of mergedTags) {
if (tag === "alias" || tag.startsWith("alias:")) mergedTags.delete(tag);