For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Set up custom evaluators in Agent Analytics
이 페이지는 아직 귀하의 언어로 번역되지 않았습니다. 현재 작업 중이므로 곧 다시 확인해 주십시오.
Custom evaluators score your agent sessions against quality criteria you define. Calibration runs compare an evaluator's judgments against your labeled examples to tune its accuracy. LLM evaluators and their calibration runs use a model provider key you supply (bring your own key, or BYOK). You can connect a provider directly or use models behind an OpenAI-compatible gateway. Code evaluators and Amplitude's built-in signals don't need a key.
Use custom evaluators when the built-in signals, such as task completion and response quality, don't capture a criterion specific to your product. Each active evaluator produces one [Agent] Evaluator Result event per closed session. Refer to [Agent] Evaluator Result.
After you add a key, refer to Create and calibrate evaluators to write, calibrate, and activate an evaluator.
Add a model provider key
You must be an organization admin to manage model provider keys.
Add a key under Settings > AI Controls > Model Providers for any of the supported providers:
- OpenAI
- Azure OpenAI
- Anthropic
- Google Gemini
- Fireworks AI
- Amazon Bedrock
- Google Vertex AI
- OpenAI-Compatible Gateway
Amplitude encrypts keys at rest and doesn't show them again after you save them. Keep your own copy if you need to reference or rotate a key later. For more on AI settings, refer to AI controls.
Connect an OpenAI-compatible gateway
Use a gateway when your organization manages model access through a service such as LiteLLM. Agent Analytics can discover the gateway's models, including custom model names, for use as evaluator judges. Gateway credentials support Agent Analytics custom LLM evaluators and their calibration runs only.
Your gateway must accept OpenAI-compatible Chat Completions requests at /chat/completions relative to its base URL. The URL must be reachable from Amplitude's servers.
- Go to Settings > AI Controls > Model Providers.
- Find OpenAI-Compatible Gateway and select Connect Provider Key.
- Enter the gateway's key in API key.
- Enter the API base URL in Base URL, such as
https://gateway.example.com/v1. Include the gateway's API path, but leave off/modelsand/chat/completions. - If the gateway requires extra authentication headers, add them under Custom headers (optional). Amplitude sends these headers alongside the API key.
- Select Save.
If you previously saved the gateway under OpenAI with a custom base URL, save it under OpenAI-Compatible Gateway to use Chat Completions.
Choose a gateway model
Open Evaluators in Agent Analytics, then create or edit a custom LLM evaluator. Choose a judge model from the model picker.
Amplitude fetches the gateway's model list from /models relative to the base URL, using the saved API key and custom headers. For example, https://gateway.example.com/v1 uses https://gateway.example.com/v1/models.
If your model isn't in the list, use the Gateway model ID text field below the model picker in the evaluator editor. Enter the model name your gateway expects, such as my-eval-model. This also works when the gateway doesn't provide /models.
The field shows an openai: prefix that Amplitude adds automatically. Enter only the gateway's model name, unless that name itself starts with openai:.
Save the evaluator as a draft and run a calibration to check that the model works before activation. Saving a gateway key alone doesn't confirm that a model can run.
If your organization also has an Azure OpenAI credential for Agent Analytics, Azure takes precedence and the picker doesn't offer gateway models. Ask your organization admin to review the credential setup. A gateway takes precedence over a direct OpenAI key for OpenAI-routed evaluator calls. Gateway calls don't support web search.
Example with LiteLLM
In your LiteLLM configuration, define a model alias for your evaluator. Replace <your-upstream-model-id> with a model your provider account can use:
model_list:
- model_name: my-eval-model
litellm_params:
model: openai/<your-upstream-model-id>
api_key: os.environ/OPENAI_API_KEY
Deploy LiteLLM with this configuration and authentication enabled. Connect its API base URL and a LiteLLM key with access to my-eval-model in Amplitude. Keep the upstream provider key in LiteLLM.
Choose my-eval-model from the model picker, or enter it in Gateway model ID. LiteLLM routes that alias to the configured upstream model.
Troubleshoot a gateway connection
| Symptom | What to check |
|---|---|
| The model list is empty or missing a model. | Check that the gateway serves /models and that the saved key can access the model. Amplitude caches discovery results, so changes might not appear immediately. Enter the exact name in Gateway model ID to use an unlisted model. |
The gateway returns 401 or 403. | Check the API key, model permissions, and any required custom headers. |
The gateway returns 404 for a request. | Check the base URL and API path. Confirm that you saved the key under OpenAI-Compatible Gateway and that the gateway supports /chat/completions. If the error names a missing model, check its exact model ID. |
이 내용이 도움이 되었나요?