This repository was archived by the owner on Jul 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
infrastructure/services/resources-manager Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,15 @@ export interface ResourceStatus {
77 cpu : {
88 usage : number ;
99 } ;
10+ gpus : GpuInfo [ ] ;
1011}
1112
1213export interface UsedMemInfo {
1314 total : number ;
1415 used : number ;
1516}
17+
18+ export interface GpuInfo {
19+ name : string | undefined ;
20+ vram : number | null ;
21+ }
Original file line number Diff line number Diff line change 1- import osUtils from 'node-os-utils'
21import {
32 ResourceStatus ,
43 UsedMemInfo ,
54} from '@/domain/models/resource.interface' ;
65import { getMemoryInformation , MemoryInformation } from '@/utils/system-resource' ;
76import { Injectable } from '@nestjs/common' ;
8- import systemInformation , { Systeminformation } from 'systeminformation' ;
7+ import si , { Systeminformation } from 'systeminformation' ;
98
109@Injectable ( )
1110export class ResourcesManagerService {
1211 async getResourceStatuses ( ) : Promise < ResourceStatus > {
13- const promises = [ systemInformation . currentLoad ( ) , getMemoryInformation ( ) ] ;
12+ const promises = [ si . currentLoad ( ) , getMemoryInformation ( ) ] ;
1413 const results = await Promise . all ( promises ) ;
1514
1615 const cpuUsage = results [ 0 ] as Systeminformation . CurrentLoadData ;
@@ -19,12 +18,15 @@ export class ResourcesManagerService {
1918 total : memory . total ,
2019 used : memory . used ,
2120 } ;
22-
2321 return {
2422 mem : memInfo ,
2523 cpu : {
2624 usage : Number ( cpuUsage . currentLoad . toFixed ( 2 ) ) ,
2725 } ,
26+ gpus : ( await si . graphics ( ) ) . controllers . map ( ( gpu ) => ( {
27+ name : gpu . name ,
28+ vram : gpu . vram ,
29+ } ) ) ,
2830 } ;
2931 }
3032}
Original file line number Diff line number Diff line change @@ -513,7 +513,7 @@ export class ModelsUsecases {
513513
514514 // Default Inference Params
515515 stream : true ,
516- max_tokens : 4098 ,
516+ max_tokens : 4096 ,
517517 frequency_penalty : 0.7 ,
518518 presence_penalty : 0.7 ,
519519 temperature : 0.7 ,
You can’t perform that action at this time.
0 commit comments