[GH-ISSUE #6295] Ability to preload embedding model #3945

Closed
opened 2026-04-12 14:49:27 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @comunidadio on GitHub (Aug 10, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6295

Originally assigned to: @royjhan on GitHub.

The "empty request" trick to preload a model does not currently work for embedding models.

Source: https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-preload-a-model-into-ollama-to-get-faster-response-times and #2431

$ curl http://localhost:11434/api/embed -d '{"model": "all-minilm:latest"}'
{"error":"invalid input type"}%       
ollama --version
ollama version is 0.3.4
Originally created by @comunidadio on GitHub (Aug 10, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6295 Originally assigned to: @royjhan on GitHub. The "empty request" trick to preload a model does not currently work for embedding models. Source: https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-preload-a-model-into-ollama-to-get-faster-response-times and #2431 ``` $ curl http://localhost:11434/api/embed -d '{"model": "all-minilm:latest"}' {"error":"invalid input type"}% ``` ``` ollama --version ollama version is 0.3.4 ```
GiteaMirror added the feature request label 2026-04-12 14:49:27 -05:00
Author
Owner

@comunidadio commented on GitHub (Aug 10, 2024):

Can workaround for now using deprecated /embeddings endpoint:

$ curl http://localhost:11434/api/embeddings -d '{"model": "all-minilm:latest"}'
{"embedding":[]}%

Also looks like ollama-js typings need to be updated for this, input/prompt is required for both .embed and .embeddings methods.

<!-- gh-comment-id:2278931051 --> @comunidadio commented on GitHub (Aug 10, 2024): Can workaround for now using deprecated /embeddings endpoint: ``` $ curl http://localhost:11434/api/embeddings -d '{"model": "all-minilm:latest"}' {"embedding":[]}% ``` Also looks like ollama-js typings need to be updated for this, input/prompt is required for both .embed and .embeddings methods.
Author
Owner

@PaulCapestany commented on GitHub (Aug 12, 2024):

I just send a throwaway request with infinite keep_alive, like so:

curl http://localhost:11434/api/embed -d "{\"input\": \"whatever\", \"model\": \"bge-m3\", \"keep_alive\": -1}"
<!-- gh-comment-id:2284580920 --> @PaulCapestany commented on GitHub (Aug 12, 2024): I just send a throwaway request with infinite `keep_alive`, like so: ```sh curl http://localhost:11434/api/embed -d "{\"input\": \"whatever\", \"model\": \"bge-m3\", \"keep_alive\": -1}" ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#3945