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

@@ -226,6 +226,18 @@ ollama ps
ollama stop llama3.2
```
### Generate embeddings from the CLI
```shell
ollama run embeddinggemma "Your text to embed"
```
You can also pipe text for scripted workflows:
```shell
echo "Your text to embed" | ollama run embeddinggemma
```
### Start Ollama
`ollama serve` is used when you want to start ollama without running the desktop application.