All files / kernel-test-local/src constants.ts

90.9% Statements 10/11
83.33% Branches 5/6
0% Functions 0/1
100% Lines 10/10

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38      4x 4x         4x 4x           4x               4x   4x   4x 4x             4x  
/**
 * Test constants for E2E tests
 */
export const DEFAULT_MODEL = 'llama3.1:latest';
export const TEST_MODELS = ['llama3.1:latest', 'gpt-oss:20b'];
 
/**
 * Ollama API endpoints
 */
export const OLLAMA_API_BASE = 'http://localhost:11434';
export const OLLAMA_TAGS_ENDPOINT = `${OLLAMA_API_BASE}/api/tags`;
 
/**
 * Supported LMS providers for E2E tests.
 * Select with: LMS_PROVIDER=llama-cpp yarn test:e2e:local
 */
const LMS_PROVIDERS = {
  ollama: { baseUrl: OLLAMA_API_BASE, model: DEFAULT_MODEL },
  'llama-cpp': { baseUrl: 'http://localhost:8080', model: 'glm-4.7-flash' },
} as const;
 
export type LmsProvider = keyof typeof LMS_PROVIDERS;
 
// eslint-disable-next-line n/no-process-env
const rawProvider = process?.env?.LMS_PROVIDER ?? 'ollama';
export const LMS_PROVIDER: LmsProvider =
  rawProvider in LMS_PROVIDERS ? (rawProvider as LmsProvider) : 'ollama';
 
export const LMS_BASE_URL = LMS_PROVIDERS[LMS_PROVIDER].baseUrl;
export const LMS_CHAT_MODEL = LMS_PROVIDERS[LMS_PROVIDER].model;
 
/**
 * Logger tags to ignore, parsed from the LOGGER_IGNORE environment variable.
 */
export const IGNORE_TAGS =
  // eslint-disable-next-line n/no-process-env
  process?.env?.LOGGER_IGNORE?.split(',')?.map((tag) => tag.trim()) ?? [];