Skip to content

Commit bc27e5c

Browse files
authored
fix: wrong VMtype returned by Podman Desktop causes inference servers… (#1549) (#1550)
* fix: wrong VMtype returned by Podman Desktop causes inference servers start failure * fix: fix failing unit tests --------- Signed-off-by: Jeff MAURY <[email protected]>
1 parent 1372752 commit bc27e5c

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/backend/src/managers/podmanConnection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export class PodmanConnection extends Publisher<ContainerProviderConnectionInfo[
156156

157157
protected parseVMType(vmtype: string | undefined): VMType {
158158
if (!vmtype) return VMType.UNKNOWN;
159-
const type = VMType[vmtype.toUpperCase() as keyof typeof VMType];
159+
const type = Object.values(VMType).find(s => s === vmtype);
160160
if (type === undefined) {
161161
return VMType.UNKNOWN;
162162
}

packages/backend/src/workers/provider/LlamaCppPython.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,10 @@ export class LlamaCppPython extends InferenceProvider {
250250
case VMType.WSL:
251251
return gpu?.vendor === GPUVendor.NVIDIA ? llamacpp.cuda : llamacpp.default;
252252
case VMType.LIBKRUN:
253+
case VMType.LIBKRUN_LABEL:
253254
return gpu ? llamacpp.vulkan : llamacpp.default;
254255
// no GPU support
255-
case VMType.QEMU:
256-
case VMType.APPLEHV:
257-
case VMType.HYPERV:
258-
case VMType.UNKNOWN:
256+
default:
259257
return llamacpp.default;
260258
}
261259
}

packages/shared/src/models/IPodman.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
export enum VMType {
2020
WSL = 'wsl',
2121
LIBKRUN = 'libkrun',
22+
LIBKRUN_LABEL = 'GPU enabled (LibKrun)',
2223
QEMU = 'qemu',
2324
APPLEHV = 'applehv',
25+
APPLEHV_LABEL = 'default (Apple HyperVisor)',
2426
HYPERV = 'hyperv',
2527
UNKNOWN = 'unknown',
2628
}

0 commit comments

Comments
 (0)