@sconedev/ai_toolkit
Version:
Simplify AI integration in web apps with local and offline model support
30 lines (29 loc) • 931 B
TypeScript
import { OnnxModelConfig } from '../core/onnxRuntime';
/**
* Register a local model
*/
export declare function registerLocalModel(config: OnnxModelConfig): void;
/**
* Get a local model configuration
*/
export declare function getLocalModel(name: string): OnnxModelConfig | null;
/**
* List all registered local models
*/
export declare function listLocalModels(): string[];
/**
* Download a remote model and register it for local use
*/
export declare function downloadAndRegisterModel(modelUrl: string, config: Omit<OnnxModelConfig, 'modelUrl' | 'isLocal' | 'localPath'>, options?: {
progressCallback?: (progress: number) => void;
saveToIndexedDB?: boolean;
saveToCache?: boolean;
}): Promise<OnnxModelConfig>;
/**
* Initialize the model registry on startup
*/
export declare function initModelRegistry(): Promise<void>;
/**
* Save the model registry
*/
export declare function saveModelRegistry(): void;