/ Модель

Характеристики

Лицензия
MIT
Библиотека
onnx
Опубликована
21 окт 2026

live-graph-coder-v1

ЭмбеддингиТекст → embedding4 профессии
0скачиваний за 30 дней2лайкавеса обновлены5 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Компактный ONNX-энкодер преобразует код и текстовые запросы в эмбеддинги для поиска релевантного кода по описанию.

Live Graph Coder v1 — бета-версия модели кодового поиска, предназначенная для использования в расширении Live Graph Coder для VS Code. Это компактный энкодер на основе трансформера с 6 слоями, скрытым размером 768 и 12 головами внимания. Модель преобразует фрагменты кода и запросы на естественном языке в эмбеддинги, чтобы находить код по описанию; текстовые запросы должны начинаться с заданного префикса.

Модель обучена на коде, docstring и документации открытых репозиториев. В README приведены результаты на RepoQA и SWE-Atlas: модель уступает 12-слойной модели-учителю CodeRankEmbed, но занимает меньше места и рассчитана на работу на CPU. Веса квантованы до int4, а Q/K/V и эмбеддинги представлены в int8; размер модели — 66 МБ. Формат репозитория — ONNX, лицензия — MIT.

Сценарии применения

  • поиск функции в репозитории по описанию на естественном языке
  • поиск фрагментов кода по вопросу о проекте
  • поиск соответствующего кода по docstring
  • кодовый поиск в расширении для VS Code

Ограничения

Это бета-версия, уступающая более крупной модели-учителю на приведённых бенчмарках. Для текстового запроса требуется заданный префикс; результаты бенчмарков не гарантируют качество на других репозиториях.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Live Graph Coder v1 - Beta release

This Beta release contains only the mixed-precision 6-layer code embedding model: int4 weights with int8 for Q/K/V and embeddings. This attention-based code-search encoder turns code and natural-language queries into embeddings, so a question can find the code it is about. At 66 MB, it is light enough to run on a CPU.

Used in the VS Code extension Live Graph Coder (Beta V1): install it for free from the VS Code Marketplace.

Architecture

Live Graph Coder v1 architecture: WordPiece tokenizer, int8 token embedding, 6 transformer layers (int8 Q/K/V projection, multi-head attention, int4 output projection, int4 SwiGLU and down projection, each sub-layer with a residual connection and LayerNorm), then the CLS vector, L2-normalised, as a 768-number embedding

Layers6 (post-norm transformer, no biases)
Hidden size768
Attention12 heads × 64, rotary positions (base 1000)
Feed-forwardSwiGLU, 3,072
Vocabulary30,522 (lower-case WordPiece, vocab.txt)
Parameters80.1M
Output768 numbers, unit length
Filemodel_int4_qkv8.onnx, 66 MB: embeddings int8, Q/K/V 8-bit, other matrices 4-bit (blocks of 32)

Usage

Queries start with Represent this query for searching relevant code: ; code is embedded as is.

import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download
from transformers import BertTokenizerFast

repo = "hasitha-gallella/live-graph-coder-v1"
tokenizer = BertTokenizerFast(hf_hub_download(repo, "vocab.txt"), do_lower_case=True)
session = ort.InferenceSession(hf_hub_download(repo, "model_int4_qkv8.onnx"), providers=["CPUExecutionProvider"])

def embed(texts):
    batch = tokenizer(texts, padding=True, truncation=True, max_length=512, return_tensors="np")
    feeds = {k: batch[k].astype(np.int64) for k in ("input_ids", "attention_mask")}
    return session.run(None, feeds)[0]  # (n, 768), unit length

query = embed(["Represent this query for searching relevant code: read settings from a JSON file"])
code = embed(["def load_config(path):\n    with open(path) as f:\n        return json.load(f)",
              "def add(a, b):\n    return a + b"])
print(query @ code.T)  # about [[0.57, -0.03]]: the JSON loader matches

The same file runs in Node.js and in browsers with onnxruntime-web.

Results

Two benchmarks whose code was not used in training:

BenchmarkMeasureThis model (66 MB)12-layer CodeRankEmbed teacher (547 MB)
RepoQA (Python functions, found from a description)Right function first / in the top 1070% / 93%77% / 94%
SWE-Atlas questionsNamed code in the top 529%36%

Training

The model was trained in two rounds (4,500 steps in total) on the code, docstrings and documentation of open-source repositories from SWE-bench Lite and SWE-bench Multimodal, released under the MIT, BSD, Apache-2.0 or Matplotlib licence: Astropy, Matplotlib, seaborn, Flask, Requests, xarray, pytest, scikit-learn, Sphinx, Chart.js, react-pdf, OpenLayers, Lighthouse, highlight.js and Prism. The training objective has three parts: matching the teacher's vectors, keeping its similarity ranking within each batch, and matching each docstring with its code.

References

  1. The base design and the WordPiece vocabulary (vocab.txt). J. Devlin et al. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. 2018. arXiv:1810.04805.
  2. The encoder design (rotary positions, SwiGLU feed-forward, no biases). Z. Nussbaum et al. Nomic Embed: Training a Reproducible Long Context Text Embedder. 2024. arXiv:2402.01613.
  3. This model is distilled from CodeRankEmbed's layers 0, 2, 4, 6, 8 and 10 (trained on the CoRNStack code-retrieval data) and uses the CodeRankEmbed query prefix. T. Suresh et al. CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Reranking. 2024. arXiv:2412.01007.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · onnx

Нельзя запустить

В репозитории нет весов в формате PyTorch/safetensors.

Ревизия весов
62c3c49

0 моделей