embeddings: added embedding command for cl (#12795)

Co-authored-by: A-Akhil <akhilrahul70@gmail.com>

This PR introduces a new ollama embed command that allows users to generate embeddings directly from the command line.

Added ollama embed MODEL [TEXT...] command for generating text embeddings
Supports both direct text arguments and stdin piping for scripted workflows

Outputs embeddings as JSON arrays (one per line)
This commit is contained in:
nicole pardal
2025-11-05 11:58:03 -08:00
committed by GitHub
parent 6aa7283076
commit 1ca608bcd1
4 changed files with 416 additions and 1 deletions

View File

@@ -25,6 +25,18 @@ I'm a basic program that prints the famous "Hello, world!" message to the consol
ollama run gemma3 "What's in this image? /Users/jmorgan/Desktop/smile.png"
```
### Generate embeddings
```
ollama run embeddinggemma "Hello world"
```
Output is a JSON array:
```
echo "Hello world" | ollama run nomic-embed-text
```
### Download a model
```