createVoyage() that uses the VOYAGE_API_KEY environment variable.
Import
Provider methods
The Voyage provider supports multiple methods for creating different model types:textEmbeddingModel()
Creates a text embedding model for generating embeddings from text inputs.The ID of the text embedding model to use. Supported models include:
voyage-3.5- Latest flagship modelvoyage-3.5-lite- Lighter version of 3.5voyage-3-large- Large context modelvoyage-3- Standard modelvoyage-3-lite- Lightweight modelvoyage-code-3- Code embeddingsvoyage-finance-2- Finance domainvoyage-multilingual-2- Multilingual supportvoyage-law-2- Legal domainvoyage-code-2- Code embeddings (older)- Or any custom model ID string
EmbeddingModelV3 - A text embedding model instance
Example
imageEmbeddingModel()
Creates an image embedding model for generating embeddings from image inputs.The ID of the multimodal embedding model to use. Supported models:
voyage-multimodal-3- Multimodal model for images- Or any custom model ID string
EmbeddingModelV3 - An image embedding model instance
Example
multimodalEmbeddingModel()
Creates a multimodal embedding model for generating embeddings from combined text and image inputs.The ID of the multimodal embedding model to use. Supported models:
voyage-multimodal-3- Multimodal model for text and images- Or any custom model ID string
EmbeddingModelV3 - A multimodal embedding model instance
Example
reranking()
Creates a reranking model for reordering documents based on relevance to a query.The ID of the reranking model to use. Supported models:
rerank-2.5- Latest reranking modelrerank-2.5-lite- Lighter version of 2.5rerank-2- Standard reranking modelrerank-lite-2- Lightweight version of 2rerank-1- First generation modelrerank-lite-1- Lightweight version of 1- Or any custom model ID string
RerankingModelV3 - A reranking model instance
Example
rerankingModel()
Alias forreranking(). Creates a reranking model with identical functionality.
The ID of the reranking model to use.
RerankingModelV3 - A reranking model instance
Calling as a function
The provider instance can be called directly as a function, which is equivalent to callingtextEmbeddingModel().