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, search and measurement. The default is $10 and the maximum is $100. Actual usage is charged even if no executable alternative is found.
  • Priority: Lower cost or Lower latency 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.
  • Include bounded prompt refinement in this cap: optionally lets search refine declared prompt fields within the same cap.

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. A run has a fixed two-hour deadline that includes queue time. 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.

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