Skip to content

API Reference parrot.flows.dev_loop.catalog

github-actions[bot] edited this page Nov 10, 2026 · 4 revisions

parrot.flows.dev_loop.catalog

View source

LLM client + model catalog for the dev-loop demo server (FEAT-378 UI).

The dev-loop flow materialises every agent — development workers, QA judges, the adversarial reviewer — through :func:parrot.flows.dev_loop.agent_builder.build_dispatcher, which knows exactly seven backends (the DevAgentBackend Literal). Nothing in the library, however, publishes which of those backends is usable in which role, nor which models they accept: the console UI needs both to render its <select> pickers.

This module is that missing catalog. It is deliberately data, not logic:

  • BACKENDS mirrors agent_builder.build_dispatcher's if/elif chain one entry per branch — same ids, same env var, same fallback model.
  • ROLES records which backends each role can actually accept, read off the code that consumes them (see :data:JUDGE_BACKENDS).
  • :func:catalog_payload resolves the effective defaults through conf.config.get so the UI shows what this deployment will really use, not what the source file hardcodes.

Model lists are a curated starting point, never a whitelist: every picker in the UI also accepts a free-text model id, and an empty model always means "use the backend default".

FEAT-388: this module is the package home of the catalog, promoted from examples/dev_loop/llm_catalog.py (Module 1). That file is now a thin re-export shim so the demo server (import llm_catalog) keeps working unchanged; the CLI (parrot devloop) imports this module directly.

Attribute ADVERSARIAL_BACKEND

Type: str

Attribute BACKENDS

Type: Tuple[BackendInfo, ...]

Class BackendInfo

One dev-loop LLM backend, as the console needs to render it.

Parameter Type Default Description
id str
label str
transport str
model_env Optional[str]
default_model str
models Tuple[str, ...]
requires str
roles Tuple[str, ...]
notes str ''

Fields:

Field Type Default Description
id str The DevAgentBackend literal value.
label str Human-readable name for the picker.
transport str "cli" when the dispatcher shells out to a coding CLI, "api" when it drives an AbstractClient.
model_env Optional[str] The config key build_dispatcher reads for this backend's model, or None when the default is hardcoded.
default_model str The fallback used when neither the spec nor the env supplies a model.
models Tuple[str, ...] Curated model ids offered in the picker. Never a whitelist — the UI also accepts free text.
requires str What an operator must provision for this backend to work (CLI on $PATH, API key, …).
roles Tuple[str, ...] Roles this backend may fill.
notes str '' Extra behaviour worth surfacing in the UI hint line.

Attribute JUDGE_BACKENDS

Type: Tuple[str, ...]

Attribute PRIMARY_REVIEW_BACKENDS

Type: Tuple[str, ...]

Attribute RESEARCH_PARTNER_BACKENDS

Type: Tuple[BackendInfo, ...]

Attribute REVIEW_ONLY_BACKENDS

Type: Tuple[BackendInfo, ...]

Function backends_for_role

Return every backend that may fill role.

backends_for_role(role: str) -> List[BackendInfo]

Parameter Type Default Description
role str One of development, judge, primary_review, adversarial, planner, research_partner.

Returns: List[BackendInfo] — The matching backends, in catalog order. Searches across both BACKENDS and RESEARCH_PARTNER_BACKENDS (FEAT-482) — "nova" appears in both but is the same object, so it is never duplicated in the result.

Function catalog_payload

Build the full /api/config payload consumed by the console UI.

catalog_payload(config_getter: Optional[ConfigGetter] = None) -> Dict[str, Any]

Parameter Type Default Description
config_getter Optional[ConfigGetter] None (key, fallback) -> Any; defaults to conf.config.get.

Returns: Dict[str, Any] — A JSON-serialisable dict with the backend catalog, the role → backend mapping, and the resolved review/judge defaults.

Function default_judge_panel_payload

Return the default judge panel as [{agent, model}, ...].

Resolves through the library's own DEV_LOOP_JUDGE_PANEL / default_judge_panel() chain so the console shows the panel the flow would really assemble, then falls back to the catalog's own 3-judge default if the library symbols are unavailable (e.g. running the console against a build predating FEAT-378).

default_judge_panel_payload(config_getter: Optional[ConfigGetter] = None) -> List[Dict[str, str]]

Parameter Type Default Description
config_getter Optional[ConfigGetter] None (key, fallback) -> Any; defaults to conf.config.get.

Returns: List[Dict[str, str]] — A list of {"agent": ..., "model": ...} dicts.

Function effective_default_model

Resolve the model this deployment will actually use for backend.

Mirrors build_dispatcher: the env var wins over the hardcoded fallback, and an explicit DevAgentSpec.model (not visible here) would win over both.

effective_default_model(backend: BackendInfo, config_getter: Optional[ConfigGetter] = None) -> str

Parameter Type Default Description
backend BackendInfo The catalog entry to resolve.
config_getter Optional[ConfigGetter] None (key, fallback) -> Any; defaults to conf.config.get.

Returns: str — The effective default model id.

Function get_backend

Return the :class:BackendInfo for backend_id, or None.

Looks across both BACKENDS (coding dev-loop backends) and RESEARCH_PARTNER_BACKENDS (FEAT-482) — e.g. get_backend("gpt") resolves even though "gpt" is not itself a build_dispatcher branch.

get_backend(backend_id: str) -> Optional[BackendInfo]

Parameter Type Default Description
backend_id str

Returns: Optional[BackendInfo]

Function resolve_adversarial_backend

Return the deployment's configured adversarial backend.

Resolves DEV_LOOP_ADVERSARIAL_BACKEND through config, defaulting to :data:ADVERSARIAL_BACKEND ("codex") when unset — [R3]: an operator who configures nothing sees byte-identical behaviour to pre-FEAT-405.

resolve_adversarial_backend(config_getter: Optional[ConfigGetter] = None) -> str

Parameter Type Default Description
config_getter Optional[ConfigGetter] None (key, fallback) -> Any; defaults to conf.config.get.

Returns: str — "codex", "nova" or "mantle" (FEAT-486 — the read-only gpt-5.6-sol counter-reviewer over bedrock-mantle).

Raises:

  • ValueError — If the configured value is not one of those three — names the valid options.

Function resolve_research_partner_backend

Return the deployment's configured research-partner backend.

Resolves DEV_FLOW_RESEARCH_PARTNER through config. Unset (empty string) means the seat is disabled — an operator who configures nothing sees byte-identical behaviour to pre-FEAT-482.

resolve_research_partner_backend(config_getter: Optional[ConfigGetter] = None) -> str

Parameter Type Default Description
config_getter Optional[ConfigGetter] None (key, fallback) -> Any; defaults to conf.config.get.

Returns: str — "" (disabled), "gpt", or "nova".

Raises:

  • ValueError — If the configured value is neither "gpt" nor "nova" — names the valid options. Also raised (naming both the decorrelation reason and the Bedrock 400) if the resolved backend's model is an Anthropic model id.

Function validate_research_partner_model

Hard-reject an Anthropic model configured for the research-partner seat.

Standalone (not private, not folded into any resolver) precisely so it is independently unit-testable and reusable at every site that could end up driving Bedrock with a research-partner model id — currently :func:resolve_research_partner_backend (config-driven path) and :class:~parrot.flows.dev_flow.research_partner.BedrockResearchPartner (defense-in-depth for direct construction with an explicit backend, which bypasses the resolver entirely). A third backend added later can call this same function without duplicating the policy.

validate_research_partner_model(model: str) -> None

Parameter Type Default Description
model str The resolved partner model id (e.g. from DEV_FLOW_RESEARCH_PARTNER_GPT_MODEL / DEV_FLOW_RESEARCH_PARTNER_NOVA_MODEL).

Raises:

  • ValueError — If model matches an Anthropic model-id prefix. Names BOTH the decorrelation reason and the Bedrock 400.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally