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 relevance.
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
jina-bert-v2-base-code
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

Pareto fronthelp_outline
30M100M300M1B3.0B10B40506070bge-base-en-v1.5bge-m3bge-small-en-v1.5CodeRankEmbedCodeSage-baseCodeSage-largeCodeSage-large-v2CodeSage-smallCodeXEmbed-7BContrievere5-base-v2e5-mistral-7b-instructe5-small-v2granite-embedding-engli…granite-embedding-small…gte-base-en-v1.5gte-modernbert-basegte-Qwen2-1.5B-instructjina-code-embeddings-0.…jina-embeddings-v3jina-embeddings-v4modernbert-embed-baseNV-Embed-v2SFR-Embedding-2_RSFR-Embedding-Code-2B_RSFR-Embedding-Code-400M…snowflake-arctic-embed-…UniXcoderParameters (log)nDCG@10
This model
On the front
Jina AI
Other
CoIR
52.24
Parameters
161M
Rank by score
19 / 31
Pareto front
Behind it
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%
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 is a 161M-parameter code embedding model that maps programming code across 30 languages into a shared 768-dimensional semantic space. With an 8,192-token context window, it was the first Jina embedding model to support whole-function and multi-file code retrieval without truncation. It led nine out of fifteen CodeNetSearch benchmarks at release.

Methods

The model uses a transformer-based encoder with 161M parameters, trained on diverse programming language datasets with emphasis on Python, JavaScript, Java, PHP, Go, and Ruby. The 8,192-token context window (via ALiBi positional encodings) enables processing of entire functions and small files in a single forward pass. Training included contrastive pretraining on code-text pairs (natural language descriptions paired with code implementations) followed by supervised fine-tuning on code retrieval datasets with hard-negative mining. The 768-dimensional embeddings capture both syntactic structure and semantic meaning, enabling cross-language code matching where functionally equivalent code in different languages maps to nearby regions of the embedding space.

Performance

At release, the model led nine of fifteen CodeNetSearch benchmarks, outperforming Microsoft and Salesforce code embedding models while maintaining a more efficient 307MB footprint. Its 8,192-token context was 4–16× larger than competing code embedding models, enabling retrieval over entire files and complex code blocks. Cross-language code understanding was a particular strength, matching functionally equivalent snippets across different programming languages. In 2026, jina-code-embeddings-0.5b and jina-code-embeddings-1.5b supersede this model with autoregressive backbones, 32K context, and significantly higher retrieval accuracy.

Best Practice

Use for code search, documentation retrieval, and code reuse in monolingual or cross-language codebases. For documents exceeding 8,192 tokens, implement chunking at function or class boundaries. The model integrates with vector databases (Qdrant, Weaviate, MongoDB) and RAG frameworks. For new code-search projects, prefer jina-code-embeddings-1.5b (1.5B params, 32K context, SOTA accuracy) or jina-code-embeddings-0.5b (494M params, edge-friendly). CUDA-capable GPU recommended for production. Strongest performance on Python, JavaScript, Java, PHP, Go, and Ruby; supports 30+ languages with graceful degradation.

Blogs that mention this model
April 08, 2025 • 21 minutes read
jina-reranker-m0: Multilingual Multimodal Document Reranker
Introducing jina-reranker-m0, our new multilingual multimodal reranker for retrieving visual documents, with SOTA performance on multilingual long documents and code searching tasks.
Jina AI
Modern dot matrix text display on a dark blue background, conveying a digital feel.
September 27, 2024 • 15 minutes read
Migration From Jina Embeddings v2 to v3
We collected some tips to help you migrate from Jina Embeddings v2 to v3.
Alex C-G
Scott Martens
A digital upgrade theme with "V3" and a white "2", set against a green and black binary code background, with "Upgrade" centr
April 29, 2024 • 7 minutes read
Jina Embeddings and Reranker on Azure: Scalable Business-Ready AI Solutions
Jina Embeddings and Rerankers are now available on Azure Marketplace. Enterprises that prioritize privacy and security can now easily integrate Jina AI's state-of-the-art models right in their existing Azure ecosystem.
Susana Guzmán
Futuristic black background with a purple 3D grid, featuring the "Embeddings" and "Reranker" logos with a stylized "A".
March 25, 2024 • 21 minutes read
Next-Level Cloud AI: Jina Embeddings and Rerankers on Amazon SageMaker
Learn to use Jina Embeddings and Reranking models in a full-stack AI application on AWS, using only components available in Amazon SageMaker and the AWS Marketplace.
Scott Martens
Saahil Ognawala
Abstract image with colorful wavy background featuring AWS, Embeddings, and Reranker logos.
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.