Skip to content

feat: Plumb LLM retry controls through RunConfig#208

Merged
eric-tramel merged 1 commit into
mainfrom
ewt/configure-restarts
Jan 13, 2026
Merged

feat: Plumb LLM retry controls through RunConfig#208
eric-tramel merged 1 commit into
mainfrom
ewt/configure-restarts

Conversation

@eric-tramel

Copy link
Copy Markdown
Contributor

Summary

This PR introduces global, user-configurable controls for LLM generation retry effort via RunConfig, and removes prior module-level hardcoding inside generation tasks (notably llm_completion generators and LLM judge). This is a necessary change so users can explicitly bound/scale effort spent per sample (latency/cost/stability) across all tasks that rely on ModelFacade.generate().

What changed

  • Added new RunConfig fields (single source of truth):
    • max_conversation_restarts: int (default 5, ge=0)
    • max_conversation_correction_steps: int (default 0, ge=0)
  • Removed generator-local hardcoded retry defaults in llm_completion generators
    • Generators now read retry settings from self.resource_provider.run_config
  • Updated LLM judge behavior
    • Previously, LLMJudgeCellGenerator used a 2× restart multiplier relative to the module default.
    • Now, LLM judge uses the same global RunConfig values as other LLM completion generators.

Why this is needed (user impact)

LLM generation effort per sample was previously implicitly determined by internal defaults (and judge had an additional multiplier), making it difficult for users to:

  • Cap worst-case latency for dataset generation
  • Cap cost (token usage) per sample
  • Tune quality vs throughput consistently

With this change, users can control these tradeoffs in one place.

Behavioral impact / compatibility notes

  • Defaults preserve current non-judge behavior: RunConfig.max_conversation_restarts=5, max_conversation_correction_steps=0 matches the previous LLM generator defaults.
  • LLM judge behavior changes: judge no longer gets extra restart budget. Users who relied on higher judge persistence can now set higher global values explicitly via RunConfig.

Plumbing details

  • DataDesigner already threads RunConfig into the engine via ResourceProvider.run_config.
  • LLM completion generators (including judge) now pass run_config values into:
    • ModelFacade.generate(max_correction_steps=..., max_conversation_restarts=...)

Example usage

from data_designer.essentials import DataDesigner, RunConfig

dd = DataDesigner()
dd.set_run_config(
    RunConfig(
        max_conversation_restarts=2,
        max_conversation_correction_steps=1,
    )
)

Files changed

  • src/data_designer/config/run_config.py
  • src/data_designer/engine/column_generators/generators/llm_completion.py
  • tests/engine/column_generators/generators/test_llm_completion_generators.py
  • tests/interface/test_data_designer.py

Tests

  • Updated unit tests verify defaults/persistence and that generators/judge pass run_config values into model.generate(...).

@eric-tramel eric-tramel changed the title Plumb LLM retry controls through RunConfig (remove hardcoded retries; unify LLM judge + generators) feat: Plumb LLM retry controls through RunConfig (remove hardcoded retries; unify LLM judge + generators) Jan 13, 2026
@eric-tramel eric-tramel changed the title feat: Plumb LLM retry controls through RunConfig (remove hardcoded retries; unify LLM judge + generators) feat: Plumb LLM retry controls through RunConfig Jan 13, 2026
@eric-tramel eric-tramel self-assigned this Jan 13, 2026
@eric-tramel eric-tramel added the enhancement New feature or request label Jan 13, 2026
@eric-tramel eric-tramel merged commit b18fc57 into main Jan 13, 2026
21 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants