Feature Extraction
sentence-transformers
ONNX
Safetensors
GGUF
English
code
roberta
python
javascript
go
java
ruby
php
code-search
code-embeddings
matryoshka
unixcoder
mteb
Eval Results (legacy)
text-embeddings-inference
Run this model with HF Jobs
Run divakantpandey/code-embed-v2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/divakantpandey/code-embed-v2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/divakantpandey/code-embed-v2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use divakantpandey/code-embed-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use divakantpandey/code-embed-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("divakantpandey/code-embed-v2") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use divakantpandey/code-embed-v2 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible embeddings server: llama serve -hf divakantpandey/code-embed-v2:Q8_0 --embeddings
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible embeddings server: llama serve -hf divakantpandey/code-embed-v2:Q8_0 --embeddings
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible embeddings server: ./build/bin/llama serve -hf divakantpandey/code-embed-v2:Q8_0 --embeddings
- Llama new
- LM Studio
- Jan
- Ollama
How to use divakantpandey/code-embed-v2 with Ollama:
ollama run hf.co/divakantpandey/code-embed-v2:Q8_0
- Unsloth Desktop
- Docker Model Runner
How to use divakantpandey/code-embed-v2 with Docker Model Runner:
docker model run hf.co/divakantpandey/code-embed-v2:Q8_0
- Lemonade
How to use divakantpandey/code-embed-v2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull divakantpandey/code-embed-v2:Q8_0
Run and chat with the model
lemonade run user.code-embed-v2-Q8_0
List all available models
lemonade list
- Atomic Chat
Update model scope and limitations
Browse files269 unmodified lines27027127227327427527627727827928028128228328454 unmodified lines339340341342343344345269 unmodified lines[]()[](https://creativecommons.org/licenses/by-nc/4.0/)> [!WARNING]> **Corrections (2026-11-17).** Earlier versions of this card and the accompanying preprint draft contained claims that were wrong or not backed by a measurement:>> - **Context length is 1,024 tokens, not 8,192.** The model has 1,026 absolute position embeddings and was trained and evaluated at 1,024 tokens. The previous config advertised 8,192, which made any input over 1,024 tokens fail with `IndexError: index 1026 is out of bounds`. The config now truncates at 1,024.> - **Not fully zero-shot.** The model was trained on CodeSearchNet, which is the source of `CodeSearchNetRetrieval`, `COIRCodeSearchNetRetrieval` and `CodeSearchNetCCRetrieval`. Scores on those three tasks are in-distribution.> - **Matryoshka truncation quality and CPU latency were never measured.** The tables that reported them have been removed.> - **Training used in-batch negatives only**, not BM25 hard negatives. Pooling is mean pooling, not CLS. The Matryoshka dimensions were 64, 128, 256, 384, 768 and 1536.> - **Supported languages are the six CodeSearchNet languages.** TypeScript and SQL were never in the training data.> - **Parameter count is 129.5M** (90.0M excluding the token embedding table), not 131M total / 92M active.## Model details54 unmodified lines## Limitations- **No comparison against the base model.** UniXcoder-base was not evaluated with the same harness, so the gain from this fine-tune is not quantified.- **Truncated dimensions are untested.** The model was trained with a Matryoshka loss, but retrieval quality at truncated dimensions has not been measured. Validate on your own data before relying on it.- **Latency is not benchmarked.**- **The GGUF file is not the same embedding.** It outputs the 768-dimensional backbone representation without the projection head, and it has not been evaluated. Do not mix GGUF vectors with Sentence Transformers vectors in one index.269 unmodified lines27027127227327427527627727827928028128228354 unmodified lines338339340341342343269 unmodified lines[]()[](https://creativecommons.org/licenses/by-nc/4.0/)> [!NOTE]> **Model scope**>> - **Context length:** 1,024 tokens. The model has 1,026 absolute position embeddings and was trained and evaluated at this length; longer inputs are truncated. Revisions published before 2026-11-17 advertised 8,192 tokens and fail on longer inputs, so update to the latest revision if you see `IndexError: index 1026 is out of bounds`.> - **Training data:** the CodeSearchNet train split in Python, JavaScript, Go, Java, Ruby and PHP. Scores on `CodeSearchNetRetrieval`, `COIRCodeSearchNetRetrieval` and `CodeSearchNetCCRetrieval` are in-distribution.> - **Training setup:** mean pooling, in-batch negatives, and a Matryoshka loss at 64, 128, 256, 384, 768 and 1536 dimensions.> - **Not yet measured:** retrieval quality at truncated dimensions and inference latency.> - **Parameters:** 129.5M in total, 90.0M excluding the token embedding table.## Model details54 unmodified lines## Limitations- **Truncated dimensions are untested.** The model was trained with a Matryoshka loss, but retrieval quality at truncated dimensions has not been measured. Validate on your own data before relying on it.- **Latency is not benchmarked.**- **The GGUF file is not the same embedding.** It outputs the 768-dimensional backbone representation without the projection head, and it has not been evaluated. Do not mix GGUF vectors with Sentence Transformers vectors in one index.
README.md+7-9