alt.freeweights.text / CodeRankEmbed
From: nomic-ai <huggingface.co/nomic-ai>Newsgroups: alt.freeweights.textSubject:

CodeRankEmbed

Date: 2026-11-15Commit: 3c4b608Signed: 2DC28CC7B26A283B ✓

Feature extraction model with 137M parameters. Safetensors weights, 548 MB in all. Published by nomic-ai under MIT.

137M params548MBCodeRankEmbedsafetensorspermissive
FactsParams137MSize548 MBFormatssafetensorsTaskfeature extractionLicenseMITFrom sourcepermissive
$ fw get nomic-ai/CodeRankEmbed
# manifest sha256 ffe7b5b7a735… · 548 MB · 14 files
$ fw verify ./CodeRankEmbed nomic-ai/CodeRankEmbed
From sourceHosted (signed)nomic-ai/CodeRankEmbedLast check: 2026-11-15 02:32 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Fine-tune of snowflake-arctic-embed-m-long.

Works with

Evaluate with

Overview

Size
548 MB
Weights
547 MB (safetensors)
Parameters
137M
Formats
safetensors
Task
feature extraction
License
MIT (permissive)
Files
14, each with a sha256
Publisher
nomic-ai
Added
2026-11-15
Section
alt.freeweights.text
Lineage

Original release from the publisher.

Base model: Snowflake/snowflake-arctic-embed-m-long

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:32 UTCpassed

Model card

From the publisher at commit 3c4b608. Shown as plain text with links; images open at the publisher.

CodeRankEmbed#

CodeRankEmbed is a 137M bi-encoder supporting 8192 context length for code retrieval. It significantly outperforms various open-source and proprietary code embedding models on various code retrieval tasks.

Check out our blog post and paper for more details!

Combine CodeRankEmbed with our re-ranker CodeRankLLM for even higher quality code retrieval.

Performance Benchmarks#

NameParametersCSN (MRR)CoIR (NDCG@10)
CodeRankEmbed137M77.960.1
Arctic-Embed-M-Long137M53.443.0
CodeSage-Small130M64.954.4
CodeSage-Base356M68.757.5
CodeSage-Large1.3B71.259.4
Jina-Code-v2161M67.258.4
CodeT5+110M74.245.9
OpenAI-Ada-002110M71.345.6
Voyage-Code-002Unknown68.556.3

We release the scripts to evaluate our model's performance here.

Usage#

Important: the query prompt must include the following task instruction prefix: "Represent this query for searching relevant code"

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("nomic-ai/CodeRankEmbed", trust_remote_code=True)
queries = ['Represent this query for searching relevant code: Calculate the n-th factorial']
codes = ['def fact(n):\n if n < 0:\n  raise ValueError\n return 1 if n == 0 else n * fact(n - 1)']
query_embeddings = model.encode(queries)
print(query_embeddings)
code_embeddings = model.encode(codes)
print(code_embeddings)

Training#

We use a bi-encoder architecture for CodeRankEmbed, with weights shared between the text and code encoder. The retriever is contrastively fine-tuned with InfoNCE loss on a 21 million example high-quality dataset we curated called CoRNStack. Our encoder is initialized with Arctic-Embed-M-Long, a 137M parameter text encoder supporting an extended context length of 8,192 tokens.

Citation#

If you find the model, dataset, or training code useful, please cite our work:

@misc{suresh2025cornstackhighqualitycontrastivedata,
      title={CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Reranking}, 
      author={Tarun Suresh and Revanth Gangi Reddy and Yifei Xu and Zach Nussbaum and Andriy Mulyar and Brandon Duderstadt and Heng Ji},
      year={2025},
      eprint={2412.01007},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2412.01007}, 
}

Files

14 files · 548 MBWeights 547 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 14 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
1_Pooling/config.json296 Bd02ebf56344d20f773449b15d0c10ee9a86a9178f3b3c9bfecb8b87d4350ce38
README.md3.10 KB69a6d76a2b533dd0f293b5d1b33a5b433201af38cf48c887b8ec795b641849a0
config.json1.52 KB5ff856a41d0f53ef2d74520627d464bd75c2efd8f26f381bd528654895c29b6c
config_sentence_transformers.json245 B06bc4c2dc7098e98669beb67cf21dc1373e44a77c7eecdf70aad6585d87190cf
configuration_hf_nomic_bert.py1.96 KB8632792e922e62ab1a6feaab15baf406e223c0547a21de23ab4f520b2b36d674
model.safetensors547 MB827529bcd58aef0d9082e66eeff7e7d53a02f62bd005f841a26b3d3e2fb17ebe
modeling_hf_nomic_bert.py52.6 KB502ccfb9c2d5dac976109ac2f04dc3125d8540329e5d4af92bc587d6dc65edcd
modules.json229 B8f4b264b80206c830bebbdcae377e137925650a433b689343a63bdc9b3145460
sentence_bert_config.json140 Bd8ecbf1eb946d17aec64c83e6614e5ec1b19b62498cf72a4ed4ec882c86af07e
special_tokens_map.json695 B5d5b662e421ea9fac075174bb0688ee0d9431699900b90662acd44b2a350503a
tokenizer.json712 KB91f1def9b9391fdabe028cd3f3fcc4efd34e5d1f08c3bf2de513ebb5911a1854
tokenizer_config.json1.42 KB7809f768ee3614618b3f1b91dcbfab4f6a9d4b79fb1ad5d17feb65a7c1bb5b7a
vocab.txt232 KB07eced375cec144d27c900241f3e339478dec958f92fddbc551f295c992038a3
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
3c4b60807d pinned now2026-11-15 02:32 UTC14 files · 548 MB

Use it

$ fw get nomic-ai/CodeRankEmbed
# manifest sha256 ffe7b5b7a735… · 548 MB · 14 files
$ fw verify ./CodeRankEmbed nomic-ai/CodeRankEmbed
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/nomic-ai/CodeRankEmbed.json --dir ./CodeRankEmbed $ python3 fw.py verify ./CodeRankEmbed ./nomic-ai__CodeRankEmbed.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download nomic-ai/CodeRankEmbed --revision 3c4b60807d71f79b43f3c4363786d9493691f8b1 --local-dir ./CodeRankEmbed
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModel, AutoTokenizer tok = AutoTokenizer.from_pretrained("nomic-ai/CodeRankEmbed", revision="3c4b60807d71f79b43f3c4363786d9493691f8b1") model = AutoModel.from_pretrained("nomic-ai/CodeRankEmbed", revision="3c4b60807d71f79b43f3c4363786d9493691f8b1", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from sentence_transformers import SentenceTransformer model = SentenceTransformer("nomic-ai/CodeRankEmbed", revision="3c4b60807d71f79b43f3c4363786d9493691f8b1") vectors = model.encode(["Hello"])

License

Name
MIT License
Id
MIT
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
69a6d76a2b533dd0f293b5d1b33a5b433201af38cf48c887b8ec795b641849a0
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: nomic-ai <huggingface.co/nomic-ai>Newsgroups: alt.freeweights.textSubject: CodeRankEmbedDate: 2026-11-15Commit: 3c4b608Signed: 2DC28CC7B26A283B ✓
Upstream
nomic-ai/CodeRankEmbed
Pinned commit
3c4b60807d71f79b43f3c4363786d9493691f8b1
Manifest
CodeRankEmbed.json · .minisig
Manifest sha256
ffe7b5b7a7353c99a1b213e6113364bece1ccc71c1ec2a6fa29c8498f3d56ea2
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:32 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/nomic-ai/CodeRankEmbed.json $ curl -O https://freeweights.allternit.com/manifests/nomic-ai/CodeRankEmbed.json.minisig $ minisign -Vm CodeRankEmbed.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

Snowflake/snowflake-arctic-embed-m-long · this model is a finetune of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download nomic-ai/CodeRankEmbed
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. CodeRankEmbed.json. Provenance. Takedown history: none.
From: laion <huggingface.co/laion>Subject: a2-rl-e2egit_large-50-32B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-large-15-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-v2-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_pymethods2test-large-80-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_unitsyn-python-large-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_mix_h2_language_proportional-65-8B