The Ollama CLI can generate embeddings directly from a prompt or piped text when the selected model is built for embeddings. This is the fastest way to test vector output before wiring the same model into an API or database workflow.
Embedding output is a JSON array rather than prose. The vector length depends on the model, so the same model should be used for both indexing documents and embedding search queries.
The local campaign validated embeddings with all-minilm:latest after it appeared in the model store during worker validation. Replace it with embeddinggemma or another current embedding model when that is the standard for the project.
Related: How to generate embeddings with the Ollama API
Related: How to pull an Ollama model
Related: How to list Ollama models
$ ollama pull all-minilm success
$ ollama run all-minilm "Hello world" [-0.034513,0.018204,0.012447,##### snipped #####]
Embedding vectors are long; trim only the displayed sample, not the real application value.
$ printf '%s\n' 'The quick brown fox jumps over the lazy dog.' | ollama run all-minilm [-0.012401,0.041902,##### snipped #####]
$ curl -s http://localhost:11434/api/embed -d '{"model":"all-minilm:latest","input":"Hello world"}' {"model":"all-minilm:latest","embeddings":[[##### snipped #####]]}
$ ollama list
NAME ID SIZE MODIFIED
all-minilm:latest 1b226e2802db 25 MB just now