[PR #288] [MERGED] embed text document in modelfile #35952

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

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/288
Author: @BruceMacD
Created: 8/4/2023
Status: Merged
Merged: 8/9/2023
Merged by: @BruceMacD

Base: mainHead: brucemacd/embedding


📝 Commits (5)

📊 Changes

10 files changed (+371 additions, -52 deletions)

View changed files

📝 api/types.go (+1 -0)
📝 cmd/cmd.go (+12 -6)
📝 docs/modelfile.md (+11 -1)
📝 go.mod (+1 -0)
📝 go.sum (+2 -0)
📝 llama/llama.go (+37 -0)
📝 parser/parser.go (+1 -1)
📝 server/images.go (+212 -41)
📝 server/routes.go (+25 -3)
vector/store.go (+69 -0)

📄 Description

Allow embedding information into Modelfiles. This is an initial version that only supports embedding text files, other file types to follow.

FROM llama2
EMBED /path/to/doc.txt
TEMPLATE """
Context:
{{ .Embed }}
User:
{{ .User }}
"""

TODO before merge:

  • Test library FROM image (local and pull)
  • Test FROM local bin file
  • Update docs

Resolves #237


🔄 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/288 **Author:** [@BruceMacD](https://github.com/BruceMacD) **Created:** 8/4/2023 **Status:** ✅ Merged **Merged:** 8/9/2023 **Merged by:** [@BruceMacD](https://github.com/BruceMacD) **Base:** `main` ← **Head:** `brucemacd/embedding` --- ### 📝 Commits (5) - [`a6f6d18`](https://github.com/ollama/ollama/commit/a6f6d18f83408a8d06c77f07bc51f734e866e990) embed text document in modelfile - [`21ddcaa`](https://github.com/ollama/ollama/commit/21ddcaa1f1912a443858a244a8c9fe9de3cff755) pr comments - [`3ceac05`](https://github.com/ollama/ollama/commit/3ceac05108fec492b8957370677f06de4dffea64) Add embedding docs - [`884d78c`](https://github.com/ollama/ollama/commit/884d78ceb3f0b6a3867186460d23015cdca7fab4) allow embedding from model binary - [`1bee234`](https://github.com/ollama/ollama/commit/1bee2347bedb0ea43d15ffc42b481cb9a4804aea) pr feedback ### 📊 Changes **10 files changed** (+371 additions, -52 deletions) <details> <summary>View changed files</summary> 📝 `api/types.go` (+1 -0) 📝 `cmd/cmd.go` (+12 -6) 📝 `docs/modelfile.md` (+11 -1) 📝 `go.mod` (+1 -0) 📝 `go.sum` (+2 -0) 📝 `llama/llama.go` (+37 -0) 📝 `parser/parser.go` (+1 -1) 📝 `server/images.go` (+212 -41) 📝 `server/routes.go` (+25 -3) ➕ `vector/store.go` (+69 -0) </details> ### 📄 Description Allow embedding information into Modelfiles. This is an initial version that only supports embedding text files, other file types to follow. ``` FROM llama2 EMBED /path/to/doc.txt TEMPLATE """ Context: {{ .Embed }} User: {{ .User }} """ ``` TODO before merge: - [x] Test library `FROM` image (local and pull) - [x] Test `FROM` local bin file - [x] Update docs Resolves #237 --- <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:41:35 -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#35952