Ollama Embeddings
AI-generatedSummary
Creates a LangChain embeddings provider that sends text to the configured Ollama API using the selected model. Use it as an AI Embeddings connection for workflows that need document or query vectors.
Inputs
- Model (required) — Select an embedding model listed by the configured Ollama or custom API.
- Performance Mode — GPU mode uses a 30-second timeout and 2 retries; CPU mode uses 120 seconds and 3 retries. Custom mode lets you set the timeout and retry count.
- Custom Timeout (Ms) — In Custom mode, request timeout in milliseconds (default 30,000).
- Max Retries — In Custom mode, maximum retry attempts (default 2).
- Context Prefix — Optional prefix declared for prepending to text; the source does not apply it to API requests.
- Dimensions — Select the vector dimension count; 0 uses a model-family default, and values above the detected model maximum are capped. The source passes this setting to the embeddings provider but does not include it in the Ollama request body.
- Instruction Type — Choose None, Query, or Document. The source passes non-None selections to the provider, but does not add them to the Ollama request body.
Output shape
An AI Embeddings provider object, exposing document and query embedding methods.
It is not a regular item output. For each text, the provider posts to /api/embed with the model and sanitized input, then returns the embedding vector(s). It accepts either an embeddings array or a single embedding array in the API response; failures are retried according to the selected mode, then raised as initialization or API errors.