49 lines
1.4 KiB
TypeScript
49 lines
1.4 KiB
TypeScript
import { assertEquals } from 'jsr:@std/assert@^1.0.0';
|
|
import { ConfigManager } from '../ts/config/config-manager.ts';
|
|
import type { IModelGridConfig } from '../ts/interfaces/config.ts';
|
|
|
|
Deno.test('ConfigManager normalizes current config defaults', () => {
|
|
const configManager = new ConfigManager();
|
|
|
|
const normalized = configManager.normalizeConfig({
|
|
version: '1.0.0',
|
|
api: {
|
|
port: 9000,
|
|
host: '127.0.0.1',
|
|
apiKeys: ['test-key'],
|
|
},
|
|
docker: {
|
|
networkName: 'modelgrid',
|
|
runtime: 'docker',
|
|
},
|
|
gpus: {
|
|
autoDetect: true,
|
|
assignments: {},
|
|
},
|
|
containers: [],
|
|
models: {
|
|
registryUrl: 'https://example.com/catalog.json',
|
|
autoDeploy: false,
|
|
defaultEngine: 'vllm',
|
|
autoLoad: ['Qwen/Qwen2.5-7B-Instruct'],
|
|
},
|
|
cluster: {
|
|
enabled: false,
|
|
nodeName: 'modelgrid-local',
|
|
role: 'standalone',
|
|
bindHost: '0.0.0.0',
|
|
gossipPort: 7946,
|
|
heartbeatIntervalMs: 5000,
|
|
seedNodes: [],
|
|
},
|
|
checkInterval: 15000,
|
|
});
|
|
|
|
assertEquals(normalized.models.registryUrl, 'https://example.com/catalog.json');
|
|
assertEquals(normalized.models.autoDeploy, false);
|
|
assertEquals(normalized.models.defaultEngine, 'vllm');
|
|
assertEquals(normalized.ui.enabled, true);
|
|
assertEquals(normalized.ui.port, 8081);
|
|
assertEquals(normalized.ui.assetSource, 'bundle');
|
|
});
|