Docs menu

Functions

Optimize

Authorize a compile cap, set preferences, and follow an optimization run from preview to comparison report.

Optimization happens in two paid steps under one cap: Prepare preview, then Optimize. Only owners and admins can start either step.

Set the cap and preferences

  • Compile cap (USD): the most a run may charge across preview, evaluation tests, search, measurement, and optional prompt refinement. The default is $10 and the maximum is $100. Actual usage is charged even if no executable alternative is found. The remaining cap is reserved when a step starts, and released when that step ends except for provider usage that is still unknown.
  • Priority: Lower cost, Lower latency, or Higher task quality steers the search.
  • Quality, cost and latency preferences (optional): a minimum pass rate, maximum cost or p95 relative to the original, and absolute cost or latency targets. They guide search; they don't filter or block the alternatives you can activate.
  • Metric targets (optional): named score limits, such as a minimum precision. They guide search. Unmet targets stay visible, and you still choose what to activate.
  • Include bounded prompt refinement in this cap: optionally lets search refine declared prompt fields within the same cap. Refinement is skipped when the rubric judge is unreliable.

The compile cap is separate from what you pay to call an activated function. See Billing and limits.

Prepare the preview

Prepare preview · up to $N drafts or confirms the evaluation, shows the reference contract and quotes the run:

  • the incremental forecast, estimated minutes and remaining cap;
  • whether compatible earlier evidence will be reused;
  • warnings when the forecast exceeds the cap or time limit.

Resolve any Choose the source for this field prompts, then confirm the input boundaries, output schema and assumptions. The quote expires after one hour.

Run optimization

Optimize · up to $N remaining starts the run with the rest of the authorized cap. The two-hour deadline starts when optimization starts. Time spent waiting in the queue does not count, and waiting is not charged. A queued job does not start when available credits are below the remaining cap, or when the reservation would exceed a spend limit. Add credits if the balance is short, then prepare a new preview. Evaluation tasks run in parallel, subject to provider capacity.

While it runs, the page shows stages, current-phase progress, elapsed time, an ETA range, the deadline, spending and the leading pipeline so far. Progress survives a reload and you can leave the page. Cancel run stops new paid work; completed usage is charged and unresolved provider usage stays held until it settles.

If a start is rejected with workspace_job_limit, wait for one of your workspace's functions in progress to finish or cancel one, then retry the same function. If it is rejected with job_capacity, wait and retry later. Do not create a duplicate function to work around either rejection.

How a run ends

OutcomeWhat it means
Measurement completedCompare the alternatives and decide whether to activate one.
Measurement stopped before it finishedCapacity, the compile cap or the deadline stopped measurement. Alternatives measured so far remain available with incomplete reports.
No executable alternative was foundNo program completed a schema-valid primary execution with the available providers. Saved measurements remain in Run details.
CancelledCompleted usage is charged.

In every case your active function, if any, keeps serving unchanged.

Change preferences later

On an active function, Adjust preferences quotes a new run under different preferences. Compatible earlier evidence is reused where possible. The current alias keeps serving its revision until you activate another one.

Next step

Compare and activate

Optimize | Seldon