import { describe, expect, test } from "bun:test"; import { embeddingServerArgs } from "./process"; describe("embedding server args", () => { test("adds a device pin when configured", () => { expect( embeddingServerArgs({ runtimeBinary: "/tmp/llama-server", modelFile: "/tmp/model.gguf", port: 8080, vulkanDevice: "Vulkan1", }), ).toEqual([ "/tmp/llama-server", "-m", "/tmp/model.gguf", "--device", "Vulkan1", "--host", "127.0.0.1", "--port", "8080", "--embeddings", "--pooling", "cls", "-ngl", "99", ]); }); test("omits a device pin when not configured", () => { expect( embeddingServerArgs({ runtimeBinary: "/tmp/llama-server", modelFile: "/tmp/model.gguf", port: 8080, }), ).not.toContain("--device"); }); });