Trace2

Optimizers Overview

Compare and choose the right optimizer for your task

Optimizers Overview

Trace2 currently supports three optimization algorithms, each with different trade-offs.

Quick Comparison

OptimizerUses GraphSpeedContext UsageBest For
OPRO⚡⚡⚡LowSimple prompt optimization
TextGrad🐌LowLarge graphs, step-by-step optimization
OptoPrime⚡⚡HighFast optimization with full context

OPRO

Learn more about OPRO →

TextGrad

Learn more about TextGrad →

OptoPrime

Learn more about OptoPrime →

Switching Optimizers

One of Trace2's key features is that you can easily switch between optimizers:

from opto.optimizers import OptoPrime, OPRO, TextGrad

# All use the same interface
optimizer1 = OptoPrime(params)
optimizer2 = OPRO(params)
optimizer3 = TextGrad(params)

Performance Comparison

Choosing an Optimizer

Next Steps