Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 758e3b4

Browse files
committed
update
1 parent b40f7df commit 758e3b4

File tree

5 files changed

+30
-8
lines changed

5 files changed

+30
-8
lines changed

cortex-js/src/domain/models/model.interface.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
import { Model as OpenAiModel } from 'openai/resources/models';
22

3+
export const LocalEngines = [
4+
'cortex.llamacpp',
5+
'cortex.onnx',
6+
'cortex.tensorrt',
7+
] as const;
8+
9+
export const RemoteEngines = [
10+
'anthropic',
11+
'mistral',
12+
'martian',
13+
'openrouter',
14+
'openai',
15+
'groq',
16+
'triton_trtllm',
17+
'cohere',
18+
] as const;
19+
20+
export const LlmEngines = [...LocalEngines, ...RemoteEngines] as const;
21+
export type LlmEngine = (typeof LlmEngines)[number];
22+
323
export interface Model
424
extends OpenAiModel,
525
ModelSettingParams,
@@ -64,7 +84,7 @@ export interface ModelSettingParams {
6484
/**
6585
* The model engine.
6686
*/
67-
engine?: string;
87+
engine?: LlmEngine;
6888

6989
/**
7090
* The prompt to use for internal configuration

cortex-js/src/infrastructure/commanders/types/model-stat.interface.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
import { LlmEngine } from '@/domain/models/model.interface';
2+
13
export interface ModelStat {
24
modelId: string;
3-
engine?: string;
5+
engine?: LlmEngine;
46
duration?: string;
57
status: string;
68
vram?: string;

cortex-js/src/infrastructure/dtos/models/create-model.dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
IsString,
77
Min,
88
} from 'class-validator';
9-
import { Model } from '@/domain/models/model.interface';
9+
import { LlmEngine, Model } from '@/domain/models/model.interface';
1010
import { ModelArtifactDto } from './model-artifact.dto';
1111
import { ApiProperty, getSchemaPath } from '@nestjs/swagger';
1212

@@ -135,7 +135,7 @@ export class CreateModelDto implements Partial<Model> {
135135
})
136136
@IsOptional()
137137
@IsString()
138-
engine?: string;
138+
engine?: LlmEngine;
139139

140140
@ApiProperty({
141141
description: 'The owner of the model.',

cortex-js/src/infrastructure/dtos/models/model-settings.dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ModelSettingParams } from '@/domain/models/model.interface';
1+
import { LlmEngine, ModelSettingParams } from '@/domain/models/model.interface';
22
import { ApiProperty } from '@nestjs/swagger';
33
import {
44
IsArray,
@@ -138,5 +138,5 @@ export class ModelSettingsDto implements ModelSettingParams {
138138
description: 'The engine to use.',
139139
})
140140
@IsOptional()
141-
engine?: string;
141+
engine?: LlmEngine;
142142
}

cortex-js/src/infrastructure/dtos/models/model.dto.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Model } from '@/domain/models/model.interface';
1+
import { LlmEngine, Model } from '@/domain/models/model.interface';
22
import { ApiProperty } from '@nestjs/swagger';
33
import {
44
IsArray,
@@ -198,5 +198,5 @@ export class ModelDto implements Partial<Model> {
198198
example: 'cortex.llamacpp',
199199
})
200200
@IsOptional()
201-
engine?: string;
201+
engine?: LlmEngine;
202202
}

0 commit comments

Comments
 (0)