This repository was archived by the owner on Jul 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +30
-8
lines changed Expand file tree Collapse file tree 5 files changed +30
-8
lines changed Original file line number Diff line number Diff line change 11import { 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+
323export 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
Original file line number Diff line number Diff line change 1+ import { LlmEngine } from '@/domain/models/model.interface' ;
2+
13export interface ModelStat {
24 modelId : string ;
3- engine ?: string ;
5+ engine ?: LlmEngine ;
46 duration ?: string ;
57 status : string ;
68 vram ?: string ;
Original file line number Diff line number Diff line change 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' ;
1010import { ModelArtifactDto } from './model-artifact.dto' ;
1111import { 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.' ,
Original file line number Diff line number Diff line change 1- import { ModelSettingParams } from '@/domain/models/model.interface' ;
1+ import { LlmEngine , ModelSettingParams } from '@/domain/models/model.interface' ;
22import { ApiProperty } from '@nestjs/swagger' ;
33import {
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}
Original file line number Diff line number Diff line change 1- import { Model } from '@/domain/models/model.interface' ;
1+ import { LlmEngine , Model } from '@/domain/models/model.interface' ;
22import { ApiProperty } from '@nestjs/swagger' ;
33import {
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}
You can’t perform that action at this time.
0 commit comments