-
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.
- Loading branch information
Showing
13 changed files
with
373 additions
and
11 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
18 changes: 18 additions & 0 deletions
18
cortex-js/src/infrastructure/commanders/benchmark.command.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,18 @@ | ||
import { CommandRunner, SubCommand } from 'nest-commander'; | ||
import { BenchmarkCliUsecases } from './usecases/benchmark.cli.usecases'; | ||
|
||
@SubCommand({ | ||
name: 'benchmark', | ||
subCommands: [], | ||
description: | ||
'Benchmark and analyze the performance of a specific AI model using a variety of system resources', | ||
}) | ||
export class BenchmarkCommand extends CommandRunner { | ||
constructor(private readonly benchmarkUsecases: BenchmarkCliUsecases) { | ||
super(); | ||
} | ||
|
||
async run(): Promise<void> { | ||
return this.benchmarkUsecases.benchmark(); | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
cortex-js/src/infrastructure/commanders/types/benchmark-config.interface.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,28 @@ | ||
import { ChatCompletionMessageParam } from 'openai/resources'; | ||
|
||
export interface BenchmarkConfig { | ||
api: { | ||
base_url: string; | ||
api_key: string; | ||
parameters: { | ||
messages: ChatCompletionMessageParam[]; | ||
model: string; | ||
stream?: boolean; | ||
max_tokens?: number; | ||
stop?: string[]; | ||
frequency_penalty?: number; | ||
presence_penalty?: number; | ||
temperature?: number; | ||
top_p?: number; | ||
}; | ||
}; | ||
prompts?: { | ||
min: number; | ||
max: number; | ||
samples: number; | ||
}; | ||
output: string; | ||
concurrency: number; | ||
num_rounds: number; | ||
hardware: string[]; | ||
} |
8 changes: 8 additions & 0 deletions
8
cortex-js/src/infrastructure/commanders/types/model-stat.interface.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,8 @@ | ||
export interface ModelStat { | ||
modelId: string; | ||
engine?: string; | ||
duration?: string; | ||
status: string; | ||
vram?: string; | ||
ram?: string; | ||
} |
Oops, something went wrong.