[PR #759] [MERGED] deprecate modelfile embed command #36189

Closed
opened 2026-04-22 20:53:42 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/759
Author: @BruceMacD
Created: 10/11/2023
Status: Merged
Merged: 10/16/2023
Merged by: @BruceMacD

Base: mainHead: brucemacd/deprecate-modelfile-embed


📝 Commits (2)

📊 Changes

9 files changed (+19 additions, -301 deletions)

View changed files

📝 cmd/cmd.go (+6 -12)
📝 docs/modelfile.md (+0 -12)
📝 go.mod (+0 -1)
📝 go.sum (+0 -2)
📝 parser/parser.go (+3 -1)
📝 server/images.go (+5 -176)
📝 server/images_test.go (+1 -1)
📝 server/routes.go (+4 -27)
vector/store.go (+0 -69)

📄 Description

Embeddings in Modelfiles are a convenient idea, allowing the model to be packaged with embeddings created for it specifically, but the user-experience of this implementation isn't up to par.

This change leaves the /embed endpoint, but deprecates EMBED in the modelfile.

  • Ollama doesn't have any models designed for embedding generation
  • Generating embeddings from modelfile is slow, error prone, and only supports single line text inputs
  • Retrieving embeddings was too slow to be useful, and there was no mechanism to connect an external vector database

Instead of using the Modelfile the right way to do this is with an external tool such as PrivateGPT or LlamaIndex that uses Ollama as the runner.

New behavior:
On create a modelfile with the embed command:

$ ollama create embed-test -f /Users/bruce/modelfiles/embedded/Modelfile
⠋ parsing modelfile  Error: deprecated command: EMBED

On running a modelfile with the embed command:

2023/10/11 15:46:52 images.go:190: WARNING: model contains embeddings, but embeddings in modelfiles have been deprecated and will be ignored.

On running a modelfile with the embed in the template:

$ ollama run embed-test
⠦   Error: template: :5:7: executing "" at <.Embed>: can't evaluate field Embed in type struct { First bool; System string; Prompt string; Context []int }

🔄 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/759 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 10/11/2023 **Status:** ✅ Merged **Merged:** 10/16/2023 **Merged by:** [@BruceMacD](https://github.com/BruceMacD) **Base:** `main` ← **Head:** `brucemacd/deprecate-modelfile-embed` --- ### 📝 Commits (2) - [`dfb7778`](https://github.com/ollama/ollama/commit/dfb777891686d4936b55c8254001631c65284a7b) deprecate modelfile embed - [`7967f2d`](https://github.com/ollama/ollama/commit/7967f2d1d7ca51a71a58f831a59e94ac0a6b7764) PR feedback ### 📊 Changes **9 files changed** (+19 additions, -301 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+6 -12) 📝 `docs/modelfile.md` (+0 -12) 📝 `go.mod` (+0 -1) 📝 `go.sum` (+0 -2) 📝 `parser/parser.go` (+3 -1) 📝 `server/images.go` (+5 -176) 📝 `server/images_test.go` (+1 -1) 📝 `server/routes.go` (+4 -27) ➖ `vector/store.go` (+0 -69) </details> ### 📄 Description Embeddings in Modelfiles are a convenient idea, allowing the model to be packaged with embeddings created for it specifically, but the user-experience of this implementation isn't up to par. This change leaves the `/embed` endpoint, but deprecates `EMBED` in the modelfile. - Ollama doesn't have any models designed for embedding generation - Generating embeddings from modelfile is slow, error prone, and only supports single line text inputs - Retrieving embeddings was too slow to be useful, and there was no mechanism to connect an external vector database Instead of using the Modelfile the right way to do this is with an external tool such as PrivateGPT or LlamaIndex that uses Ollama as the runner. New behavior: On create a modelfile with the embed command: ``` $ ollama create embed-test -f /Users/bruce/modelfiles/embedded/Modelfile ⠋ parsing modelfile Error: deprecated command: EMBED ``` On running a modelfile with the embed command: ``` 2023/10/11 15:46:52 images.go:190: WARNING: model contains embeddings, but embeddings in modelfiles have been deprecated and will be ignored. ``` On running a modelfile with the embed in the template: ``` $ ollama run embed-test ⠦ Error: template: :5:7: executing "" at <.Embed>: can't evaluate field Embed in type struct { First bool; System string; Prompt string; Context []int } ``` --- <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-22 20:53:42 -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#36189