Elastic
Jina AI
Models
API
keyboard_arrow_down
Reader
Convert any URL to Markdown for better grounding LLMs.
Embeddings
Multimodal multilingual embeddings.
Reranker
Reranker for maximizing search relevancy.
Elastic Inference Service
Run Jina models natively inside Elasticsearch.
MCP
terminal
CLI
article
llms.txt
smart_toy
Agents
data_object
Schema
menu_book
Docs
Log in
login
warning
This model is deprecated by newer models.
Embeddings
Apache 2.0 License
open_in_new Release Post

jina-embeddings-v2-base-code

Optimized for code and docstring search
License
Apache-2.0
Release Date
calendar_month
2024-02-05
Input
abc
Text (Code)
arrow_forward
Output
more_horiz
Vector
Late Chunking help_outline
check_circle
Yes
Model Details
Parameters: 137M
Input Token Length: 8K
Output Dimension: 768
Base Model help_outline
open_in_new
jina-embeddings-v2-base-en
Trained Languages help_outline
1 languages
Related Models
link
jina-embeddings-v2-base-en
Available via
Jina API
AWS SageMaker
Microsoft Azure
Hugging Face
Air-gapped
I/O graph

Code

jina-embeddings-v2-base-code

Task

Vector

Value distributionhelp_outline
AUC 0.8156
Corpus
Translation pairs
Doc retrieval
Code
0.7500.000.200.400.600.80
Related10.9%
Hard negative1.5%
Unrelated1.0%
Hover or click the chart to move the cutoff
Recommended cutoffs
FPR 0.1 · 0.579
FPR 0.01 · 0.750
FPR 0.001 · 0.806
FPR 0.0001 · 0.839
balanced · 0.369
AUC
0.8156
Noise ceiling
0.805
Recall cliff
0.204
Pairs measured
119 / 11k
Vector componentshelp_outline
-0.160.040.25
σ 0.0361 · 183k values
Embedding geometryhelp_outline
0768
Per-dimension mean, hover for a range
Noise floor
0.404
Effective dims
43 / 768
Choose models to compare

Overview

Jina Embeddings v2 Base Code tackles a critical challenge in modern software development: efficiently navigating and understanding large codebases. For development teams struggling with code discovery and documentation, this model transforms how developers interact with code by enabling natural language search across 30 programming languages. Unlike traditional code search tools that rely on exact pattern matching, this model understands the semantic meaning behind code, allowing developers to find relevant code snippets using plain English descriptions. This capability is particularly valuable for teams maintaining large legacy codebases, developers onboarding to new projects, or organizations looking to improve code reuse and documentation practices.

Methods

The model achieves its impressive performance through a specialized architecture designed specifically for code understanding. At its core, it uses a transformer-based neural network with 161 million parameters, trained on diverse programming language datasets with emphasis on six major languages: Python, JavaScript, Java, PHP, Go, and Ruby. What makes this architecture unique is its extended context window of 8,192 tokens, allowing it to process entire functions or multiple files at once while maintaining semantic understanding. The model generates dense 768-dimensional embeddings that capture both the syntactic structure and semantic meaning of code, enabling it to understand relationships between different code segments even when they use different programming patterns or syntax to achieve the same goal.

Performance

In real-world testing, Jina Embeddings v2 Base Code demonstrates exceptional capabilities, leading the field in nine out of fifteen crucial CodeNetSearch benchmarks. When compared to models from industry giants like Microsoft and Salesforce, it achieves superior performance while maintaining a more efficient footprint. The model particularly excels in cross-language code understanding, successfully matching functionally equivalent code snippets across different programming languages. Its 8,192 token context window proves particularly valuable for large functions and complex code files, significantly outperforming traditional models that typically handle only a few hundred tokens. The model's efficiency is evident in its compact size of 307MB (unquantized), enabling fast inference while maintaining high accuracy in code similarity and search tasks.

Best Practice

To effectively deploy Jina Embeddings v2 Base Code, teams should consider several practical aspects. The model integrates seamlessly with popular vector databases like MongoDB, Qdrant, and Weaviate, making it easy to build scalable code search systems. For optimal performance, implement proper code preprocessing to handle the 8,192 token limit, which typically accommodates most function and class definitions. While the model supports 30 programming languages, it shows strongest performance in the six core languages: Python, JavaScript, Java, PHP, Go, and Ruby. Teams should consider using batch processing for large-scale code indexing to optimize performance. The model's RAG compatibility makes it particularly effective for automated documentation generation and code understanding tasks, though teams should implement appropriate chunking strategies for very large codebases. For production deployments, consider using the AWS SageMaker endpoint for managed inference, and implement appropriate caching strategies to optimize query performance.
Blogs that mention this model
September 04, 2025 • 6 minutes read
Jina Code Embeddings: SOTA Code Retrieval at 0.5B and 1.5B
Code generation LLMs → code embeddings: 0.5B/1.5B models achieve SOTA performance across 25 code retrieval benchmarks.
Jina AI
Green "Code Embeddings" text displayed in a LED dot style on a black background, evoking a futuristic and technological atmos
March 17, 2024 • 5 minutes read
How to Build Article Recommendations with Jina Reranker API Only
You can build an article recommendation system with just the Jina Reranker API—no pipeline, no embeddings, no vector search, only reranking. Find out how in 20 lines of code.
Engineering Group
Black background with a grid, multiple smiley faces, and a cursor pointing to one of them.
March 04, 2024 • 13 minutes read
Build a RAG system with Jina Embeddings and Qdrant
Create a RAG system with Jina Embeddings v2, Qdrant vector database, LlamaIndex, and Mistral LLM.
Scott Martens
Promotional graphic with "EMBEDDINGS 2" and Drant logo separated by a red cross, symbolizing a partnership.
January 29, 2024 • 1 minutes read
MyScale & Jina AI: Unleashing Great Potential for Your AI Applications
With full integration of Jina Embeddings v2 models, MyScale allows users to harness the capabilities of Jina AI within an SQL database.
Scott Martens
Contrastive black and white design with the text "EMBEDDINGS 2 MYSCALE" centered, creating an artistic academic vibe.
February 05, 2024 • 4 minutes read
Elevate Your Code Search with New Jina Code Embeddings
New 𝗷𝗶𝗻𝗮-𝗲𝗺𝗯𝗲𝗱𝗱𝗶𝗻𝗴𝘀-𝘃𝟮-𝗯𝗮𝘀𝗲-𝗰𝗼𝗱𝗲 is optimized for code & docstring search. This powerful model supports searches between English and 30 widely-used programming languages, all with 8192 context length and SOTA performance.
Jina AI
Abstract image with concentric circles in purple and green, featuring "jina" logo and repeated "code embeddings" text around
Current language / theme
Search Foundation
Reader
Embeddings
Reranker
Get Jina API key
Rate Limit
About us
News
Download Jina logo
open_in_new
Download Elastic logo
open_in_new
API Status
Elastic © 2026.SecurityTerms & ConditionsPrivacyManage CookiesDo Not Sell or Share My Personal Information
This website and all associated content, software, products, and services are intended for professional use only. No consumer use is intended or directed.