import type { ModelConstant } from '@qvac/sdk'; declare const STATES: { readonly IDLE: "idle"; readonly LOADING: "loading"; readonly READY: "ready"; readonly UNLOADING: "unloading"; readonly ERROR: "error"; }; export type ModelState = (typeof STATES)[keyof typeof STATES]; export interface ModelEntry { id: string; modelSrc: string | ModelConstant; sdkType: string; endpointCategory: string; config: Record; state: ModelState; createdAt: number; error: string | null; sdkModelId: string | null; } export interface ServeConfig { models: Map; defaults: Map; /** * Externally reachable origin for this server (e.g. "https://api.example.com"). * Required to mint absolute URLs in image-generation responses when * `response_format=url`. Trailing slash is stripped on parse. */ publicBaseUrl: string | null; cors: { origins: string[]; }; openai: OpenAIServeOptions; } export interface OpenAIServeOptions { audio: { speech: { defaultVoice: string | null; /** * Maps an OpenAI `voice` string to a `serve.models` alias. Each alias can * carry its own TTS `config` (e.g. Chatterbox `referenceAudioSrc`, Supertonic * `ttsVoiceStyleSrc`). When set, this is tried before `${model}-${voice}` and * before the bare `model` alias. Keys are normalized to lowercase when parsed. */ voices: Record | null; /** * Maximum allowed character length of `input`. Requests above this are * rejected with `400 input_too_long` before any synthesis runs (the * route otherwise buffers the full WAV in memory — DoS vector). * `null` disables the cap. Defaults to OpenAI's documented 4096. */ maxInputChars: number | null; }; }; } export interface ResolvedModelEntry { alias: string; modelSrc: string | ModelConstant; sdkType: string; endpointCategory: string; isDefault: boolean; preload: boolean; config: Record; } export interface ModelRegistry { STATES: typeof STATES; getEntry: (modelId: string) => ModelEntry | null; getAll: () => ModelEntry[]; getReady: () => ModelEntry[]; register: (alias: string, opts: { modelSrc: string | ModelConstant; sdkType: string; endpointCategory: string; config: Record; }) => ModelEntry; setLoading: (modelId: string) => void; setReady: (modelId: string, sdkModelId?: string) => void; setError: (modelId: string, error: unknown) => void; remove: (modelId: string) => boolean; isAllowed: (modelId: string, serveConfig: ServeConfig) => boolean; } export declare function createModelRegistry(): ModelRegistry; export {}; //# sourceMappingURL=model-registry.d.ts.map