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

Commit 952c0eb

Browse files
feat: expose server instance (#1025)
1 parent 337de1e commit 952c0eb

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

cortex-js/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ async function startServer(dataFolderPath?: string) {
8282
dataFolderPath: dataFolderPath || config.dataFolderPath,
8383
cortexCppPort: enginePort,
8484
});
85+
return app;
8586
} catch (e) {
8687
console.error(e);
8788
// revert the data folder path if it was set

cortex-js/src/usecases/engines/engines.usecase.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,17 @@ export class EnginesUsecases {
9393
engine === Engines.llamaCPP &&
9494
(options?.vulkan ||
9595
(options?.runMode === 'GPU' && options?.gpuType !== 'Nvidia'));
96+
const platformMatcher =
97+
process.platform === 'win32'
98+
? '-windows'
99+
: process.platform === 'darwin'
100+
? '-mac'
101+
: '-linux';
96102
installPackages.push(
97103
this.installAcceleratedEngine(options?.version ?? 'latest', engine, [
98-
process.platform === 'win32'
99-
? '-windows'
100-
: process.platform === 'darwin'
101-
? '-mac'
102-
: '-linux',
104+
platformMatcher,
103105
// CPU Instructions - CPU | GPU Non-Vulkan
104-
!isVulkan && engine === Engines.llamaCPP
106+
!isVulkan && engine === Engines.llamaCPP && platformMatcher !== '-mac'
105107
? `-noavx`
106108
: '',
107109
// Cuda

0 commit comments

Comments
 (0)