Skip to content

feat(agent): thin LiteLLM-direct model factory with native fallbacks (Phase 2b-ii) - #5

Merged
PurpleCHOIms merged 1 commit into
mainfrom
feat/agent-model-factory
Oct 26, 2026
Merged

PurpleCHOIms merged 1 commit into
mainfrom
feat/agent-model-factory

Conversation

@PurpleCHOIms

Copy link
Copy Markdown
Member

Second implementation PR of the agent runtime design.

  • autobot/agent/models.py (~90 lines): builds ChatLiteLLM directly from env (AUTOBOT_MODEL required, AUTOBOT_FALLBACK_MODELS comma/space separated, AUTOBOT_TEMPERATURE fail-loud on garbage) — Decepticon's 1784-line LLMFactory/proxy-gateway/credential-inventory layer becomes a config read.
  • Provider fallbacks attach natively via Runnable.with_fallbacks — the design's MODEL_FALLBACK middleware estimate dissolves to zero custom code (improvement over the doc's ~60-line estimate; the doc amendment rides with the graph PR).
  • 6 new tests (fail-closed parsing, construction, native fallback attachment); suite now 229 passed, make ci-lint clean.

Next in the sequence: blue_cell graph + langgraph.json + container + compose wiring (the assembly wiring test lands there).

Replaces the need for Decepticon's 1784-line LLMFactory + proxy gateway with
a ~90-line factory: ChatLiteLLM built directly from AUTOBOT_MODEL /
AUTOBOT_FALLBACK_MODELS / AUTOBOT_TEMPERATURE (fail-closed env parsing), and
provider fallbacks attached natively via Runnable.with_fallbacks — the
MODEL_FALLBACK middleware slot dissolves into the factory (thinner than the
design's ~60-line middleware estimate; noted in the PR, doc amendment rides
with the graph PR).

langchain-litellm>=0.9.0 added as the LiteLLM-SDK bridge.
@PurpleCHOIms
PurpleCHOIms merged commit ab94b9e into main Oct 26, 2026
1 check failed
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.

1 participant