[PR #4424] [MERGED] Fixed the API endpoint /api/tags when the model list is empty. #16759

Closed
opened 2026-04-16 05:42:14 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/4424
Author: @machimachida
Created: 5/14/2024
Status: Merged
Merged: 5/14/2024
Merged by: @jmorganca

Base: mainHead: bugfix/empty-tags


📝 Commits (2)

  • 8f6c5cf Fixed the API endpoint /api/tags to return {models: []} instead of {models: null} when the model list is empty.
  • 86267c2 Update server/routes.go

📊 Changes

2 files changed (+2 additions, -1 deletions)

View changed files

📝 server/routes.go (+1 -1)
📝 server/routes_test.go (+1 -0)

📄 Description

Summary

Fixed an issue with the /api/tags endpoint where an empty model list was returning {models: null}. The endpoint now returns {models: []} when no models are available.


🔄 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/4424 **Author:** [@machimachida](https://github.com/machimachida) **Created:** 5/14/2024 **Status:** ✅ Merged **Merged:** 5/14/2024 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `bugfix/empty-tags` --- ### 📝 Commits (2) - [`8f6c5cf`](https://github.com/ollama/ollama/commit/8f6c5cf807cc5accbb4a5e69e346fc8802fd9b38) Fixed the API endpoint /api/tags to return {models: []} instead of {models: null} when the model list is empty. - [`86267c2`](https://github.com/ollama/ollama/commit/86267c207bb2aef904c5b8ec72cbfda09d1c1018) Update server/routes.go ### 📊 Changes **2 files changed** (+2 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `server/routes.go` (+1 -1) 📝 `server/routes_test.go` (+1 -0) </details> ### 📄 Description ## Summary Fixed an issue with the `/api/tags` endpoint where an empty model list was returning `{models: null}`. The endpoint now returns `{models: []}` when no models are available. --- <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 05:42:14 -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#16759