mirror of
https://github.com/open-webui/docs.git
synced 2026-11-05 01:38:13 +00:00
[GH-ISSUE #1385] Models from an external OpenAI-compatible connection are missing from /api/models when prefix_id is empty #169
Labels
No labels
bug
documentation
documentation
duplicate
enhancement
enhancement
good first issue
good first issue
good first issue
help wanted
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/docs#169
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @CFiora on GitHub (Sep 8, 2026).
Original GitHub issue: https://github.com/open-webui/docs/issues/1385
Bug Description
When an external OpenAI-compatible connection has an empty
prefix_id, the models it returns are correctly fetched when querying that connection individually (/openai/models/{idx}), but they are silently dropped when the models are merged/aggregated into the final list at/api/models. No error is logged.Adding a non-empty
prefix_idto the same connection immediately fixes the issue and the models appear in/api/models.Environment
ghcr.io/open-webui/open-webui:mainghcr.io/berriai/litellm:main-latest), acting as an OpenAI-compatible endpoint on the same Docker networkSteps to Reproduce
http://litellm:4000/v1), withprefix_idleft empty.enable: true), verify connection succeeds (POST /openai/verifyreturns 200).GET /openai/models/{connection_index}
→ Returns the full list of models correctly (confirmed 8 models returned, e.g.
packy.aws-q/claude-sonnet-5,packy.cc-sale/claude-sonnet-5, etc.)GET /api/models
→ The models from this connection are completely absent, even though other connections (with non-empty
prefix_id) show up correctly.prefix_idto any non-empty string (e.g.lite/)./api/modelsagain → the models now appear correctly (prefixed as expected).Expected Behavior
Models from a connection with an empty
prefix_idshould still appear in the aggregated/api/modelsresponse, the same as models from a connection with aprefix_idset — only the model ID prefixing should differ, not whether the models are included at all.Actual Behavior
Models are silently dropped during aggregation when
prefix_idis an empty string (""). No error, no warning in logs — connection verification and individual model fetch (/openai/models/{idx}) both succeed.Additional Context
OPENAI_API_CONFIGSfor the affected connection (viaGET /openai/config):prefix_id, work as expected.200 OKresponses for all relevant endpoints (/openai/verify,/openai/models/{idx},/api/models) — no exceptions or errors are logged, making this hard to diagnose.Suggested Fix Direction
The model-merging logic likely uses
prefix_idas part of a key (e.g., for deduplication or grouping), and an empty string may be causing models to be overwritten, filtered, or excluded unintentionally during that step. Would appreciate a look at whatever function assembles the aggregated model list at/api/modelsto see how it treats connections with an empty/falsyprefix_id.Workaround
Setting a non-empty
prefix_id(e.g. a short string likelite/) on the affected connection resolves the issue completely.