Ollama embeddings convert text into numeric vectors for search, retrieval, clustering, and RAG indexing. The endpoint is separate from chat generation because the model must support embedding output rather than conversational completion.
The api/embed request accepts one string or an array of strings and returns an embeddings array. Use the same embedding model for indexing and querying so vector lengths and semantics stay compatible.
The campaign validated the flow with all-minilm:latest after a worker pulled that small model. Remove or replace the model after validation if the host should not keep extra embedding models.
Related: How to pull an Ollama model
Related: How to generate embeddings with Ollama
Related: How to check the Ollama API server
$ ollama pull all-minilm success
Official Ollama docs also list embeddinggemma and qwen3-embedding as embedding model options.
$ curl -s http://localhost:11434/api/embed -d '{ "model": "all-minilm:latest", "input": "Ollama embeddings test" }' {"model":"all-minilm:latest","embeddings":[[-0.016053036,-0.017273553,0.01791495,##### snipped #####]],"total_duration":62996750}
The response is intentionally trimmed because embedding vectors are long.
$ curl -s http://localhost:11434/api/embed -d '{ "model": "all-minilm:latest", "input": ["first document", "second document"] }' {"model":"all-minilm:latest","embeddings":[[##### snipped #####],[##### snipped #####]]}
$ python3 - <<'PY' import json payload = {"embeddings": [[0.1, 0.2], [0.3, 0.4]]} print(len(payload["embeddings"])) PY 2
Use the application language's JSON parser rather than string matching the response.
$ curl -s http://localhost:11434/api/embed -d '{"model":"gpt-oss:20b","input":"test"}' {"error":"This server does not support embeddings. Start it with `--embeddings`"}
Switch to an embedding-capable model before debugging vector database code.