Skip to content

Optimization

Use dn optimize to submit a hosted GEPA optimization job for a capability agent:

Terminal window
dn optimize \
--server http://127.0.0.1:8000 \
--api-key "$DREADNODE_API_KEY" \
--organization dreadnode \
--workspace localdev \
--model openai/gpt-4o-mini \
--capability [email protected] \
--agent-name assistant \
--dataset [email protected] \
--val-dataset [email protected] \
--reward-recipe exact_match_v1 \
--objective "Improve instruction quality without increasing verbosity." \
--max-metric-calls 100 \
--reflection-lm gpt-5-mini \
--wait \
--json

V1 flags to know:

FlagDescription
--capability NAME@VERSIONCapability artifact containing the target agent
--agent-name <name>Required when the capability exports multiple agents
--dataset NAME@VERSIONTraining dataset used during optimization
--val-dataset NAME@VERSIONOptional held-out validation dataset
--reward-recipe <name>Declarative hosted reward recipe
--reward-params <json>JSON params passed to the reward recipe
--seed <n>Deterministic optimization seed
--max-metric-calls <n>Metric-call budget
--reflection-lm <model>Reflection model override; defaults to --model
--no-capture-tracesDisable trajectory capture for reflection
--waitPoll until the hosted job reaches a terminal state
--jsonPrint the full job payload instead of a compact summary

Current hosted CLI scope matches the hosted API:

  • backend: gepa
  • target kind: capability_agent
  • optimized components: agent instructions
Terminal window
dn optimize list
dn optimize get <job-id>
dn optimize wait <job-id> --json
dn optimize logs <job-id>
dn optimize artifacts <job-id>
dn optimize cancel <job-id> --json
dn optimize retry <job-id>

dn optimize wait exits non-zero if the job finishes in failed or cancelled.

dn optimize list supports the same top-level filters as the API, including --status, --backend, --target-kind, --project-ref, --page, and --page-size.

Hosted optimization commands require platform credentials plus an active organization and workspace. Pass them explicitly with flags or configure them in your SDK profile first:

Terminal window
dn configure
dn optimize get <job-id>