Reach the model the setup screen chose from the LlamaIndex Bot, not only an OpenAI one - #533
Merged
davidmckayv merged 2 commits intoSep 14, 2026
Conversation
zopeVaibhav
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
September 14, 2026 16:15
zopeVaibhav
force-pushed
the
fix/llamaindex-model-choice
branch
4 times, most recently
from
September 14, 2026 16:45
ec5c5ff to
00afa60
Compare
…nly an OpenAI one
zopeVaibhav
force-pushed
the
fix/llamaindex-model-choice
branch
from
September 14, 2026 16:49
00afa60 to
815cbdc
Compare
# Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #532
What this changes
The LlamaIndex Bot built
OpenAI(model=BOT_MODEL)and never called the_model_id()written above it, so it worked only with an OpenAI model name sent to api.openai.com. With an Anthropic key every run failed withUnknown model 'claude-sonnet-4-5', with an OpenAI-compatible endpoint every run failed withUnknown modelfor that endpoint's model, and an OpenAI model name behind a compatible endpoint went to OpenAI instead, because the client readsOPENAI_API_BASEand Compose passesOPENAI_BASE_URL.It now builds
LiteLLM(model=_model_id())fromllama-index-llms-litellm, which is how the Agno Bot already reaches a model and why_model_id()has that shape. LiteLLM routesanthropic/...to Anthropic withANTHROPIC_API_KEYandANTHROPIC_BASE_URL, andopenai/...toOPENAI_BASE_URLwhen it is set, so the three setup choices reach the model they name without any per-provider branching here.Two LlamaIndex specifics needed handling, both found by running it rather than by reading:
openai/local-modelcame back false and the router refused to start the run. When LiteLLM does not know the configured model, the harness registers it as a chat model that can call tools. The person named that model on the setup screen and the Bot cannot work at all otherwise.temperature=0.1, which LiteLLM refuses forgpt-5.5as a reasoning model. Before this change that combination worked, so without handling it the fix would have broken the default OpenAI path. The client is built withdrop_params, scoped to this one client rather than set globally, so a parameter a model does not accept is dropped instead of failing the run.Deliberately left alone: the ChatGPT and Claude plan choices, which go through their own dedicated Bots, the catalogue, and every other harness.
llama-index-llms-openaiis removed from the requirements because nothing imports it now.Where it runs
litellm.register_modeladds one entry to LiteLLM's in-process model table when the module loads, for the single model this container was started with.Boundary and audit
Nothing on the server side changes, and the harness still refuses every request without the server's token. Two things do widen, stated so a reviewer does not have to find them. A model LiteLLM does not know is now assumed able to call tools; if an endpoint cannot, a run that offers tools fails at that endpoint instead of never starting. And a parameter a model rejects is dropped silently rather than returned as an error. The image also grows, from 612 MB to 869 MB in local builds, because LiteLLM is a larger dependency than the OpenAI client;
agent-adk,agent-agnoandagent-strandsalready ship it.Changelog
A line under
Unreleased.Proof
agent-llamaindex/tests/test_main.pystarts a local fake provider serving/v1/chat/completionsand/v1/messages, imports the harness under the environment the desktop writes for each choice, and posts an AG-UI run. It asserts HTTP 200,RUN_FINISHED, noRUN_ERROR, and that the fake provider received the chosen model on the chosen route. Againstmain(a97f775) all three fail:Unknown model 'claude-sonnet-4-5',Unknown model 'local-model', and for the OpenAI case a 401 from api.openai.com itself, because the base URL was ignored. On this branch: 3 passed.api.openai.com/api.anthropic.compointed at loopback: the Anthropic choice reachesPOST /v1/messagesforclaude-sonnet-4-5, the compatible endpoint reachesPOST /v1/chat/completionsforlocal-model, andgpt-5.5reaches the endpoint under bothOPENAI_BASE_URLandOPENAI_API_BASE. All four runs endRUN_FINISHEDwith the fake provider's answer in the stream.OPENAI_API_BASEcontrol answering. The published v0.0.10 Agno image, given the Anthropic environment, reaches/v1/messages, which is the behaviour this brings LlamaIndex in line with.llama-index-core0.14.24,llama-index-llms-litellm0.8.0,litellm1.100.1,llama-index-protocols-ag-ui0.5.0.