Skip to content

feat(orchestrator): per-Agent LLM model selection#387

Open
sneumannb5 wants to merge 1 commit into
byte5ai:mainfrom
sneumannb5:feat/define-llm-model
Open

feat(orchestrator): per-Agent LLM model selection#387
sneumannb5 wants to merge 1 commit into
byte5ai:mainfrom
sneumannb5:feat/define-llm-model

Conversation

@sneumannb5

Copy link
Copy Markdown
Contributor

What

Per-Agent orchestrator LLM model selection (Closes #296). Each Agent can pin its own model (and per-turn triage routing) via the Admin builder instead of one
global ORCHESTRATOR_MODEL. Model picker is populated from the @omadia/llm-provider registry.

Why

Cost/latency differ per Agent — a high-volume support Agent can run on a cheap model while a reasoning-heavy one stays on the frontier model. Turns an
operator runtime choice into a per-instance setting instead of a deploy-time env decision. The pluggable-provider work only pays off once instances can
actually pick different models.

Test plan

  • cd middleware && npm run typecheck -w @omadia/orchestrator
  • cd middleware && npx tsc --noEmit in middleware and web-ui (clean)
  • new/affected tests pass: configStoreModelRoutingValidation, agentBuilderAgentNode, agentGraphStoreSubAgentModelValidation, orchestratorRegistry, subAgentModelResolution, agentBuilderSubAgentTools
  • manual: set per-Agent model in Admin builder → confirm effectiveModel badge + registry agent rebuilt log, turn runs without 404

Note: full middleware suite has 5 pre-existing failures in durableRecall/recallProbe — bisected to 1550268 (#385), date-relative test rot
(fixed 2026-06-01 data vs now()), unrelated to this PR.

Risk / blast radius

  • No schema change — reuses existing agents.model_routing (JSONB) + agent_subagents.model.
  • No new env var. ORCHESTRATOR_MODEL kept as the fallback tier → existing deployments unchanged.
  • Resolution behaviour change (core): the orchestrator, per-turn router, and in-process sub-agents send model raw to a single provider adapter.
    Per-Agent refs are now resolved to the active provider's bare modelId before build (resolveModelIdForProvider): registry-known same-provider →
    modelId; cross-provider → dropped to default (out of scope, would 404 on the wrong adapter); registry-unknown → passed through raw (preserves
    pre-resolution behaviour, e.g. the default classifier).
  • Public API (additive): GET /v1/builder/models now returns model_id (bare vendor id) alongside id.
  • Hot-applies via the existing per-Agent rebuild — no restart.

Naming-decisions still pending

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow defining the LLM model per orchestrator instance

1 participant