2026-01-30 03:16:57 +00:00
|
|
|
/**
|
2026-04-20 23:00:50 +00:00
|
|
|
* ModelGrid configuration interfaces.
|
2026-01-30 03:16:57 +00:00
|
|
|
*/
|
|
|
|
|
|
2026-04-20 23:00:50 +00:00
|
|
|
import type { IModelCatalog, IModelCatalogEntry } from './catalog.ts';
|
|
|
|
|
import type { IClusterConfig } from './cluster.ts';
|
2026-01-30 03:16:57 +00:00
|
|
|
import type { IContainerConfig } from './container.ts';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* API server configuration
|
|
|
|
|
*/
|
|
|
|
|
export interface IApiConfig {
|
|
|
|
|
/** Port to listen on (default: 8080) */
|
|
|
|
|
port: number;
|
|
|
|
|
/** Host to bind to (default: '0.0.0.0') */
|
|
|
|
|
host: string;
|
|
|
|
|
/** Valid API keys for authentication */
|
|
|
|
|
apiKeys: string[];
|
|
|
|
|
/** Rate limit in requests per minute (optional) */
|
|
|
|
|
rateLimit?: number;
|
|
|
|
|
/** Enable CORS (default: false) */
|
|
|
|
|
cors?: boolean;
|
|
|
|
|
/** Allowed origins for CORS */
|
|
|
|
|
corsOrigins?: string[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Docker/container runtime configuration
|
|
|
|
|
*/
|
|
|
|
|
export interface IDockerConfig {
|
|
|
|
|
/** Docker network name (default: 'modelgrid') */
|
|
|
|
|
networkName: string;
|
|
|
|
|
/** Container runtime to use */
|
|
|
|
|
runtime: 'docker' | 'podman';
|
|
|
|
|
/** Path to docker/podman socket (optional) */
|
|
|
|
|
socketPath?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* GPU assignment configuration
|
|
|
|
|
*/
|
|
|
|
|
export interface IGpuAssignmentConfig {
|
|
|
|
|
/** Whether to auto-detect GPUs */
|
|
|
|
|
autoDetect: boolean;
|
|
|
|
|
/** Manual GPU to container assignments (gpuId -> containerId) */
|
|
|
|
|
assignments: Record<string, string>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Model management configuration
|
|
|
|
|
*/
|
|
|
|
|
export interface IModelConfig {
|
2026-04-20 23:00:50 +00:00
|
|
|
/** URL to fetch the public catalog */
|
|
|
|
|
registryUrl: string;
|
|
|
|
|
/** Whether to auto-start a deployment when requested */
|
|
|
|
|
autoDeploy: boolean;
|
|
|
|
|
/** Default engine for new deployments */
|
|
|
|
|
defaultEngine: 'vllm';
|
2026-01-30 03:16:57 +00:00
|
|
|
/** Models to auto-load on startup */
|
|
|
|
|
autoLoad: string[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Main ModelGrid configuration interface
|
|
|
|
|
*/
|
|
|
|
|
export interface IModelGridConfig {
|
|
|
|
|
/** Configuration format version */
|
|
|
|
|
version: string;
|
|
|
|
|
/** API server configuration */
|
|
|
|
|
api: IApiConfig;
|
|
|
|
|
/** Docker configuration */
|
|
|
|
|
docker: IDockerConfig;
|
|
|
|
|
/** GPU configuration */
|
|
|
|
|
gpus: IGpuAssignmentConfig;
|
|
|
|
|
/** Container configurations */
|
|
|
|
|
containers: IContainerConfig[];
|
|
|
|
|
/** Model management configuration */
|
|
|
|
|
models: IModelConfig;
|
2026-04-20 23:00:50 +00:00
|
|
|
/** Cluster configuration */
|
|
|
|
|
cluster: IClusterConfig;
|
2026-01-30 03:16:57 +00:00
|
|
|
/** Health check interval in milliseconds */
|
|
|
|
|
checkInterval: number;
|
|
|
|
|
}
|
|
|
|
|
|
2026-04-20 23:00:50 +00:00
|
|
|
export type IRegistryModel = IModelCatalogEntry;
|
|
|
|
|
export type IRegistryCatalog = IModelCatalog;
|
2026-01-30 03:16:57 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Update status information
|
|
|
|
|
*/
|
|
|
|
|
export interface IUpdateStatus {
|
|
|
|
|
/** Current installed version */
|
|
|
|
|
currentVersion: string;
|
|
|
|
|
/** Latest available version */
|
|
|
|
|
latestVersion: string;
|
|
|
|
|
/** Whether an update is available */
|
|
|
|
|
updateAvailable: boolean;
|
|
|
|
|
}
|