Overview
Text embedding models are neural networks that transform texts into numerical vectors. They are a foundational building block for semantic search/retrieval systems and retrieval-augmented generation (RAG) and directly determine retrieval quality.
voyage-code-4 is the next generation of Voyage AI's code embedding model, purpose-built to improve performance and reduce cost for coding agents. Coding agents now issue many of the code retrieval queries served in production: they explore, backtrack, and re-query across multiple steps, often starting from a goal as vague as a bug report rather than a known identifier. Most agents rely entirely on full-text search (grep), which works well when the agent already knows the symbol it is looking for, but returns no useful hits when the query describes a symptom rather than syntax. Semantic retrieval with voyage-code-4 complements full-text search and significantly reduces wasted token usage.
voyage-code-4 is trained on an entirely new corpus mined from completed, issue-fixing pull requests spanning tens of thousands of repositories and hundreds of programming languages - substantially larger than the corpus used for voyage-code-3. Conventional code embedding corpora pair source files with docstrings, comments, or synthetic questions, which teach a model what code says. They do not teach a model what code does wrong, which is the context an agent needs when it starts from a bug report.
voyage-code-4 outperforms Cohere Embed v4 and Gemini Embedding 2 by an average of 28.25% and 31.03% on agentic code retrieval, a new benchmark suite of 19 datasets built from issue-fixing pull requests, and by 19.21% and 16.01% across the 28 code retrieval datasets used to evaluate voyage-code-3. It surpasses voyage-code-3 itself by 27.54% and 13.98% on those two suites respectively, and OpenAI v3 large by 48.58% and 40.06%. Enabled by Matryoshka representation learning and quantization-aware training, voyage-code-4 supports embeddings in 2048, 1024, 512, and 256 dimensions, with multiple quantization options.
Learn more about voyage-code-4 here: https://blog.voyageai.com/2026/07/30/voyage-code-4/
Highlights
- Code embedding model purpose-built for coding agents, trained on a new corpus mined from issue-fixing pull requests across tens of thousands of repositories and hundreds of programming languages - so it can locate the code that needs to change given only a symptom.
- Outperforms Cohere Embed v4 and Gemini Embedding 2 by an average of 28.25% and 31.03% on agentic code retrieval, and by 19.21% and 16.01% across the 28 code retrieval datasets used to evaluate voyage-code-3.
- Supports embeddings of 2048, 1024, 512, and 256 dimensions and offers multiple embedding quantization, including float (32-bit floating point), int8 (8-bit signed integer), uint8 (8-bit unsigned integer), binary (bit-packed int8), and ubinary (bit-packed uint8).
Details
Introducing multi-product solutions
You can now purchase comprehensive solutions tailored to use cases and industries.
Features and programs
Financing for AWS Marketplace purchases
Pricing
Free trial
Dimension | Description | Cost/host/hour |
|---|---|---|
ml.g6.xlarge Inference (Real-Time) Recommended | Model inference on the ml.g6.xlarge instance type, real-time mode | $2.25 |
ml.g6.2xlarge Inference (Batch) Recommended | Model inference on the ml.g6.2xlarge instance type, batch mode | $2.44 |
ml.g5.xlarge Inference (Real-Time) | Model inference on the ml.g5.xlarge instance type, real-time mode | $2.82 |
ml.g5.2xlarge Inference (Real-Time) | Model inference on the ml.g5.2xlarge instance type, real-time mode | $3.03 |
ml.g5.4xlarge Inference (Real-Time) | Model inference on the ml.g5.4xlarge instance type, real-time mode | $4.06 |
ml.g5.8xlarge Inference (Real-Time) | Model inference on the ml.g5.8xlarge instance type, real-time mode | $6.12 |
ml.g6.2xlarge Inference (Real-Time) | Model inference on the ml.g6.2xlarge instance type, real-time mode | $2.44 |
ml.g6.4xlarge Inference (Real-Time) | Model inference on the ml.g6.4xlarge instance type, real-time mode | $3.31 |
ml.g6.8xlarge Inference (Real-Time) | Model inference on the ml.g6.8xlarge instance type, real-time mode | $5.04 |
ml.g7e.2xlarge Inference (Real-Time) | Model inference on the ml.g7e.2xlarge instance type, real-time mode | $4.49 |
Vendor refund policy
Refunds are processed according to the EULA. For assistance, contact aws-marketplace@mongodb.com
How can we make this page better?
Legal
Vendor terms and conditions
Content disclaimer
Delivery details
Amazon SageMaker model
An Amazon SageMaker model package is a pre-trained machine learning model ready to use without additional training. Use the model package to create a model on Amazon SageMaker for real-time inference or batch processing. Amazon SageMaker is a fully managed platform for building, training, and deploying machine learning models at scale.
Version release notes
MongoDB is excited to announce the initial release of voyage-code-4, a code embedding model purpose-built for coding agents, delivering state-of-the-art agentic code retrieval quality at a third below the price of voyage-code-3.
Additional details
Inputs
- Summary
Supply one or more texts to vectorise, with optional input type, truncation, dimension, and dtype controls.
- Limitations for input type
- Max 1,000 strings per request; max 32,000 total tokens.
- Input MIME type
- application/json
Input data descriptions
The following table describes supported input data fields for real-time inference and batch transform.
Field name | Description | Constraints | Required |
|---|---|---|---|
input | A single string or a list of strings to embed. | Maximum 1,000 items. | Yes |
input_type | The role of the input: query, document, or null. | Default: null | No |
truncation | Whether to truncate inputs to fit context limits. | Default: true | No |
output_dimension | Number of dimensions for the output embeddings. Supported values: 2048, 1024, 512, 256. | Default: null | No |
output_dtype | Data type for the output embeddings. | Default: float. Options: float, int8, uint8, binary, ubinary | No |
encoding_format | Format in which the embeddings are encoded. | Default: null. Options: base64 | No |
id | Batch transform request ID; returned in the output if specified. | Default: null | No |
Resources
Vendor resources
Support
Vendor support
Please email us at aws-marketplace@mongodb.com for inquiries and customer support.
AWS infrastructure support
AWS Support is a one-on-one, fast-response support channel that is staffed 24x7x365 with experienced and technical support engineers. The service helps customers of all sizes and technical abilities to successfully utilize the products and features provided by Amazon Web Services.