File size: 624 Bytes
68d7816 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | import type { ModelCapability } from '#/llm/capability';
export interface LlmConnection {
readonly baseUrl?: string;
readonly apiKey?: string;
readonly defaultHeaders?: Record<string, string>;
readonly betaApi?: boolean;
readonly vertexai?: boolean;
}
export interface LlmModel extends LlmConnection {
readonly provider: string;
readonly model: string;
readonly capability: ModelCapability;
readonly maxContextSize?: number;
readonly maxInputSize?: number;
}
export function modelKey(model: LlmModel): string {
return model.baseUrl === undefined ? model.model : `${model.baseUrl}#${model.model}`;
}
|