Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion web/packages/studio/e2e-tests/deployments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,15 @@ test.describe('Model Deployments', () => {
await test.step('Open Create Deployment side panel', async () => {
await page.getByRole('button', { name: 'Create Deployment' }).first().click();

// NGC is the default source. The Deploy submit button only renders inside the open panel.
// The Deploy submit button only renders inside the open panel.
await expect(page.getByRole('button', { name: 'Deploy', exact: true })).toBeVisible();
});

await test.step('Fill the NGC NIM Container form', async () => {
// Select the source explicitly rather than relying on which one the wizard
// preselects — this test covers the NGC path, not the default.
await page.getByRole('radio', { name: 'NGC NIM Container' }).click();

const nameField = page.getByRole('textbox', { name: 'Name', exact: true });
// The wizard pre-fills a generated name; clear it before typing.
await nameField.fill(baseName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@ export const CreateDeploymentSidePanel: FC<CreateDeploymentSidePanelProps> = ({
});
}}
items={[
{ value: SOURCE_NGC, children: 'NGC NIM Container' },
{ value: SOURCE_HF, children: 'HuggingFace' },
{ value: SOURCE_WORKSPACE, children: 'Workspace' },
{ value: SOURCE_NGC, children: 'NGC NIM Container' },
]}
/>
{(source === SOURCE_HF || source === SOURCE_WORKSPACE) && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
defaultWizardValues,
deploymentNameFromWizardBaseName,
engineRequiresImage,
sourceSupportsEngineChoice,
WORKSPACE_PICKER_FILESET,
WORKSPACE_PICKER_MODEL,
SOURCE_HF,
Expand Down Expand Up @@ -61,9 +62,9 @@ describe('additionalEnvsFormToApi', () => {
});

describe('defaultWizardValues', () => {
it('returns NGC source with defaults', () => {
it('returns HuggingFace source with defaults', () => {
const vals = defaultWizardValues();
expect(vals.source).toBe(SOURCE_NGC);
expect(vals.source).toBe(SOURCE_HF);
expect(vals.gpu).toBe(1);
expect(vals.loraEnabled).toBe(true);
expect(typeof vals.name).toBe('string');
Expand All @@ -74,6 +75,12 @@ describe('defaultWizardValues', () => {
expect(defaultWizardValues().engine).toBe(Engine.vllm);
expect(engineRequiresImage(Engine.vllm)).toBe(false);
});

it('defaults to a source that actually reads the default engine', () => {
// The NGC source overrides `engine` to `nim` when building its request, so
// an NGC default made `engine: vllm` unreachable without switching tabs.
expect(sourceSupportsEngineChoice(defaultWizardValues().source)).toBe(true);
});
});

describe('engine image requirements', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function requireImageForEngine(

export const createDeploymentWizardSchema = z
.object({
source: z.enum([SOURCE_NGC, SOURCE_HF, SOURCE_WORKSPACE]),
source: z.enum([SOURCE_HF, SOURCE_WORKSPACE, SOURCE_NGC]),
/** Base name: NGC NIM `model_name`, and API deployment/config become `<name>-deployment` / `<name>-config`. */
name: wizardBaseNameSchema,
/** Inference engine. Ignored for the NGC source, which is always a NIM container. */
Expand Down Expand Up @@ -191,7 +191,11 @@ export const createDeploymentWizardSchema = z
export type WizardFormValues = z.infer<typeof createDeploymentWizardSchema>;

export const defaultWizardValues = (): WizardFormValues => ({
source: SOURCE_NGC,
// Matches the leftmost segment in the panel's source control. HuggingFace is
// also the only default that agrees with `engine` below: the NGC source
// ignores the engine entirely, so defaulting to it left the two defaults
// describing different deployments.
source: SOURCE_HF,
name: generateDefaultName(),
// vLLM serves any architecture from a model-agnostic default image, so it is
// the safe default for the sources that expose the picker. The NGC source
Expand Down
Loading