Set Up an AI Operator for a ServiceBeta
Add an AI Operator to a running Service to measure what it costs and how well it answers, then ask it for cheaper configurations.
About This Task
An AI Operator judges its suggestions on the Evaluation goals of the pipeline behind the Service. All goals are judged by default, including goals you add to the pipeline later. You can leave out the goals that shouldn't count, except Safety goals: every suggestion must meet them, so they are always judged.
Before you start, make sure you have:
- A running Service you want to optimize.
- At least one Evaluation goal on that Service's pipeline. If the pipeline has no goals, the Add AI Operator modal shows a warning and you can't add the operator. To create goals, see Define Evaluation Goals on a Pipeline.
Each Service can have only one AI Operator. If a Service already has a goal, it still appears in the Add AI Operator list, but it's disabled.
Add an AI Operator
- Go to Operate > AI Operator, or open a Service and click Set up AI Operator next to the actions menu.
- Click Add AI Operator.
- Select the running Service you want to optimize.
- Under Evaluation goals, review the goals of the Service's pipeline. They are grouped by category and all selected by default. Open a category to see each goal and its target. Hover over a goal's name to read its description. Clear the checkbox of a goal to leave it out. You can't clear Safety goals. To add or change goals first, click Manage goals, which opens the pipeline's Goals page in a new tab.
- Under Goal, review what to Optimize for. Currently, you can optimize for lower cost. Latency and quality are shown but locked.
- Click Save to create the goal.
If the goal can't be saved, check these causes:
- The pipeline has no Evaluation goals. Create at least one.
- You left out every goal. Keep at least one selected.
- A request left out a Safety goal, for example one sent through the API. Safety goals can't be left out, so include them again.
- An Evaluator behind a selected goal doesn't declare its Metrics with
@metrics. Add@metricsto the Evaluator. To learn how to declare Metrics, see Evaluation Metrics.
Result: The Service now has an AI Operator. Its row appears on the Operator list with a status based on its latest run, and the Service page shows an AI Operator button in place of Set up AI Operator.
Change Which Evaluation Goals Judge the Operator
The operator judges its runs on the Evaluation goals of its pipeline, so a goal you add on the pipeline's Goals page counts from the next run. A goal you delete is dropped from the next run, and the operator keeps working with the remaining goals.
To change which goals the operator tracks without removing it, use the goal bar on the operator's dashboard:
- Go to Operate > AI Operator and open the operator.
- In the goal bar, click Evaluation goals. The button shows how many of the pipeline's goals the operator tracks, for example 9 of 11.
- Open a category and select or clear goals. The picker starts from the pipeline's current goals, so goals you deselected earlier are cleared and goals added since are already selected. Safety goals can't be cleared. If the operator left one out before this rule, it's selected again. To create or edit the goals themselves, click Manage goals.
- Keep at least one goal selected, then click Save. The Evaluation goals button shows the new count, for example 9 of 11.
The new selection applies from the next run. Changing it doesn't delete the operator's earlier runs or candidates.
While a run is open, the checkboxes and Save are disabled, because the run's baseline was judged on the current goals. Change the goals once the run ends. If the save fails, the modal stays open with your selection so you can try again.
A run that is already open keeps the goals it started with. To learn more about goals, see Evaluation Goals. To learn how Safety goals gate suggestions, see AI Operator Quality Gates.
Give the AI Operator Context About Your Deployment
If your deployment has requirements the operator can't see in the pipeline, tell it. For example, you can't use a certain model provider because of data privacy requirements. The operator treats this context as requirements that every suggestion must meet.
The context is guidance only. The operator still validates and measures every suggestion as usual, and nothing checks a suggestion against your text.
- Go to Operate > AI Operator and open the operator.
- In the operator panel, next to Evaluation goals, click Add context. If the operator already has context, the button reads Edit context.
- Type the context in the field. It can be up to 2,000 characters.
- Click Save. To remove the context, clear the field and save.
The context applies from the next run. You can edit it while a run is open: that run keeps the context it started with, and the run's details show what it was told. You set the context on an existing operator. The Add AI Operator modal doesn't ask for it.
To set the context with the REST API, see Work with AI Operator Suggestions with the REST API.
Operators Set Up with a Metric Group
An AI Operator that you set up with a Metric Group before Evaluation goals existed no longer judges with that Metric Group. Operators judge on the pipeline's Evaluation goals, and a Metric Group isn't converted automatically. To judge on Evaluation goals, make sure the pipeline has at least one Evaluation goal, then remove the goal as described in Remove the Goal and follow Add an AI Operator.
Remove the Goal
To remove the goal, go to Operate > AI Operator, open the operator, and remove the goal. The Service then disappears from the Operator list.
Related Information
- AI Operator explains the concepts behind goals, baselines, and suggestions.
- AI Operator Quality Gates explains how Safety goals gate suggestions.
- Measure an AI Operator Baseline is the next step after you add an Operator.
- Define Evaluation Goals on a Pipeline to create the goals an AI Operator judges on.
- View Cost and Quality Trends on the AI Operator Page to see how the Service's cost and quality change across releases.
Was this page helpful?