Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: show the chat Seed setting for vLLM models (#15432)

Nilayd508c2f256d2
diff --git a/studio/frontend/src/features/chat/api/chat-adapter.ts b/studio/frontend/src/features/chat/api/chat-adapter.ts
index 872ccaf0e3d..1d190e328fd 100644
--- a/studio/frontend/src/features/chat/api/chat-adapter.ts
+++ b/studio/frontend/src/features/chat/api/chat-adapter.ts
@@ -6826,7 +6826,8 @@ export function createOpenAIStreamAdapter(
repetition_penalty: params.repetitionPenalty,
presence_penalty: params.presencePenalty,
// Omit when unset (server draws a seed) or unread, so a stale GGUF pin is never sent.
- ...(params.seed == null || !modelReadsSamplingSeed(activeModel)
+ ...(params.seed == null ||
+ !modelReadsSamplingSeed(activeModel, runtime.loadedEngine)
? {}
: { seed: params.seed }),
// Turn-scoped: a stale screenshot here made the backend refuse every later text turn's durable run.
diff --git a/studio/frontend/src/features/chat/chat-settings-sheet.tsx b/studio/frontend/src/features/chat/chat-settings-sheet.tsx
index 47b267bf518..3972a42c1f7 100644
--- a/studio/frontend/src/features/chat/chat-settings-sheet.tsx
+++ b/studio/frontend/src/features/chat/chat-settings-sheet.tsx
@@ -537,8 +537,9 @@ export function ChatSettingsPanel({
const activeModel = useChatRuntimeStore(
(s) => s.models.find((m) => m.id === currentCheckpoint) ?? null,
);
+ const loadedEngine = useChatRuntimeStore((s) => s.loadedEngine);
// Same call the request body makes, so the panel cannot offer a seed the body drops.
- const showSeed = modelReadsSamplingSeed(activeModel);
+ const showSeed = modelReadsSamplingSeed(activeModel, loadedEngine);
const platformDeviceType = usePlatformStore((s) => s.deviceType);
// Unified memory, not just Darwin: an Intel Mac spills to system RAM like a PC.
const isUnifiedMemory = usePlatformStore((s) => s.appleSilicon);
diff --git a/studio/frontend/src/features/chat/types/runtime.ts b/studio/frontend/src/features/chat/types/runtime.ts
index 7dfc67a8723..590f97d2e80 100644
--- a/studio/frontend/src/features/chat/types/runtime.ts
+++ b/studio/frontend/src/features/chat/types/runtime.ts
@@ -44,13 +44,19 @@ export type ChatModelRow = ChatModelSummary & SeedGateFlags;
export function modelReadsSamplingSeed(
activeModel: SeedGateFlags | null | undefined,
+ loadedEngine?: InferenceParams["engine"],
): boolean {
// Audio-output models use generateAudio, whose request carries no seed.
if (activeModel?.isAudio && !activeModel.hasAudioInput) {
return false;
}
// The transformers backend declares no `seed` kwarg, so worker.py drops it.
- return activeModel?.isGguf === true || activeModel?.isMlx === true;
+ // SGLang ignores it unless launched with --enable-deterministic-inference.
+ return (
+ activeModel?.isGguf === true ||
+ activeModel?.isMlx === true ||
+ (activeModel != null && loadedEngine === "vllm")
+ );
}
export type PersistedInferenceParams = Partial<
diff --git a/studio/frontend/tests/chat-sampling-seed.test.ts b/studio/frontend/tests/chat-sampling-seed.test.ts
index 1934676ae68..4f7270b103d 100644
--- a/studio/frontend/tests/chat-sampling-seed.test.ts
+++ b/studio/frontend/tests/chat-sampling-seed.test.ts
@@ -153,6 +153,19 @@ test("a seed reaches only the backends that read one", () => {
);
});
+test("a model served by vLLM reads the seed", () => {
+ assert.ok(modelReadsSamplingSeed(row({}), "vllm"));
+ assert.ok(!modelReadsSamplingSeed(row({}), "sglang"));
+ assert.ok(!modelReadsSamplingSeed(row({}), "auto"));
+ assert.ok(!modelReadsSamplingSeed(null, "vllm"));
+ assert.ok(
+ !modelReadsSamplingSeed(
+ row({ isAudio: true, hasAudioInput: false }),
+ "vllm",
+ ),
+ );
+});
+
test("the panel offers the seed only where the backend reads it", () => {
const sheet = readText("../src/features/chat/chat-settings-sheet.tsx");
assert.match(sheet, /const showSeed = modelReadsSamplingSeed\(/);
@@ -175,11 +188,11 @@ test("the panel and the request body gate on the same argument", () => {
);
assert.deepEqual(
gateArguments(readText("../src/features/chat/chat-settings-sheet.tsx")),
- ["activeModel"],
+ ["activeModel, loadedEngine"],
);
assert.deepEqual(
gateArguments(readText("../src/features/chat/api/chat-adapter.ts")),
- ["activeModel"],
+ ["activeModel, runtime.loadedEngine"],
);
});
@@ -240,7 +253,10 @@ test("the stored seed is range-checked, not just the keystroke", () => {
test("the request drops a seed the loaded model cannot use", () => {
const adapter = readText("../src/features/chat/api/chat-adapter.ts");
assert.match(adapter, /!modelReadsSamplingSeed\(/);
- assert.match(adapter, /modelReadsSamplingSeed\(activeModel\)/);
+ assert.match(
+ adapter,
+ /modelReadsSamplingSeed\(activeModel, runtime\.loadedEngine\)/,
+ );
});
test("the seed belongs to the chat, not the installation", () => {