[PR #5713] [MERGED] server: return empty slice on empty /api/embed request #11897

Closed
opened 2026-04-12 23:42:04 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/5713
Author: @jmorganca
Created: 7/16/2024
Status: Merged
Merged: 7/16/2024
Merged by: @jmorganca

Base: mainHead: jmorganca/embed


📝 Commits (2)

  • 2f3f1f8 server: return empty slice on empty /api/embed request
  • 67ae410 fix tests

📊 Changes

2 files changed (+7 additions, -3 deletions)

View changed files

📝 api/types.go (+1 -1)
📝 server/routes_test.go (+6 -2)

📄 Description

Before:

curl http://localhost:11434/api/embed \                                 
  -H "Content-Type: application/json" \
  -d '{
    "input": "",
    "model": "all-minilm"
  }'
{"model":"all-minilm"}

After:

curl http://localhost:11434/api/embed \                                 
  -H "Content-Type: application/json" \
  -d '{
    "input": "",
    "model": "all-minilm"
  }'
{"model":"all-minilm","embeddings":[]}

🔄 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/5713 **Author:** [@jmorganca](https://github.com/jmorganca) **Created:** 7/16/2024 **Status:** ✅ Merged **Merged:** 7/16/2024 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `jmorganca/embed` --- ### 📝 Commits (2) - [`2f3f1f8`](https://github.com/ollama/ollama/commit/2f3f1f86d1a377adcf8f8c62b87213df2868c1ce) server: return empty slice on empty `/api/embed` request - [`67ae410`](https://github.com/ollama/ollama/commit/67ae410efdf2b53d02b750e41211cba80680828f) fix tests ### 📊 Changes **2 files changed** (+7 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+1 -1) 📝 `server/routes_test.go` (+6 -2) </details> ### 📄 Description Before: ``` curl http://localhost:11434/api/embed \ -H "Content-Type: application/json" \ -d '{ "input": "", "model": "all-minilm" }' {"model":"all-minilm"} ``` After: ``` curl http://localhost:11434/api/embed \ -H "Content-Type: application/json" \ -d '{ "input": "", "model": "all-minilm" }' {"model":"all-minilm","embeddings":[]} ``` --- <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-12 23:42:04 -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#11897