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.3.tar.gz (13.5 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.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: langchain_voyageai-0.3.3.tar.gz
  • Upload date:
  • Size: 13.5 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.3.tar.gz
Algorithm Hash digest
SHA256 616eac5e1e58ce6caf8d4f2a3bd5fbf599e56080bea2b14fe019a253901e7e15
MD5 b8d75b300e5fbb53fd65b322641f084d
BLAKE2b-256 165437a974bebea48851c0ec0a9599c40cf18acaef9c9f767e114fdf3e39f570

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for langchain_voyageai-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c3a66376e2dd4d9c5aebc9041290caa8176e80f83bdb206f820b2452d4efbe89
MD5 b2f90e700e7161baa42584ffb69040f5
BLAKE2b-256 afb0cf106a69b61113b1fb4eaab1bee69278de21ee6cb1c461de5e66697fbc9f

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