[PR #13716] fix(server): support nested model names in v1/models/ endpoint #19632

Open
opened 2026-04-16 07:12:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/13716
Author: @Sekousuke
Created: 1/14/2026
Status: 🔄 Open

Base: mainHead: fix-model-path-issue


📝 Commits (1)

  • 6b3e006 fix(server): support nested model names in v1/models/ endpoint

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 server/routes.go (+6 -2)

📄 Description

Summary

This PR fixes issue #13715 by allowing the /v1/models/:model endpoint to handle model names with slashes (e.g., HuggingFace models).

Changes

  • Changed the route from :model to *model to support nested paths.
  • Updated ShowHandler to fall back to the URL path parameter if the JSON body is missing (as seen in OpenAI-compatible GET requests).
  • Handled the leading slash captured by the wildcard parameter using strings.TrimPrefix.

Fixes

Fixes #13715


🔄 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/ollama/ollama/pull/13716 **Author:** [@Sekousuke](https://github.com/Sekousuke) **Created:** 1/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-model-path-issue` --- ### 📝 Commits (1) - [`6b3e006`](https://github.com/ollama/ollama/commit/6b3e006b54b7517b5e8edb8a5859490abc7789f2) fix(server): support nested model names in v1/models/ endpoint ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `server/routes.go` (+6 -2) </details> ### 📄 Description ### Summary This PR fixes issue #13715 by allowing the `/v1/models/:model` endpoint to handle model names with slashes (e.g., HuggingFace models). ### Changes - Changed the route from `:model` to `*model` to support nested paths. - Updated `ShowHandler` to fall back to the URL path parameter if the JSON body is missing (as seen in OpenAI-compatible GET requests). - Handled the leading slash captured by the wildcard parameter using `strings.TrimPrefix`. ### Fixes Fixes #13715 --- <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-16 07:12:15 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#19632