Skip to content

Voyage Code 3

Voyage Code 3 is Voyage AI's code-specialized embedding model with a context window of 0 tokens, 300+ programming language support, and Matryoshka dimensionality. It outperforms OpenAI text-embedding-3-large by 13.80% on code retrieval across 32 datasets.

index.ts
import { embed } from 'ai';
const result = await embed({
model: 'voyage/voyage-code-3',
value: 'Sunny day at the beach',
})

Frequently Asked Questions

  • How many programming languages does Voyage Code 3 support?

    Over 300 programming languages. That is the widest language coverage in Voyage AI's code embedding lineup, suitable for polyglot repositories and enterprise codebases.

  • How does Voyage Code 3 compare to voyage-code-2?

    Voyage Code 3 doubles the context window (32K vs. 16K), adds Matryoshka dimensionality (2048/1024/512/256), expands language coverage from a few languages to 300+, and adds quantization-aware training. It is the recommended choice for new code search deployments.

  • What is the storage savings with binary embeddings?

    Binary embeddings at 256 dimensions use 1/384th the storage of 3072-dimensional float embeddings while still outperforming OpenAI text-embedding-3-large by 4.81%. This makes it feasible to index very large codebases efficiently.

  • How does dimension reduction quality compare to OpenAI?

    At 1024 dimensions, Voyage Code 3 retains 92.28% of its full-precision quality, compared to 77.64% for OpenAI text-embedding-3-large. This means dimension reduction is significantly more effective with Voyage Code 3.

  • What training data does Voyage Code 3 use?

    Voyage AI trained Voyage Code 3 on trillions of tokens combining text, code, and mathematical content, supplemented with real-world query-code pairs from GitHub repositories for practical retrieval relevance.

  • How do I access Voyage Code 3 through Vercel AI Gateway?

    Add your Voyage AI API key in AI Gateway settings, then send embedding requests through AI Gateway. You can point the same client code at different provider models; AI Gateway authenticates requests and records usage.

  • Can Voyage Code 3 handle text-to-code and code-to-code retrieval?

    Yes. Voyage Code 3 is evaluated on both text-to-code retrieval (natural language queries finding relevant code) and code-to-code retrieval (finding similar implementations). Both are core strengths of the model.