[PR #5285] [MERGED] OpenAI: /v1/embeddings compatibility #58428

Closed
opened 2026-04-29 13:18:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/5285
Author: @royjhan
Created: 6/25/2024
Status: Merged
Merged: 7/16/2024
Merged by: @royjhan

Base: mainHead: royh-openai-embed


📝 Commits (10+)

📊 Changes

3 files changed (+184 additions, -0 deletions)

View changed files

📝 openai/openai.go (+111 -0)
📝 openai/openai_test.go (+72 -0)
📝 server/routes.go (+1 -0)

📄 Description

In anticipation of #5127
Resolves #2416

curl http://localhost:11434/v1/embeddings \
  -H "Content-Type: application/json" \
  -d '{
    "input": ["hello", "hi"],
    "model": "all-minilm"
  }'
{
  "object": "list",
  "data": [
    {
      "object": "embedding",
      "embedding": [
        ...
      ],
      "index": 0
    },
    {
      "object": "embedding",
      "embedding": [
        ...
      ],
     "index": 1
    }
  ],
  "model": "all-minilm"
}

🔄 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/5285 **Author:** [@royjhan](https://github.com/royjhan) **Created:** 6/25/2024 **Status:** ✅ Merged **Merged:** 7/16/2024 **Merged by:** [@royjhan](https://github.com/royjhan) **Base:** `main` ← **Head:** `royh-openai-embed` --- ### 📝 Commits (10+) - [`c208aa4`](https://github.com/ollama/ollama/commit/c208aa44870ae351acc981e6101c7f77f673e17d) OpenAI v1 models - [`3c23c2a`](https://github.com/ollama/ollama/commit/3c23c2ac1d270a54d2b222e9f84ffebd4a14c2f7) Empty List Testing - [`6f0f1ad`](https://github.com/ollama/ollama/commit/6f0f1adfbaf8fe2d9b4353ff257c92a25b3875d7) Add back envconfig - [`d20d88c`](https://github.com/ollama/ollama/commit/d20d88cce8ba6bbbb30ac3eb6743f13c2854154d) v1/models docs - [`97b29c3`](https://github.com/ollama/ollama/commit/97b29c39ac9c3937fa8f7c4944abb378f13b4df0) Remove Docs - [`c170139`](https://github.com/ollama/ollama/commit/c1701396d49b3e1b20860eb1a7b3ba660e7816c6) OpenAI batch embed compatibility - [`780409b`](https://github.com/ollama/ollama/commit/780409b43bfedd330428cda4e2b8f6e613fbb46a) merge conflicts - [`5b51fb5`](https://github.com/ollama/ollama/commit/5b51fb568c8eb2ca0cf82afe0e04c52319b71819) integrate with api/embed - [`250ac04`](https://github.com/ollama/ollama/commit/250ac043df36132ed083e72b127bd8859ba81d9a) ep - [`99596f0`](https://github.com/ollama/ollama/commit/99596f0f21e6c847589de15142956d1b8f8cf513) merge conflicts ### 📊 Changes **3 files changed** (+184 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `openai/openai.go` (+111 -0) 📝 `openai/openai_test.go` (+72 -0) 📝 `server/routes.go` (+1 -0) </details> ### 📄 Description In anticipation of #5127 Resolves #2416 ``` curl http://localhost:11434/v1/embeddings \ -H "Content-Type: application/json" \ -d '{ "input": ["hello", "hi"], "model": "all-minilm" }' ``` ``` { "object": "list", "data": [ { "object": "embedding", "embedding": [ ... ], "index": 0 }, { "object": "embedding", "embedding": [ ... ], "index": 1 } ], "model": "all-minilm" } ``` --- <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-29 13:18:32 -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#58428