Voyage AI

Retrieval embeddings and reranking from Voyage.

Both models read VOYAGE_API_KEY and target https://api.voyageai.com/v1.

Embeddings

VoyageEmbeddingModel works with embed and embedMany. Pass inputType: .query or .document to match Voyage's asymmetric retrieval, and outputDimension: for Matryoshka truncation.

let vectors = try await embedMany(
  model: VoyageEmbeddingModel("voyage-3.5", inputType: .document),
  values: documents
)

Requests batch at 128 inputs each and merge automatically.

Reranking

VoyageRerankingModel works with rerank:

let ranked = try await rerank(
  model: VoyageRerankingModel("rerank-2.5"),
  query: "How do I cancel my subscription?",
  documents: documents,
  topN: 3
)
ranked.rankedDocuments.first?.relevanceScore

Models

As of July 2026:

Model IDKind
voyage-3.5 / voyage-3.5-liteGeneral embeddings
voyage-4 / voyage-4-large / voyage-4-lite / voyage-4-nanoEmbeddings
voyage-code-3.5Code embeddings
voyage-finance-2 / voyage-law-2 / voyage-multilingual-2Domain embeddings
rerank-2.5 / rerank-2.5-liteReranking

See Voyage's docs for dimensions and context limits.