-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update model start params DTO
- Loading branch information
Showing
10 changed files
with
104 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
cortex-js/src/infrastructure/dtos/models/model-settings.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { ModelSettingParams } from '@/domain/models/model.interface'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { IsArray, IsNumber, IsOptional, Min } from 'class-validator'; | ||
|
||
export class ModelSettingsDto implements ModelSettingParams { | ||
// Prompt Settings | ||
@ApiProperty({ | ||
example: 'system\n{system_message}\nuser\n{prompt}\nassistant', | ||
description: | ||
"A predefined text or framework that guides the AI model's response generation.", | ||
}) | ||
@IsOptional() | ||
prompt_template?: string; | ||
|
||
@ApiProperty({ | ||
type: [String], | ||
example: [], | ||
description: | ||
'Defines specific tokens or phrases that signal the model to stop producing further output.', | ||
}) | ||
@IsArray() | ||
@IsOptional() | ||
stop?: string[]; | ||
|
||
// Engine Settings | ||
@ApiProperty({ description: 'Determines GPU layer usage.', example: 4096 }) | ||
@IsOptional() | ||
@IsNumber() | ||
ngl?: number; | ||
|
||
@ApiProperty({ | ||
description: | ||
'The context length for model operations varies; the maximum depends on the specific model used.', | ||
example: 4096, | ||
}) | ||
@IsOptional() | ||
@IsNumber() | ||
ctx_len?: number; | ||
|
||
@ApiProperty({ | ||
description: | ||
'Determines CPU inference threads, limited by hardware and OS. ', | ||
example: 10, | ||
}) | ||
@IsOptional() | ||
@IsNumber() | ||
@Min(1) | ||
cpu_threads?: number; | ||
|
||
@ApiProperty({ | ||
example: 'cortex.llamacpp', | ||
description: 'The engine to use.', | ||
}) | ||
@IsOptional() | ||
engine?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters