Skip to main content

An integration package connecting VoyageAI and LangChain

Project description

langchain-voyageai

This package contains the LangChain integrations for VoyageAI through their voyageai client package.

Installation and Setup

  • Install the LangChain partner package
pip install langchain-voyageai
  • Get an VoyageAI api key and set it as an environment variable (VOYAGE_API_KEY) or use the API key as a parameter in the Client.

Text Embedding Model

See a usage example

from langchain_voyageai import VoyageAIEmbeddings

Voyage-4 Family Models

The latest generation of VoyageAI embedding models with improved quality and flexibility:

# voyage-4: Balanced model for general-purpose and multilingual retrieval
embeddings = VoyageAIEmbeddings(model="voyage-4")

# voyage-4-lite: Optimized for latency and cost, highest batch throughput (1M tokens/batch)
embeddings = VoyageAIEmbeddings(model="voyage-4-lite")

# voyage-4-large: Best retrieval quality for demanding applications
embeddings = VoyageAIEmbeddings(model="voyage-4-large")

All voyage-4 family models support flexible output dimensions (256, 512, 1024, 2048):

embeddings = VoyageAIEmbeddings(
    model="voyage-4",
    output_dimension=512  # Choose from: 256, 512, 1024, 2048
)

Custom API Endpoint

You can specify a custom API endpoint using the base_url parameter:

embeddings = VoyageAIEmbeddings(
    model="voyage-3.5",
    base_url="https://ai.mongodb.com/v1"
)

This is useful for MongoDB Atlas users or custom deployments.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_voyageai-0.3.2.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_voyageai-0.3.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file langchain_voyageai-0.3.2.tar.gz.

File metadata

  • Download URL: langchain_voyageai-0.3.2.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for langchain_voyageai-0.3.2.tar.gz
Algorithm Hash digest
SHA256 a7c25df7c7b33d57458c6c9b110383c43cc7a52c83435a9b1bfa280ab9e73b52
MD5 4369afb4342d9f9e6e417cac6eb28e16
BLAKE2b-256 5e9e328972ddd0530cd1b80602bc0cb3563f788d69cdb4bbd5c8c5d2d319a121

See more details on using hashes here.

File details

Details for the file langchain_voyageai-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_voyageai-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6a6f59a2a695b032af8bad152c44ba521b78cdefc0384222b30d1dceb0e4c2bc
MD5 3194e8077d7fd0a280542bee4f2dce23
BLAKE2b-256 49306ab94ce7e3ae37a04f8173ccb7f0826638a188e45dea0ca9a83184814bc6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page