aiconfig-variations

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AI Config Variations

AI配置变体

You're using a skill that will guide you through testing and optimizing AI configurations through variations. Your job is to design experiments, create variations, and systematically find what works best.
你正在使用一项技能,它将引导你通过变体测试和优化AI配置。你的任务是设计实验、创建变体,并系统地找到最优方案。

Prerequisites

前置条件

  • Existing AI Config (use
    aiconfig-create
    first)
  • LaunchDarkly API access token or MCP server
  • Clear hypothesis about what to test
  • 已有的AI配置(先使用
    aiconfig-create
  • LaunchDarkly API访问令牌或MCP服务器
  • 明确的测试假设

Core Principles

核心原则

  1. Test One Thing at a Time: Change model OR prompt OR parameters, not all at once
  2. Have a Hypothesis: Know what you're trying to improve
  3. Measure Results: Use metrics to compare variations
  4. Verify via API: The agent fetches the config to confirm variations exist
  1. 一次只测试一项内容:仅更改模型、提示词或参数中的一项,不要同时更改多项
  2. 要有假设:明确你想要改进的方向
  3. 衡量结果:使用指标对比不同变体
  4. 通过API验证:Agent会获取配置以确认变体存在

API Key Detection

API密钥检测

  1. Check environment variables
    LAUNCHDARKLY_API_KEY
    ,
    LAUNCHDARKLY_API_TOKEN
    ,
    LD_API_KEY
  2. Check MCP config — If applicable
  3. Prompt user — Only if detection fails
  1. 检查环境变量
    LAUNCHDARKLY_API_KEY
    LAUNCHDARKLY_API_TOKEN
    LD_API_KEY
  2. 检查MCP配置 — 如适用
  3. 提示用户 — 仅在检测失败时执行

Workflow

工作流程

Step 1: Identify What to Optimize

步骤1:确定优化方向

What's the problem? Cost, quality, speed, accuracy? How will you measure success?
存在什么问题?成本、质量、速度还是准确性?你将如何衡量成功?

Step 2: Design the Experiment

步骤2:设计实验

GoalWhat to Vary
Reduce costCheaper model (e.g., gpt-4o-mini)
Improve qualityBetter model or prompt
Reduce latencyFaster model, lower max_tokens
Increase accuracyDifferent model (Claude vs GPT-4)
目标调整项
降低成本更经济的模型(例如gpt-4o-mini)
提升质量更优模型或提示词
降低延迟更快的模型、减小max_tokens值
提高准确性不同模型(Claude vs GPT-4)

Step 3: Create Variations

步骤3:创建变体

Follow API Quick Start:
  • POST /projects/{projectKey}/ai-configs/{configKey}/variations
  • Include modelConfigKey (required for UI)
  • Keep everything else constant except what you're testing
遵循API快速入门
  • POST /projects/{projectKey}/ai-configs/{configKey}/variations
  • 包含modelConfigKey(UI端必填)
  • 除了要测试的内容,保持其他所有设置不变

Step 4: Set Up Targeting

步骤4:设置定向规则

Use
aiconfig-targeting
skill to control distribution (e.g., 50/50 split for A/B test).
使用
aiconfig-targeting
技能控制流量分配(例如A/B测试的50/50分流)。

Step 5: Verify

步骤5:验证

  1. Fetch config:
    bash
    GET /projects/{projectKey}/ai-configs/{configKey}
  2. Confirm variations exist with correct model and parameters
  3. Report results:
    • ✓ Variations created
    • ✓ Models and parameters correct
    • ⚠️ Flag any issues
  1. 获取配置:
    bash
    GET /projects/{projectKey}/ai-configs/{configKey}
  2. 确认变体存在且模型和参数正确
  3. 报告结果:
    • ✓ 变体已创建
    • ✓ 模型和参数正确
    • ⚠️ 标记所有问题

modelConfigKey

modelConfigKey

Required for models to show in UI. Format:
{Provider}.{model-id}
— e.g.,
OpenAI.gpt-4o
,
Anthropic.claude-sonnet-4-5
.
模型在UI端显示的必填项。格式:
{Provider}.{model-id}
— 例如
OpenAI.gpt-4o
Anthropic.claude-sonnet-4-5

What NOT to Do

注意事项

  • Don't test too many things at once
  • Don't forget modelConfigKey
  • Don't make decisions on small sample sizes
  • 不要同时测试过多内容
  • 不要遗漏modelConfigKey
  • 不要基于小样本量做出决策

Related Skills

相关技能

  • aiconfig-create
    — Create the initial config
  • aiconfig-targeting
    — Control who gets which variation
  • aiconfig-update
    — Refine based on learnings
  • aiconfig-create
    — 创建初始配置
  • aiconfig-targeting
    — 控制不同变体的受众
  • aiconfig-update
    — 根据测试结果优化配置

References

参考资料

  • API Quick Start
  • API快速入门