How to Configure Different Models for the Critic vs Generator in ADHD

You can configure different models for the critic and generator in ADHD by using the --critic-model CLI flag or the criticModel property in the RunOptions object, while the generator uses the standard --model or model field.

The ADHD framework separates creative ideation from critical evaluation through distinct pipeline phases. By default, both the generator (which handles the diverge and deepen passes) and the critic (which manages scoring and clustering) execute on the same language model. However, as implemented in UditAkhourii/adhd, you can override this behavior to use specialized models for each role, decorrelating errors between generation and evaluation.

Understanding the Generator and Critic Architecture

The ADHD pipeline operates in distinct phases that map to different cognitive roles:

  • Generator: Executes the diverge and deepen passes to produce raw ideas and expand them.
  • Critic: Runs the score and cluster phases to evaluate idea quality and group similar concepts.

By default, the system passes the same model identifier to both components. To improve result quality or reduce costs, you can assign a high-performance model to the critic while using a faster, cheaper model for generation, or vice versa.

Command-Line Configuration

The CLI interface in src/cli.ts exposes two distinct flags for model selection:

  • --model NAME – Specifies the model for the generator phase (diverge and deepen). This also serves as the default for the critic if --critic-model is omitted.
  • --critic-model NAME – Specifies a dedicated model for the critic phase (score and cluster).
adhd run \
  --model claude-sonnet-4-5 \
  --critic-model gpt-4o \
  --problem "Create a low-cost feature-flag system" \
  --ideas-per-frame 6 \
  --top-k 3

If --critic-model is not provided, the critic automatically falls back to the value specified in --model.

Programmatic Configuration

When integrating ADHD into a Node.js application, the run function accepts a RunOptions object defined in src/types.ts. This interface includes both model and criticModel fields:

import { run } from "./src/engine";

const result = await run({
  problem: "Design a privacy-first analytics dashboard",
  model: "anthropic/claude-3-sonnet-20240229",  // Generator model
  criticModel: "openai/gpt-4o-mini",            // Critic model
  framesPerRun: 5,
  ideasPerFrame: 6,
  topK: 3,
  concurrency: 4,
});

The criticModel property is optional. When undefined, the system uses the model value for both phases.

Internal Implementation Details

The model selection logic resides in src/engine.ts at lines 27–30. Here, the pipeline initializes the critic model by checking for an explicit override before falling back to the generator model:

// The critic (score + cluster) can run on a different model from the generator.
// Defaults to the generator model.
const critic = criticModel ?? model;

According to the ADHD source code, the critic constant is then passed to the scoreIdeas and clusterIdeas functions, while the original model value is retained for the diverge and deepen passes. This separation ensures that generation and evaluation occur on potentially different architectures or providers.

Practical Configuration Examples

Using Claude for Generation and GPT-4o for Evaluation

This configuration leverages Claude Sonnet's creative capabilities for ideation while using GPT-4o for structured scoring:

adhd run \
  --problem "How can we reduce onboarding friction?" \
  --model claude-sonnet-4-5 \
  --critic-model gpt-4o \
  --ideas-per-frame 6 \
  --top-k 3

Programmatic Setup with Mixed Providers

For applications requiring fine-grained control, instantiate the engine with explicit model assignments:

import { run } from "./src/engine";

async function main() {
  const output = await run({
    problem: "Optimize database query performance",
    model: "claude-sonnet-4-5",        // Generator: Diverge + Deepen
    criticModel: "gpt-4o",             // Critic: Score + Cluster
    framesPerRun: 5,
    ideasPerFrame: 6,
    topK: 3,
    concurrency: 4,
  });

  console.log("Best non-obvious pick:", output.nonObviousPick?.text);
}

main();

Summary

  • Separate model support: ADHD allows distinct models for the generator (diverge/deepen) and critic (score/cluster) phases via the criticModel option.
  • CLI usage: Pass --model for the generator and --critic-model for the critic in the command line.
  • Programmatic usage: Set the criticModel property in the RunOptions object passed to the run() function from src/engine.ts.
  • Fallback behavior: If criticModel is omitted, the system defaults to using the generator model for all phases, as implemented in lines 27–30 of src/engine.ts.
  • File references: Configuration is handled in src/cli.ts for command-line parsing and src/types.ts for TypeScript interface definitions.

Frequently Asked Questions

What happens if I don't specify a critic model?

If you omit the --critic-model flag or the criticModel property, the critic phase automatically uses the same model as the generator. The fallback logic const critic = criticModel ?? model in src/engine.ts ensures backward compatibility while allowing optional specialization.

Can I use models from different providers for each phase?

Yes, you can mix providers. The model and criticModel fields accept any valid model identifier string that your underlying LLM client supports, such as "anthropic/claude-3-sonnet-20240229" for the generator and "openai/gpt-4o" for the critic.

Which pipeline phases use which model?

The generator model handles the diverge and deepen passes (creative expansion), while the critic model handles the score and cluster functions (evaluation and categorization). This separation is maintained throughout the execution flow in src/engine.ts.

Does using different models affect concurrency settings?

No, concurrency is controlled independently via the concurrency option in RunOptions or the corresponding CLI flag. The model selection does not impact how many requests are run in parallel, though different models may have varying rate limits or latency characteristics that you should consider when setting concurrency values.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →