Skip to content

Commit e999e8e

Browse files
committed
fix: expose the numa setting on the Llama instance
1 parent 3ee5bfe commit e999e8e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/bindings/Llama.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export class Llama {
4242
/** @internal */ public readonly _debug: boolean;
4343
/** @internal */ public readonly _threadsSplitter: ThreadsSplitter;
4444
/** @internal */ private readonly _gpu: LlamaGpuType;
45+
/** @internal */ private readonly _numa: LlamaNuma;
4546
/** @internal */ private readonly _buildType: "localBuild" | "prebuilt";
4647
/** @internal */ private readonly _cmakeOptions: Readonly<Record<string, string>>;
4748
/** @internal */ private readonly _supportsGpuOffloading: boolean;
@@ -95,6 +96,7 @@ export class Llama {
9596

9697
this._bindings = bindings;
9798
this._debug = debug;
99+
this._numa = numa ?? false;
98100
this._logLevel = this._debug
99101
? LlamaLogLevel.debug
100102
: (logLevel ?? LlamaLogLevel.debug);
@@ -111,7 +113,7 @@ export class Llama {
111113

112114
bindings.ensureGpuDeviceIsSupported();
113115

114-
if (numa != null && numa !== false)
116+
if (this._numa !== false)
115117
bindings.setNuma(numa);
116118

117119
this._gpu = bindings.getGpuType() ?? false;
@@ -211,6 +213,13 @@ export class Llama {
211213
this._threadsSplitter.maxThreads = Math.floor(Math.max(0, value));
212214
}
213215

216+
/**
217+
* See the `numa` option of `getLlama` for more information
218+
*/
219+
public get numa() {
220+
return this._numa;
221+
}
222+
214223
public get logLevel() {
215224
return this._logLevel;
216225
}

0 commit comments

Comments
 (0)