[PR #21258] [CLOSED] Fix GitHub Models model-list endpoint mapping (/catalog/models) #41626

Closed
opened 2026-04-25 13:47:39 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/21258
Author: @tall27
Created: 2/8/2026
Status: Closed

Base: mainHead: codex/github-models-catalog-endpoint


📝 Commits (1)

  • 31e01d0 Fix GitHub Models listing endpoint for OpenAI-compatible connections

📊 Changes

1 file changed (+14 additions, -4 deletions)

View changed files

📝 backend/open_webui/routers/openai.py (+14 -4)

📄 Description

Summary

Fix model listing for GitHub Models in OpenAI-compatible connections.

Open WebUI currently requests <base_url>/models for provider model refresh. For GitHub Models, this fails when base URL is https://models.github.ai/inference, because model catalog is exposed at:

  • https://models.github.ai/catalog/models

This PR adds provider-aware endpoint resolution for model listing while preserving existing behavior for other providers.

Changes

  • Added get_models_endpoint(url: str) helper in backend/open_webui/routers/openai.py
  • If URL contains models.github.ai, model list endpoint is mapped to:
    • https://models.github.ai/catalog/models
  • Replaced hardcoded f"{url}/models" calls with get_models_endpoint(url) in:
    • get_all_models_responses
    • get_models
    • verify_connection

Why

Without this mapping, model refresh fails with 404/content-type parsing errors against .../inference/models.

Validation

  • Python syntax check:
    • python3 -m py_compile backend/open_webui/routers/openai.py

Closes #21257


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/21258 **Author:** [@tall27](https://github.com/tall27) **Created:** 2/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/github-models-catalog-endpoint` --- ### 📝 Commits (1) - [`31e01d0`](https://github.com/open-webui/open-webui/commit/31e01d0aee9409ae4079d74408eff76c725dc004) Fix GitHub Models listing endpoint for OpenAI-compatible connections ### 📊 Changes **1 file changed** (+14 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/openai.py` (+14 -4) </details> ### 📄 Description ## Summary Fix model listing for GitHub Models in OpenAI-compatible connections. Open WebUI currently requests `<base_url>/models` for provider model refresh. For GitHub Models, this fails when base URL is `https://models.github.ai/inference`, because model catalog is exposed at: - `https://models.github.ai/catalog/models` This PR adds provider-aware endpoint resolution for model listing while preserving existing behavior for other providers. ## Changes - Added `get_models_endpoint(url: str)` helper in `backend/open_webui/routers/openai.py` - If URL contains `models.github.ai`, model list endpoint is mapped to: - `https://models.github.ai/catalog/models` - Replaced hardcoded `f"{url}/models"` calls with `get_models_endpoint(url)` in: - `get_all_models_responses` - `get_models` - `verify_connection` ## Why Without this mapping, model refresh fails with 404/content-type parsing errors against `.../inference/models`. ## Validation - Python syntax check: - `python3 -m py_compile backend/open_webui/routers/openai.py` Closes #21257 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-25 13:47:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#41626