Model Intelligence Sheet
nomic-ai/nomic-embed-code-gguf overview
Blog | Technical Report | AWS SageMaker | Atlas Embedding and Unstructured Data Analytics Platform Using llama.cpp commit 11683f579 for quantization. Original model: nomic-embed-code
Downloads
1,453
Likes
14
Pipeline
sentence-similarity
Library
—
Visibility
Public
Access
Open
Repository Files & Downloads
15 files detected
Direct downloads for all repository files
| File | Type | Quantization | Size | Link |
|---|---|---|---|---|
| nomic-embed-code.Q2_K.gguf | GGUF | Q2_K | 2.64 GB | Download |
| nomic-embed-code.Q3_K_L.gguf | GGUF | Q3_K_L | 3.59 GB | Download |
| nomic-embed-code.Q3_K_M.gguf | GGUF | Q3_K_M | 3.33 GB | Download |
| nomic-embed-code.Q3_K_S.gguf | GGUF | Q3_K_S | 3.03 GB | Download |
| nomic-embed-code.Q4_0.gguf | GGUF | — | 3.84 GB | Download |
| nomic-embed-code.Q4_1.gguf | GGUF | — | 4.22 GB | Download |
| nomic-embed-code.Q4_K_M.gguf | GGUF | Q4_K_M | 4.08 GB | Download |
| nomic-embed-code.Q4_K_S.gguf | GGUF | Q4_K_S | 3.87 GB | Download |
| nomic-embed-code.Q5_K_M.gguf | GGUF | Q5_K_M | 4.72 GB | Download |
| nomic-embed-code.Q5_K_S.gguf | GGUF | Q5_K_S | 4.60 GB | Download |
| nomic-embed-code.Q6_K.gguf | GGUF | Q6_K | 5.41 GB | Download |
| nomic-embed-code.Q8_0.gguf | GGUF | — | 7.00 GB | Download |
| nomic-embed-code.bf16.gguf | GGUF | BF16 | 13.18 GB | Download |
| nomic-embed-code.f16.gguf | GGUF | F16 | 13.18 GB | Download |
| nomic-embed-code.f32.gguf | GGUF | F32 | 26.35 GB | Download |
Model Details Live
Metadata Inspector
Normalized metadata (stored in metadata_json)
{
"metadata": {},
"card_data": {
"quantized_by": "Nomic",
"pipeline_tag": "sentence-similarity",
"base_model": "nomic-ai/nomic-embed-code",
"base_model_relation": "quantized",
"tags": [
"sentence-similarity",
"feature-extraction"
],
"license": "apache-2.0",
"frontmatter": {
"quantized_by": "Nomic",
"pipeline_tag": "sentence-similarity",
"base_model": "nomic-ai/nomic-embed-code",
"base_model_relation": "quantized",
"tags": [
"sentence-similarity",
"feature-extraction"
],
"license": "apache-2.0"
},
"hero_image_url": "https://cdn-uploads.huggingface.co/production/uploads/607997c83a565c15675055b3/rb-J54KLgg21f59Ba1jWp.png",
"summary": "Blog | Technical Report | AWS SageMaker | Atlas Embedding and Unstructured Data Analytics Platform Using llama.cpp commit 11683f579 for quantization. Original model: nomic-embed-code",
"quick_links": [],
"benchmark_table_html": "",
"readme_markdown": "---\nquantized_by: Nomic\npipeline_tag: sentence-similarity\nbase_model: nomic-ai/nomic-embed-code\nbase_model_relation: quantized\ntags:\n- sentence-similarity\n- feature-extraction\nlicense: apache-2.0\n---\n\n# Llama.cpp Quantizations of Nomic Embed Code: A State-of-the-Art Code Retriever\n\n[Blog](https://www.nomic.ai/blog/posts/introducing-state-of-the-art-nomic-embed-code) | [Technical Report](https://arxiv.org/abs/2412.01007) | [AWS SageMaker](https://aws.amazon.com/marketplace/seller-profile?id=seller-tpqidcj54zawi) | [Atlas Embedding and Unstructured Data Analytics Platform](https://atlas.nomic.ai)\n\nUsing <a href=\"https://github.com/ggml-org/llama.cpp\">llama.cpp</a> commit <a href=\"https://github.com/ggml-org/llama.cpp/tree/11683f579b2e0efac27955945a4bcadd8e123af3\">11683f579</a> for quantization.\n\nOriginal model: [nomic-embed-code](https://huggingface.co/nomic-ai/nomic-embed-code)\n\n## Usage\n\nThis model can be used with the [llama.cpp server](https://github.com/ggml-org/llama.cpp/blob/master/examples/embedding#post-v1embeddings-openai-compatible-embeddings-api) and other software that supports llama.cpp embedding models.\n\nQueries embedded with `nomic-embed-code` must begin with the following prefix:\n```\nRepresent this query for searching relevant code:\n```\n\nFor example, the code below shows how to use the prefix to embed user questions, e.g. in a RAG application.\n\nStart a llama.cpp server:\n```\nllama-server -m nomic-embed-code.Q4_0.gguf --embeddings --pooling last\n```\n\nAnd run this code:\n```python\nimport requests\nfrom textwrap import dedent\n\ndef dot(va, vb):\n return sum(a*b for a, b in zip(va, vb))\ndef embed(texts):\n resp = requests.post('http://localhost:8080/v1/embeddings', json={'input': texts}).json()\n return [d['embedding'] for d in resp['data']]\n\ndocs = [\n dedent(\"\"\"\\\n def fn(n):\n if n < 0:\n raise ValueError\n return 1 if n == 0 else n * fn(n - 1)\n \"\"\").strip(),\n dedent(\"\"\"\\\n def fn(n):\n print((\"Fizz\" * (n % 3 == 0) + \"Buzz\" * (n % 5 == 0)) or n)\n \"\"\").strip(),\n]\ndocs_embed = embed(docs)\n\nquery = 'Calculate the n-th factorial'\nquery_embed = embed(['Represent this query for searching relevant code: ' + query])[0]\nprint(f'query: {query!r}')\nfor d, e in zip(docs, docs_embed):\n print(f'\\nsimilarity {dot(query_embed, e):.2f}:\\n{d}')\n```\n\nYou should see output similar to this:\n```\nquery: 'Calculate the n-th factorial'\n\nsimilarity 0.49:\ndef fn(n):\n if n < 0:\n raise ValueError\n return 1 if n == 0 else n * fn(n - 1)\n\nsimilarity 0.32:\ndef fn(n):\n print((\"Fizz\" * (n % 3 == 0) + \"Buzz\" * (n % 5 == 0)) or n)\n```\n\n## Download a file (not the whole branch) from below:\n\n| Filename | Quant Type | File Size | Description |\n| -------- | ---------- | --------: | ----------- |\n| [nomic-embed-code.f32.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.f32.gguf) | f32 | 26.35GiB | Full FP32 weights. |\n| [nomic-embed-code.f16.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.f16.gguf) | f16 | 13.18GiB | Full FP16 weights. |\n| [nomic-embed-code.bf16.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.bf16.gguf) | bf16 | 13.18GiB | Full BF16 weights. |\n| [nomic-embed-code.Q8\\_0.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q8_0.gguf) | Q8\\_0 | 7.00GiB | Extremely high quality, generally unneeded but max available quant. |\n| [nomic-embed-code.Q6\\_K.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q6_K.gguf) | Q6\\_K | 5.41GiB | Very high quality, near perfect, *recommended*. |\n| [nomic-embed-code.Q5\\_K\\_M.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q5_K_M.gguf) | Q5\\_K\\_M | 4.72GiB | High quality, *recommended*. |\n| [nomic-embed-code.Q5\\_K\\_S.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q5_K_S.gguf) | Q5\\_K\\_S | 4.60GiB | High quality, *recommended*. |\n| [nomic-embed-code.Q4\\_1.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q4_1.gguf) | Q4\\_1 | 4.22GiB | Legacy format, similar performance to Q4\\_K\\_S but with improved tokens/watt on Apple silicon. |\n| [nomic-embed-code.Q4\\_K\\_M.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q4_K_M.gguf) | Q4\\_K\\_M | 4.08GiB | Good quality, default size for most use cases, *recommended*. |\n| [nomic-embed-code.Q4\\_K\\_S.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q4_K_S.gguf) | Q4\\_K\\_S | 3.87GiB | Slightly lower quality with more space savings, *recommended*. |\n| [nomic-embed-code.Q4\\_0.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q4_0.gguf) | Q4\\_0 | 3.84GiB | Legacy format, offers online repacking for ARM and AVX CPU inference. |\n| [nomic-embed-code.Q3\\_K\\_L.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q3_K_L.gguf) | Q3\\_K\\_L | 3.59GiB | Lower quality but usable, good for low RAM availability. |\n| [nomic-embed-code.Q3\\_K\\_M.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q3_K_M.gguf) | Q3\\_K\\_M | 3.33GiB | Low quality. |\n| [nomic-embed-code.Q3\\_K\\_S.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q3_K_S.gguf) | Q3\\_K\\_S | 3.03GiB | Low quality, not recommended. |\n| [nomic-embed-code.Q2\\_K.gguf](https://huggingface.co/nomic-ai/nomic-embed-code-GGUF/blob/main/nomic-embed-code.Q2_K.gguf) | Q2\\_K | 2.64GiB | Very low quality but surprisingly usable. |\n\n## Model Overview\n`nomic-embed-code` is a state-of-the-art code embedding model that excels at code retrieval tasks:\n\n- **High Performance**: Outperforms Voyage Code 3 and OpenAI Embed 3 Large on CodeSearchNet\n- **Multilingual Code Support**: Trained for multiple programming languages (Python, Java, Ruby, PHP, JavaScript, Go)\n- **Advanced Architecture**: 7B parameter code embedding model\n- **Fully Open-Source**: Model weights, training data, and [evaluation code](https://github.com/gangiswag/cornstack/) released\n\n| Model | Python | Java | Ruby | PHP | JavaScript | Go |\n|-------|--------|------|------|-----|------------|-----|\n| **Nomic Embed Code** | **81.7** | **80.5** | 81.8 | **72.3** | 77.1 | **93.8** |\n| Voyage Code 3 | 80.8 | **80.5** | **84.6** | 71.7 | **79.2** | 93.2 |\n| OpenAI Embed 3 Large | 70.8 | 72.9 | 75.3 | 59.6 | 68.1 | 87.6 |\n| Nomic CodeRankEmbed-137M | 78.4 | 76.9 | 79.3 | 68.8 | 71.4 | 92.7 |\n| CodeSage Large v2 (1B) | 74.2 | 72.3 | 76.7 | 65.2 | 72.5 | 84.6 |\n| CodeSage Large (1B) | 70.8 | 70.2 | 71.9 | 61.3 | 69.5 | 83.7 |\n| Qodo Embed 1 7B | 59.9 | 61.6 | 68.4 | 48.5 | 57.0 | 81.4 |\n\n## Model Architecture\n\n- **Total Parameters**: 7B\n- **Training Approach**: Trained on the CoRNStack dataset with dual-consistency filtering and progressive hard negative mining\n- **Supported Languages**: Python, Java, Ruby, PHP, JavaScript, and Go\n\n### CoRNStack Dataset Curation\n\nStarting with the deduplicated Stackv2, we create text-code pairs from function docstrings and respective code. We filtered out low-quality pairs where the docstring wasn't English, too short, or that contained URLs, HTML tags, or invalid characters. We additionally kept docstrings with text lengths of 256 tokens or longer to help the model learn long-range dependencies.\n\n\n\n\nAfter the initial filtering, we used dual-consistency filtering to remove potentially noisy examples. We embed each docstring and code pair and compute the similarity between each docstring and every code example. We remove pairs from the dataset if the corresponding code example is not found in the top-2 most similar examples for a given docstring.\n\nDuring training, we employ a novel curriculum-based hard negative mining strategy to ensure the model learns from challenging examples. We use a softmax-based sampling strategy to progressively sample hard negatives with increasing difficulty over time.\n\n\n## Join the Nomic Community\n\n- Nomic Embed Ecosystem: [https://www.nomic.ai/embed](https://www.nomic.ai/embed)\n- Website: [https://nomic.ai](https://nomic.ai)\n- Twitter: [https://twitter.com/nomic\\_ai](https://twitter.com/nomic_ai)\n- Discord: [https://discord.gg/myY5YDR8z8](https://discord.gg/myY5YDR8z8)\n\n# Citation\n\nIf you find the model, dataset, or training code useful, please cite our work:\n\n```bibtex\n@misc{suresh2025cornstackhighqualitycontrastivedata,\n title={CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Reranking},\n author={Tarun Suresh and Revanth Gangi Reddy and Yifei Xu and Zach Nussbaum and Andriy Mulyar and Brandon Duderstadt and Heng Ji},\n year={2025},\n eprint={2412.01007},\n archivePrefix={arXiv},\n primaryClass={cs.CL},\n url={https://arxiv.org/abs/2412.01007},\n}\n```\n",
"related_quantizations": []
},
"tags": [
"gguf",
"sentence-similarity",
"feature-extraction",
"arxiv:2412.01007",
"base_model:nomic-ai/nomic-embed-code",
"base_model:quantized:nomic-ai/nomic-embed-code",
"license:apache-2.0",
"endpoints_compatible",
"region:us"
],
"likes": 14,
"downloads": 1453,
"gated": false,
"private": false,
"last_modified": "2025-05-01T20:06:19.000Z",
"created_at": "2025-04-30T22:05:23.000Z",
"pipeline_tag": "sentence-similarity",
"library_name": ""
}
Source payload excerpt (from Hugging Face API)
{
"_id": "68129ea3967ac708f3a91fb6",
"id": "nomic-ai/nomic-embed-code-GGUF",
"modelId": "nomic-ai/nomic-embed-code-GGUF",
"sha": "ff2ddedde976ea623178981f18e36af33c0c2a94",
"createdAt": "2025-04-30T22:05:23.000Z",
"lastModified": "2025-05-01T20:06:19.000Z",
"author": "nomic-ai",
"downloads": 1453,
"likes": 14,
"gated": false,
"private": false,
"pipeline_tag": "sentence-similarity",
"library_name": "",
"siblings_count": 17
}