Configuration
src/app/(authenticated)/configuration/_components/configuration.knowledge.md
Source: PRD 01 — Inference: Custom Configuration (the current version at the top of that file; the "As of Sep 24" section is history). Drafts — storage, the Drafts list, resume and delete — belong to PRD 05. The run page and failures after a run exists belong to PRD 03.
Screen role
Where a developer sets up one optimization Run — model, GPU environment, serving and verification — and starts it, without needing GPU optimization expertise. Starting it hands over to Benchmark run.
Journey: Inference overview → New optimization → Model & GPU environment → Serving and Benchmark → Verification → Review → Start optimization → open the run.
Designer decisions D1–D11 (2026-10-13) in the redesign plan override the PRD where they differ.
Business rules
The flow
- Four steps, one at a time: Model & GPU environment, Serving and Benchmark (D1), Verification, Review. The step indicator shows current, completed and upcoming steps. Review is a modal over step 3 (D2).
- Forward actions: Continue on steps 1–2, Review configuration on step 3, Start optimization only on Review. Moving forward validates the current step and waits for its checks; on failure the user stays on the step with the errors.
- Pressed while the step's own checks still run (a model check on step 1, a dataset check on step 3), the forward action waits — inert but still focused (aria-disabled, so focus doesn't drop to the page), the check listed above it as plain text — and goes on by itself once they pass; a failed check leaves the user on the step with its error. Typing a new model or dataset ID stops the wait.
- Step 1's Continue, once its fields pass, runs a server preflight of the full selection ("Checking your full selection…", forward inert and focused) before step 2 opens (Placeholder: Bam 1).
- Every step lists what stops its forward action right above it (D11): the step's errors as shown — each a link that focuses its field — then its running checks, not clickable. A fresh step lists nothing; errors appear after a forward press or as soon as a check fails.
- Back and Edit keep every value. After Edit on Review the forward button reads Back to review and reopens it (D8). Exit setup leaves the flow (see Leaving).
- Checking = a localized async check while the form stays visible. Loading is only for first opening a new configuration or a saved draft: the step's panel holds field-shaped skeletons (one announced "Loading configuration…"), the command preview a skeleton block, and Save draft and Continue wait. The live page opens in Loading until the draft restore has run.
The form, everywhere
- Show required vs optional, defaults, units and supported limits.
- Every number takes exact keyboard entry. A slider and its number field stay in sync. An invalid typed value stays visible with an inline error — never silently changed or rounded.
- The backend owns valid model / engine / hardware / GPU count / runtime / flag combinations. Unavailable dependent fields stay visible but disabled, and say what enables them.
- When a field another one depends on changes: recheck the dependent field, keep values that are still compatible, clear incompatible ones only with a visible explanation.
- Validate beside the field, and tell apart: missing or invalid input, unsupported combination, inaccessible repository, check in progress, account or credit restriction. Every blocker is also shown beside the forward action. Disabled reasons and errors are visible without a hint.
- Public Hugging Face models and datasets only — say so beside the inputs, reject private or gated repositories as unsupported, and never ask for Hugging Face credentials.
Step 1 — Model & GPU environment (order: Run name, Model repository, Max model length — D9 — then engine, hardware, runtime)
| Field | Rule |
|---|---|
| Run name | Optional text, placeholder “e.g. Llama latency test.” Stored separately from the Run ID. |
| Model repository | Required; the first dependency. Search-as-you-type; accepts owner/model or a Hugging Face URL (normalized to the ID). Shows “Public Hugging Face models only”. Keeps typed input on error. Checks access and fetches metadata live; distinguishes invalid format, not found, unsupported access, network failure, checking. |
| Max model length | Required positive integer — “Maximum input and output tokens combined in one request.” Rechecked after model, engine or hardware change; an invalid value stays visible. Shows a resolved limit only when reliable; blocks known unsafe values. |
| Inference engine | Required select (vLLM, SGLang) — “Available engines depend on the model.” Disabled until the model and its metadata resolve; a cleared selection is explained. |
| Hardware and GPU count | Required select of GPU type + count. Disabled until an engine is chosen; shows the prerequisite, checking or error reason. Only backend-supported combinations. |
| Runtime version | Required select labelled CUDA version or ROCm version to match the GPU. Disabled with “Choose hardware first” until hardware is chosen. |
Hugging Face metadata is a discovery signal, not proof a model runs on an engine, GPU or runtime. A server preflight runs once the selection is complete, and again at Start.
The model check has five failure outcomes, each with its own message and fix: wrong format, not found, private or gated, Hugging Face unreachable (the only one with Retry), not compatible (Placeholder: Bam 1). A value cleared by a dependency change says so beside its own field, never in one shared note. Typing a new model keeps the dependent values until its check resolves; then only the incompatible ones are cleared.
Step 2 — Serving and Benchmark (D1): section Serving — Max concurrency, Custom engine flags; section Benchmark — Concurrency levels, Measured requests, Warm-up requests.
| Field | Rule |
|---|---|
| Max concurrency | Slider + synced number — “Target maximum concurrent requests to benchmark.” Always editable; positive integer within the limit for the resolved model, length, engine and GPU; revalidated when they change. |
| Concurrency levels | Selectable chips — “Compare performance at different request loads.” Only levels ≤ Max concurrency and the environment limit; unique; unsupported levels identified after a change. Feed result charts, not candidate selection. |
| Measured requests | Required positive integer, number field with optional synced slider — “More requests take longer but can improve confidence.” |
| Warm-up requests | Required non-negative integer, number field with optional synced slider — “Warm-up requests aren't included in results.” |
| Custom engine flags | Optional, last in the Serving section (D1). Repeatable Key/Value rows with Add, Remove and row errors; suggests supported keys and their value format; “Leave Value blank for on/off flags.” Disabled with “Choose an engine to add flags.” Rejects duplicate, conflicting, platform-managed, protected, unsupported or unsafe flags; rechecked when the engine changes. Never run as a shell command. |
Concurrency levels above Max concurrency: chosen ones are marked unsupported (still removable), unchosen ones disabled. Max concurrency's limit follows the GPU, so a GPU change can flag a typed value (kept, never lowered — Placeholder: Bam 2). An engine change removes only the flags the new engine doesn't support, and the note naming them shows on step 2 beside the flags.
Step 3 — Verification (accuracy test: does optimization, e.g. quantization, reduce quality)
| Field | Rule |
|---|---|
| Verification type | Accuracy test only — read-only or a single-option select. |
| Dataset hub | Read-only text, “Hugging Face” (D10); each dataset card keeps its own searchable Dataset ID. |
| Sample limit | Required positive integer — “Limit how many examples are used in the accuracy test.” Revalidated against backend limits and split sizes. |
| Accuracy datasets | At least one. Repeatable groups (Add accuracy dataset, Remove), “Public Hugging Face datasets only”. Each group: Name (required), Dataset ID (required, search-as-you-type), Subset (disabled until the ID resolves; required only when there are several), Split (disabled until the subset resolves; must exist, validation/test when available). A group is kept on error. |
Each dataset card shows its errors beside the field they belong to (name, ID, subset, split). Only a check that couldn't run (Hugging Face unreachable) offers Retry. Sample limit is one field for the whole test (Placeholder: Kuk 1), and must fit every chosen split.
Review
- Grouped as Model & GPU environment, Serving and Benchmark, Verification: every field, resolved value and known fixed setting that affects the run. Secrets hidden. Long values wrap. A Fixed settings group stays “to be confirmed” until Kuk answers which can be shown.
- Edit beside each group opens that step with all values kept; moving forward returns to a refreshed Review.
- Start optimization is the only primary action; every blocker is listed right above it (D11) and it stays disabled while any remain. Blockers the user can fix link to their field: the link opens its step and puts focus on that field. System problems (e.g. credit) are plain text.
- Start → Submitting (progress, no repeat clicks): server revalidation, credit rule, an immutable versioned snapshot, one run. No compute before that. Each request carries a run-creation identity, so repeat clicks of it return the same run (Placeholder: Bam 6).
- Submitting: Start reads Starting… and ignores presses but keeps focus (aria-disabled — Button has no loading state, 0001), and an info note beside it says what's happening. Everything happens inside the Review modal, in an alert right above the footer buttons. Values are never touched.
- Success closes Review, puts the request back to idle (the tab's store outlives the page) and opens the run's own page: the live page's
runHreftemplate,/benchmark-run?run={id}(Placeholder: Bam 6 — the real URL shape). Console frames pass none and stay on Starting…. - Submission failed (the server said no): Review stays with all values, the cause, the next step and Retry — a new request with a new identity, since no run exists. Edit and Back are free and forget the failed request.
- Server revalidation rejects a field: an error alert says something has to change (no Retry), and the field is listed above Start as a link — it opens the step, focuses the field and shows the server's message beside it. Values kept.
- Uncertain timeout ("We couldn't confirm your run started"): a run may exist under the request's identity, so while submitting, timed out or looking it up the values are locked — Review's Edit is disabled with the reason shown ("Waiting to confirm whether your run started"), blocker links don't open steps, and closing Review is allowed (the Exit path) but leaves the form read-only with the same reason above the forward button, which reads Back to review. Retry only looks the run up by the same identity — never resends: found opens it; none says "Your run didn't start" and offers Start over with these settings (a new request), and Edit is free again (Placeholder: Bam 6).
- Leaving the page mid-request (the request is dropped): coming back finds it as the uncertain timeout, never as a stuck Starting….
- A credit refusal is explained once, in an error alert pointing to Contact Sales — not repeated in the list above Start; Start stays disabled (Placeholder: Kuk 2). A list above Start holding only system problems reads "Can't start yet", not "Fix these to start".
Leaving
- Exit setup sits in the page header beside Documentation, Notifications and Contact Sales (D3). Unchanged since the page opened (or since a draft was restored or saved): it goes straight to the overview. Changed: a separate small modal, Discard changes? — Discard (to the overview) / Keep editing (focus starts here). No Save Draft in it: drafts are out of scope (D4).
- While a run is being created, Exit setup always asks — leaving doesn't cancel it: "Your run may still start. You'll find it in Run history." (Placeholder: Kuk 5).
- Sidebar and other in-app navigation isn't intercepted yet — it leaves without asking until the shell can stop it (Placeholder: Bam 5).
- Save draft stays as it is (D4): success shows Saved and stays on the step.
- Refresh or tab close uses the browser's native warning (no custom actions possible).
Edge cases
| Case | Response |
|---|---|
| Repository unavailable | Keep the input, name the cause (format, access, connectivity) when known, allow retry. |
| Model metadata or fit unknown | Say what can't be checked; manual input or preflight. Never invent a limit. |
| Verification dataset unavailable | Keep the group, name the cause (format, access, subset, split), allow retry. |
| Created run later fails | A run failure, not a configuration failure — offer Start a new run with these settings. |
Open questions
From the PRD:
- Backend contract: pinned vLLM / SGLang versions and compatibility rules; defaults and limits for max concurrency, concurrency levels, measured and warm-up requests; the progress and error response for checks and preflight.
- Verification: which datasets and schemas Accuracy test supports; whether Sample limit is per dataset or across the test; the metric, baseline and pass/fail threshold for “not regressed”.
- Review: which fixed settings can be shown before a run exists; whether Review can show compatibility results or a sanitized launch configuration; what goes in the run snapshot.
Conflicts inside the PRD — resolved by the designer (2026-10-13): the step 2 name and its sections (D1, flags under Serving), and Dataset hub (D10).