import * as ort from "onnxruntime-node"; import { OnnxRuntimeModuleOptions } from "./onnx-runtime.config"; import { ModelManagerService } from "../model-manager/model-manager.service"; /** * ONNX Runtime service for session configuration and access. * * This service now delegates to ModelManagerService for model loading. * It maintains backward compatibility by providing session access methods. * * The service uses OnApplicationBootstrap instead of OnModuleInit to ensure * @huggingface/transformers services (which use OnModuleInit) load their models first, * avoiding potential conflicts with the shared native ONNX Runtime. */ export declare class OnnxRuntimeService { private readonly modelManager; private readonly logger; private readonly sessionOptions; private readonly options; constructor(options: OnnxRuntimeModuleOptions, modelManager: ModelManagerService); /** * Configure the ONNX Runtime global environment. * Called once during service construction. */ private configureRuntime; /** * Build session options from configuration. * Note: These options are no longer used directly for loading * (ModelManagerService handles that), but kept for backward compatibility. */ private buildSessionOptions; /** * Get a loaded session by name. * Delegates to ModelManagerService. * * @param name - The model name as configured in models.config.yaml * @returns The InferenceSession, or null if not loaded */ getSession(name: string): ort.InferenceSession | null; /** * Check if a model is loaded and ready. * Delegates to ModelManagerService. * * @param name - The model name * @returns true if the model is loaded */ isModelLoaded(name: string): boolean; /** * Wait for all models to be loaded. * Services that depend on ONNX models should call this before accessing them. */ waitForReady(): Promise; /** * Get all loaded ONNX model names. * Delegates to ModelManagerService. */ getLoadedModels(): string[]; } //# sourceMappingURL=onnx-runtime.service.d.ts.map