- Get Started

Cost Optimization & Adversarial Review

For the routing strategy and core configuration, see the Model Routing page.

AgentProvider / ModelCost TierWhy
FORGEanthropic / claude-sonnet-4-20250514HighDeep reasoning and long-context planning. The largest cost bucket because FORGE runs the most tokens.
NEXUSanthropic / claude-sonnet-4-20250514HighController decisions and reconcile loops. Keep the count of tokens bounded by returning structured decisions.
SENTINELopenai / gpt-4.1MediumAdversarial review runs once per segment and once per final. Use a cheaper model if your repository is small.
VESSELopenai / gpt-4oLowCI/CD scripting and merge decisions. Short prompts and fast inference.
LOREanthropic / claude-haiku-4-20250514LowDocumentation generation. Lightweight model is sufficient for ADRs and CHANGELOG entries.

Cost Optimization

The biggest levers for cost reduction are, in order: shrinking FORGE context windows, reducing SENTINEL review rounds, using cheaper models for VESSEL and LORE, and scaling FORGE instances only when needed. The orchestrator does not do automatic cost routing, but it gives you the knobs to tune the cost profile directly.

Shrink context windows. FORGE passes the entire repository context to the model when it plans and implements. Use .gitignore, module boundaries, and focused issue descriptions to keep the working set small. A 50% reduction in context tokens often produces a larger cost savings than downgrading the model.

Reduce SENTINEL review rounds. SENTINEL runs once per segment and once for the final review. If the repository is small and the team is conservative, disable per-segment review and keep only the final review. This is a project-level trade-off between quality and cost.

Downgrade VESSEL and LORE. These agents run short, deterministic prompts. VESSEL can run on gpt-4o-mini or gpt-4o; LORE can run on claude-haiku. The savings are small per ticket but add up across many tickets.

Scale instances deliberately. FORGE instances controls how many parallel worker workspaces exist. Each instance is a fresh Coder workspace plus a separate LLM call stream. Increase instances only when you have a backlog of independent tickets, not because you want a single ticket to run faster.

Monitor cost per role

The Coder AI Gateway emits usage events with a role tag derived from the agent that made the request. Aggregate by role to see where your token spend is coming from. FORGE and NEXUS typically dominate; VESSEL and LORE should be a small fraction.

Adversarial Review with Different Model Families

One of the most effective ways to catch reasoning errors is to have the reviewer use a different model family than the implementer. If FORGE runs Claude and SENTINEL also runs Claude, both models may share the same training biases and blind spots. By routing FORGE to Anthropic and SENTINEL to OpenAI, you create natural adversarial review: the reviewer evaluates the plan and code with a different set of inductive biases.

Adversarial review is not automatic. You must configure it explicitly in registry.json. The recommended default is:

AgentProviderModel FamilyPurpose
FORGEAnthropicClaude Sonnet / OpusPrimary implementation. Avoids placing all reasoning in one basket.
SENTINELOpenAIGPT-4.1 / GPT-4oAdversarial review across provider boundaries. Detects Anthropic-specific blind spots.
NEXUSAnthropicClaude SonnetController can use the same provider as FORGE; it does not review FORGE output.
VESSELOpenAIGPT-4oDifferent provider than FORGE; optional, but useful for CI script robustness.
LOREAnthropicClaude HaikuCheapest sufficient model for docs and summarization.

Avoid symmetric configurations

Running FORGE and SENTINEL on the same provider and model family defeats the purpose of adversarial review. If your organization has a single provider contract, at minimum use a different model size (e.g. FORGE on Claude Sonnet, SENTINEL on Claude Haiku) or a different release series. The strongest setup uses different providers entirely.

Continue reading

See LiteLLM Fallback & Gateway Config for air-gapped deployments and Coder AI Gateway setup.