Provider: standardize Chutes integration for merge readiness
This commit is contained in:
parent
053c160b6b
commit
a16fa318f9
@ -8,6 +8,7 @@ export type ModelCatalogEntry = {
|
|||||||
provider: string;
|
provider: string;
|
||||||
contextWindow?: number;
|
contextWindow?: number;
|
||||||
reasoning?: boolean;
|
reasoning?: boolean;
|
||||||
|
confidentialCompute?: boolean;
|
||||||
input?: Array<"text" | "image">;
|
input?: Array<"text" | "image">;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -17,6 +18,7 @@ type DiscoveredModel = {
|
|||||||
provider: string;
|
provider: string;
|
||||||
contextWindow?: number;
|
contextWindow?: number;
|
||||||
reasoning?: boolean;
|
reasoning?: boolean;
|
||||||
|
confidentialCompute?: boolean;
|
||||||
input?: Array<"text" | "image">;
|
input?: Array<"text" | "image">;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -82,10 +84,12 @@ export async function loadModelCatalog(params?: {
|
|||||||
? entry.contextWindow
|
? entry.contextWindow
|
||||||
: undefined;
|
: undefined;
|
||||||
const reasoning = typeof entry?.reasoning === "boolean" ? entry.reasoning : 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)
|
const input = Array.isArray(entry?.input)
|
||||||
? (entry.input as Array<"text" | "image">)
|
? (entry.input as Array<"text" | "image">)
|
||||||
: undefined;
|
: undefined;
|
||||||
models.push({ id, name, provider, contextWindow, reasoning, input });
|
models.push({ id, name, provider, contextWindow, reasoning, confidentialCompute, input });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (models.length === 0) {
|
if (models.length === 0) {
|
||||||
|
|||||||
@ -205,6 +205,7 @@ export async function promptDefaultModel(
|
|||||||
name?: string;
|
name?: string;
|
||||||
contextWindow?: number;
|
contextWindow?: number;
|
||||||
reasoning?: boolean;
|
reasoning?: boolean;
|
||||||
|
confidentialCompute?: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const key = modelKey(entry.provider, entry.id);
|
const key = modelKey(entry.provider, entry.id);
|
||||||
if (seen.has(key)) return;
|
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.name && entry.name !== entry.id) hints.push(entry.name);
|
||||||
if (entry.contextWindow) hints.push(`ctx ${formatTokenK(entry.contextWindow)}`);
|
if (entry.contextWindow) hints.push(`ctx ${formatTokenK(entry.contextWindow)}`);
|
||||||
if (entry.reasoning) hints.push("reasoning");
|
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);
|
const aliases = aliasIndex.byKey.get(key);
|
||||||
if (aliases?.length) hints.push(`alias: ${aliases.join(", ")}`);
|
if (aliases?.length) hints.push(`alias: ${aliases.join(", ")}`);
|
||||||
if (!hasAuth(entry.provider)) hints.push("auth missing");
|
if (!hasAuth(entry.provider)) hints.push("auth missing");
|
||||||
|
|||||||
@ -80,6 +80,11 @@ export function toModelRow(params: {
|
|||||||
: (availableKeys?.has(modelKey(model.provider, model.id)) ?? false);
|
: (availableKeys?.has(modelKey(model.provider, model.id)) ?? false);
|
||||||
const aliasTags = aliases.length > 0 ? [`alias:${aliases.join(",")}`] : [];
|
const aliasTags = aliases.length > 0 ? [`alias:${aliases.join(",")}`] : [];
|
||||||
const mergedTags = new Set(tags);
|
const mergedTags = new Set(tags);
|
||||||
|
|
||||||
|
if ((model as any).confidentialCompute) {
|
||||||
|
mergedTags.add("TEE");
|
||||||
|
}
|
||||||
|
|
||||||
if (aliasTags.length > 0) {
|
if (aliasTags.length > 0) {
|
||||||
for (const tag of mergedTags) {
|
for (const tag of mergedTags) {
|
||||||
if (tag === "alias" || tag.startsWith("alias:")) mergedTags.delete(tag);
|
if (tag === "alias" || tag.startsWith("alias:")) mergedTags.delete(tag);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user