diff --git a/apps/dashboard/src/components/deployment/__tests__/vllmConfigAmi.test.tsx b/apps/dashboard/src/components/deployment/__tests__/vllmConfigAmi.test.tsx
new file mode 100644
index 00000000..ba26988c
--- /dev/null
+++ b/apps/dashboard/src/components/deployment/__tests__/vllmConfigAmi.test.tsx
@@ -0,0 +1,51 @@
+import { describe, it, expect, vi } from "vitest";
+import { render, screen } from "@testing-library/react";
+
+import { VllmConfig } from "../configSections";
+
+function renderVllm(amiRequired: boolean) {
+ const state = {
+ selectedEngine: "vllm",
+ dtype: "auto",
+ quantization: "",
+ maxModelLen: "",
+ gpuUtil: "0.9",
+ enforceEager: false,
+ selectedAmiId: "",
+ selectedHfTokenName: "",
+ prefillReplicas: 1,
+ decodeReplicas: 1,
+ prefillGpuIndices: "",
+ decodeGpuIndices: "",
+ isDisaggOpen: false,
+ };
+ return render(
+
+ );
+}
+
+// The label carries the required asterisk, so it is the thing that must not
+// appear where no AMI is needed.
+const amiLabel = () => document.querySelector('label[for="engineAmi"]');
+
+describe("the engine AMI field follows requiresAmi", () => {
+ it("is not shown for vLLM on a pool that needs no AMI, such as Kubernetes", () => {
+ renderVllm(false);
+ expect(amiLabel()).toBeNull();
+ expect(screen.queryByText(/engine ami/i)).toBeNull();
+ });
+
+ it("is shown, marked required, for vLLM on an AWS pool", () => {
+ renderVllm(true);
+ expect(amiLabel()).not.toBeNull();
+ expect(amiLabel()?.textContent).toContain("*");
+ });
+});
diff --git a/apps/dashboard/src/components/deployment/configSections.tsx b/apps/dashboard/src/components/deployment/configSections.tsx
index 138ff9e6..fa689772 100644
--- a/apps/dashboard/src/components/deployment/configSections.tsx
+++ b/apps/dashboard/src/components/deployment/configSections.tsx
@@ -358,11 +358,13 @@ export function VllmConfig({
engineAmis,
amisLoading,
amiRegion,
+ amiRequired,
hfTokenNames,
}: SectionProps & {
engineAmis: EngineAmi[]
amisLoading: boolean
amiRegion: string
+ amiRequired: boolean
hfTokenNames: string[]
}) {
const {
@@ -375,8 +377,8 @@ export function VllmConfig({
{selectedEngine === "sglang" ? "SGLang" : "vLLM"} Configuration
- {/* Engine AMI dropdown (required for vLLM only) */}
- {selectedEngine === "vllm" && (
+ {/* Engine AMI dropdown: vLLM on an AWS pool only */}
+ {amiRequired && (
)}