Generate Embeddings in Ollama

From the Ollama cheat sheet · Embeddings · verified Jul 2026

Generate Embeddings

Use the /api/embed endpoint to create text embeddings for RAG and similarity search.

bash
# Generate embeddings for a single text
curl http://localhost:11434/api/embed -d '{
  "model": "all-minilm",
  "input": "Ollama is great for local AI"
}'
💡 Use /api/embed (not /api/embeddings) for the latest API with batch support
⚡ all-minilm is fast and lightweight (23MB) — great for getting started
📌 Embeddings are used for RAG, semantic search, and similarity comparisons
🟢 Batch multiple inputs in a single request for better performance
embeddingsapirag
Back to the full Ollama cheat sheet