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

Commit 5caef68

Browse files
fix: add engine in unload model request (#916)
1 parent bbcd90e commit 5caef68

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

cortex-js/src/domain/abstracts/engine.abstract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@ export abstract class EngineExtension extends Extension {
6060
* Unloads a model from the engine.
6161
* @param modelId
6262
*/
63-
async unloadModel(modelId: string): Promise<void> {}
63+
async unloadModel(modelId: string, engine?: string): Promise<void> {}
6464
}

cortex-js/src/infrastructure/providers/cortex/cortex.provider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ export default class CortexProvider extends OAIEngineExtension {
9393
).then(); // pipe error or void instead of throwing
9494
}
9595

96-
override async unloadModel(modelId: string): Promise<void> {
96+
override async unloadModel(modelId: string, engine?: string): Promise<void> {
9797
return firstValueFrom(
98-
this.httpService.post(this.unloadModelUrl, { model: modelId }),
98+
this.httpService.post(this.unloadModelUrl, { model: modelId, engine }),
9999
).then(); // pipe error or void instead of throwing
100100
}
101101

cortex-js/src/usecases/models/models.usecases.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export class ModelsUsecases {
276276
this.eventEmitter.emit('model.event', modelEvent);
277277

278278
return engine
279-
.unloadModel(modelId)
279+
.unloadModel(modelId, model.engine || Engines.llamaCPP)
280280
.then(() => {
281281
delete this.activeModelStatuses[modelId];
282282
const modelEvent: ModelEvent = {

0 commit comments

Comments
 (0)