Skip to content
Draft
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
24 changes: 24 additions & 0 deletions frontend/e2e/best-setup-ux.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ function candidate(candidateId: string, modelId: string) {
runtime_name: null,
runtime_version: null,
runtime_config_digest: null,
generation_parameter_domains: [
{
...API_IDENTITY,
name: modelId === "model-a" ? "temperature" : "top_p",
kind: "float",
scope: "request_generation",
source: "local_llm_server",
provenance: "registry_declared",
minimum: modelId === "model-a" ? 0 : 0.1,
maximum: modelId === "model-a" ? 2 : 1,
step: 0.1,
values: [],
},
],
source: "configured",
};
}
Expand Down Expand Up @@ -357,6 +371,16 @@ test("J0 campaign: four-stage setup executes and produces policy-backed results"
page.getByText("will not invent sweep domains", { exact: false }).first(),
).toBeVisible();
await expect(page.getByRole("radio", { name: /Single configuration/ })).toBeChecked();
await page.getByText("Customize parameters (advanced)", { exact: true }).click();
await expect(page.getByText("Declared request domains by model", { exact: true })).toBeVisible();
await expect(page.getByText("temperature", { exact: true })).toBeVisible();
await expect(page.getByText("0 → 2 · step 0.1", { exact: false })).toBeVisible();
await expect(page.getByText("top_p", { exact: true })).toBeVisible();
await expect(page.getByText("0.1 → 1 · step 0.1", { exact: false })).toBeVisible();
await expect(
page.getByText("does not combine model-specific domains", { exact: false }),
).toBeVisible();
await expect(page.getByRole("radio", { name: /Quick/ })).toBeDisabled();
await page.getByRole("button", { name: "Continue" }).click();

await expect(page.getByRole("heading", { name: "Review your evaluation" })).toBeVisible();
Expand Down
52 changes: 50 additions & 2 deletions frontend/src/pages/find-best-setup/FindBestSetupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
CampaignPlanningContextReadModel,
CampaignSearchStrategy,
CampaignTargetPlanningReadModel,
GenerationParameterDomainReadModel,
} from "../../api";
import {
AppShell,
Expand Down Expand Up @@ -60,6 +61,16 @@ function formatDuration(seconds: number | null, reason: string) {
return `~${Math.max(1, Math.round(seconds / 60))} min`;
}

function formatDeclaredDomain(domain: GenerationParameterDomainReadModel) {
if (domain.kind === "boolean") {
if (!domain.values.length) return "Values unavailable";
return domain.values.map(String).join(" / ");
}
if (domain.minimum === null || domain.maximum === null) return "Bounds unavailable";
const step = domain.step === null ? "" : ` · step ${domain.step}`;
return `${domain.minimum} → ${domain.maximum}${step}`;
}

export function FindBestSetupView({
context,
onManualTest,
Expand Down Expand Up @@ -207,6 +218,10 @@ export function FindBestSetupView({
const customOption = target?.configuration_search_options.find(
(option) => option.strategy === "custom",
);
const selectedCandidates =
target?.candidates.filter((candidate) =>
candidateIds.includes(candidate.candidate_id),
) ?? [];
const showFixedFallback = Boolean(
fixedOption?.available && primaryOptions.every((option) => !option.available),
);
Expand Down Expand Up @@ -467,11 +482,44 @@ export function FindBestSetupView({
: "No request-level parameter capability list was reported for this target."}
</p>
<p>
Bounded search ranges:{" "}
Combined target-level search ranges:{" "}
{target.bounded_generation_parameter_ranges.length
? target.bounded_generation_parameter_ranges.join(", ")
: "None reported"}
: "Not derived from model-specific domains"}
</p>
</div>
<div className="best-setup-parameter-note">
<strong>Declared request domains by model</strong>
<p>
Read-only backend evidence for the selected models. Performance Lab does not
combine model-specific domains or enable a sweep until the search strategy
defines an exact deterministic configuration matrix.
</p>
{selectedCandidates.map((candidate) => (
<div key={candidate.candidate_id}>
<strong>{candidate.model_id}</strong>
{candidate.generation_parameter_domains.length ? (
<dl className="best-setup-detail-list">
{candidate.generation_parameter_domains.map((domain) => (
<div key={domain.name}>
<dt>{domain.name}</dt>
<dd>
{formatDeclaredDomain(domain)}
{" · "}
{domain.scope}
{" · "}
{domain.source}
{" / "}
{domain.provenance}
</dd>
</div>
))}
</dl>
) : (
<p>No canonical bounded request-generation domains are available.</p>
)}
</div>
))}
</div>
</div>
</Disclosure>
Expand Down
Loading