trigo / trigo-web /backend /dist /inc /config.d.ts
k-l-lambda's picture
Deploy: fix build by keeping pre-built dist folder
63a8db2
/**
* Configuration Utilities
*
* Provides centralized access to environment variables for ONNX model paths
* and other configuration values.
*
* Works across different contexts:
* - Frontend (Vite): Uses import.meta.env.VITE_* variables
* - Backend/Tools (Node): Uses process.env.* variables with dotenv
*/
/**
* ONNX Session Options
*/
export interface OnnxSessionOptions {
executionProviders: string[];
intraOpNumThreads?: number;
interOpNumThreads?: number;
graphOptimizationLevel?: "disabled" | "basic" | "extended" | "all";
enableCpuMemArena?: boolean;
enableMemPattern?: boolean;
}
/**
* Get ONNX model paths
* Returns paths appropriate for the current environment
*/
export declare function getOnnxModelPaths(): {
evaluationModel: string;
treeModel: string;
};
/**
* Get ONNX session options from environment variables
* Returns session options with threading and optimization configuration
*/
export declare function getOnnxSessionOptions(): OnnxSessionOptions;
/**
* Get absolute path to model file (Node.js only)
* Resolves relative paths to absolute paths from project root
*/
export declare function getAbsoluteModelPath(relativePath: string): string;
/**
* Load environment variables from .env file (Node.js only)
* Call this at the start of tool scripts
*
* Loading order:
* 1. .env (base configuration, committed to git)
* 2. .env.local (local overrides, not committed to git)
*/
export declare function loadEnvConfig(): Promise<void>;
//# sourceMappingURL=config.d.ts.map