npx skills add ...
npx skills add launchdarkly/agent-skills --skill online-evals
Attach judges to config variations for automatic LLM-as-a-judge evaluation. Create custom judges, configure sampling rates, and monitor quality scores.
This repo is now called launchdarkly/ai-tooling. Both names install the same content, but the install count here only covers this one.
npx skills add launchdarkly/agent-skills --skill online-evals
Attach judges to config variations for automatic quality scoring using LLM-as-a-judge methodology. Judges evaluate responses and return scores between 0.0 and 1.0.
configs-create skill)LAUNCHDARKLY_API_KEY, LAUNCHDARKLY_API_TOKEN, LD_API_KEY~/.claude/config.json -> mcpServers.launchdarkly.env.LAUNCHDARKLY_API_KEYJudges are specialized configs in judge mode that evaluate responses from other configs. They use an LLM to score outputs and return structured results:
LaunchDarkly provides three pre-configured judges:
| Judge | Metric Key | Measures |
|---|---|---|
| Accuracy | $ld:ai:judge:accuracy | How correct and grounded the response is |
| Relevance | $ld:ai:judge:relevance | How well it addresses the user request |
| Toxicity | $ld:ai:judge:toxicity | Harmful or unsafe phrasing (lower = safer) |
Judges can only be attached to completion mode configs in the UI. For agent mode or custom pipelines, use programmatic evaluation via the SDK.
For domain-specific evaluation, create judge configs:
Note: Set
isInverted: truefor metrics like toxicity where 0.0 is better.
Then add a variation with the evaluation prompt:
Use the variation PATCH endpoint:
Important: The
judgesarray replaces all existing judge attachments. An empty array removes all judges.
Each judge config needs its fallthrough set to the enabled variation. Configs default to the "disabled" variation (index 0).
Note:
turnTargetingOndoes not work for configs. UseupdateFallthroughVariationOrRolloutinstead.
When using create_model() + run(), attached judges evaluate automatically:
For agent mode or custom pipelines, evaluate input/output pairs directly:
Note: Direct evaluation does not automatically record metrics. Obtain a tracker via
ai_config.create_tracker()/aiConfig.createTracker()and calltracker.track_judge_result(result)/tracker.trackJudgeResult(result)to record scores for the config you're evaluating.
Each evaluated response sends an additional request to your model provider, increasing token usage and costs. Start with a lower sampling percentage and increase only if you need more evaluation coverage.
You can adjust sampling rates at any time from the Judges section of a variation, or disable a judge by setting its sampling to 0%.
Results appear within 1-2 minutes of evaluation.
Evaluation metrics integrate with:
| Status | Cause | Solution |
|---|---|---|
| 404 | Config/variation not found | Verify keys exist |
| 400 | Invalid judge config | Check judgeConfigKey exists |
| 403 | Insufficient permissions | Check API token permissions |
| 422 | Duplicate metric key | Cannot attach multiple judges with same metric key |
After attaching judges:
configs-create - Create configs and judgesconfigs-targeting - Configure targeting rulesconfigs-variations - Manage variationsPython SDK examples:
create_judge + evaluatecreate_model + run (attached judges fire during the run)Node.js SDK examples:
createJudge + evaluatecreateModel + run (attached judges fire during the run)