Embeddings Ollama Ext
AI-generatedOverview
This node integrates with the Ollama embeddings API to generate vector embeddings from input data. It is designed to be connected to a vector store, enabling workflows that require semantic search, similarity matching, or other AI-driven text embedding tasks.
Common scenarios include:
- Converting text data into embeddings for use in machine learning models.
- Enhancing search functionality by indexing documents with vector representations.
- Performing clustering or classification based on semantic similarity.
For example, you might use this node to embed customer feedback texts and then store these embeddings in a vector database to quickly find similar feedback entries.
Properties
| Name | Meaning |
|---|---|
| This node must be connected to a vector store. Insert one | A notice indicating that this node requires a connection to a vector store node to function properly. |
| Model | The Ollama model used to generate embeddings. Models can be browsed and downloaded from the Ollama Models Library. |
| Options | Additional configuration options for the embedding generation process: - Context Batch Size: Number of items processed per batch; larger batches may speed up processing but use more memory. - Context Length: Maximum tokens considered as context. - Frequency Penalty: Penalizes repeated tokens in output. - Keep Alive: Duration to keep the model loaded in memory after use. - Load Vocabulary Only: Load only vocabulary without weights for quick tokenization tests. - Low VRAM Mode: Reduces memory usage at cost of speed. - Main GPU ID: Select which GPU to use if multiple are available. - Max Tokens to Generate: Limits number of generated tokens. - Number of CPU Threads: Controls CPU thread usage. - Number of GPUs: Controls GPU parallelism. - Output Format: Choose between default or JSON response format. - Penalize Newlines: Discourages generating newline characters. - Presence Penalty: Penalizes tokens already present to encourage diversity. - Repetition Penalty: Adjusts penalty for repeated tokens. - Sampling Temperature: Controls randomness of output. - Top K: Limits highest probability tokens considered. - Top P: Limits cumulative probability mass of tokens. - Use Memory Locking: Locks model in memory to prevent swapping. - Use Memory Mapping: Uses memory mapping to reduce memory usage. |
Output
The node outputs an ai_embedding type containing the generated embeddings in its JSON output field. This typically includes the vector representation of the input data as produced by the selected Ollama model.
No binary data output is indicated.
Dependencies
- Requires an active connection to an Ollama API endpoint, authenticated via an API key credential.
- Must be connected to a compatible vector store node within n8n to store or further process the generated embeddings.
- The node depends on the
@langchain/ollamapackage for interfacing with the Ollama embeddings service. - Proper configuration of the Ollama API base URL and credentials is necessary.
Troubleshooting
- Connection Issues: If the node cannot connect to the Ollama API, verify that the API base URL and authentication credentials are correctly configured.
- Model Not Found: Selecting a model not available in the Ollama Models Library will cause errors. Ensure the model name matches one from the library.
- Memory Errors: Using large batch sizes or context lengths may cause out-of-memory errors, especially on limited hardware. Reduce these values or enable low VRAM mode.
- Performance Issues: If generation is slow, consider adjusting GPU and CPU thread settings or enabling memory locking.
- Invalid Option Values: Providing invalid values (e.g., negative numbers where not allowed) in options may cause failures. Use the provided defaults or valid ranges.