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.
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).
AWS Marketplace now accepts line of credit payments through the PNC Vendor Finance program. This program is available to select AWS customers in the US, excluding NV, NC, ND, TN, & VT.
You pay an hourly rate per running instance for the voyage-code-4 embedding model. All dimensions bill by host hour, so cost scales with the number and size of instances you run and how long they stay active. Seventeen options cover real-time inference across g5, g6, g7e, p4d, p4de, and p5 instance families, with sizes from xlarge up to 48xlarge. Larger instances carry higher hourly rates. One option covers batch inference on the ml.g6.2xlarge instance for bulk dataset processing. Your total hourly cost combines software pricing for model usage with the underlying AWS infrastructure charge.
Top-of-mind questions for buyers
What am I charged for on the hourly host-hour rate?
You pay per running instance hour. The rate combines software pricing for model usage plus the underlying AWS infrastructure charge for the instance. Both accrue for each hour the endpoint or job runs. A single running endpoint on one instance counts as one billable host each hour it stays active.
Am I still charged after I cancel my subscription or stop using the model?
Canceling your subscription does not stop existing charges. Running real-time endpoints and batch jobs keep accruing host-hour costs until you delete them. You should delete endpoints through SageMaker when finished. Idle endpoints left running continue to incur software and infrastructure charges.
How does the real-time inference option differ from the batch inference option?
Real-time endpoints run persistent, managed APIs for request-by-request inference, billing every hour they stay live. The batch option runs finite jobs for bulk processing across a dataset, writing results to a file. Real-time suits continuous serving; batch suits one-time bulk embedding work.
Tell us how we can improve this page, or report an issue with this product.
Give us feedbackReport a problem with this product or seller
Legal
Vendor terms and conditions
Upon subscribing to this product, you must acknowledge and agree to the terms and conditions outlined in the vendor's End User License Agreement (EULA).
Content disclaimer
Vendors are responsible for their product descriptions and other product content. AWS does not warrant that vendors' product descriptions or other product content are accurate, complete, reliable, current, or error-free.
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.
Deploy the model on Amazon SageMaker AI using the following options:
Real-time inference
Deploy the model as an API endpoint for your applications. When you send data to the endpoint, SageMaker processes it and returns results by API response. The endpoint runs continuously until you delete it. You're billed for software and SageMaker infrastructure costs while the endpoint runs. AWS Marketplace models don't support Amazon SageMaker Asynchronous Inference. For more information, see Deploy models for real-time inference .
Batch transform
Deploy the model to process batches of data stored in Amazon Simple Storage Service (Amazon S3). SageMaker runs the job, processes your data, and returns results to Amazon S3. When complete, SageMaker stops the model. You're billed for software and SageMaker infrastructure costs only during the batch job. Duration depends on your model, instance type, and dataset size. AWS Marketplace models don't support Amazon SageMaker Asynchronous Inference. For more information, see Batch transform for inference with Amazon SageMaker AI .
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
Outputs
Usage instructions
Sample notebooks
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.
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.
Be the first to review this product. We've partnered with PeerSpot to gather customer feedback. You can share your experience by writing or recording a review, or scheduling a call with a PeerSpot analyst.