/ Модель

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

Контекст
384 токена
Параметры
17,7 млн
Лицензия
Apache 2.0
Архитектура
ariadne · dense
Библиотека
onnx
Опубликована
27 ноя 2026

ariadne-1.0

ЭмбеддингиТекст → embedding
247скачиваний за 30 дней0лайковвеса обновлены27 ноя 2026

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

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

Компактная ONNX-модель Memtrace, которая создаёт векторы кода и запросов для семантического поиска по программным проектам.

Ariadne 1.0 — компактная модель Memtrace для семантического поиска по исходному коду. Она преобразует фрагменты кода и вопросы о коде в нормализованные векторы размерности 768, чтобы находить фрагменты по их назначению, даже если запрос не совпадает с именами и ключевыми словами. Модель предназначена для индексации проектов и поиска функций, классов и другого кода; Memtrace использует её как модель векторного поиска.

Это двухслойный трансформерный энкодер шириной 256 с четырьмя головами внимания и контекстом до 384 токенов. Модель содержит около 17,7 млн параметров, поставляется в формате ONNX и рассчитана на работу на CPU или GPU. Она обучена дистилляцией с jina-embeddings-v2-base-code на пяти миллионах фрагментов из примерно 400 открытых проектов на 32 языках программирования. Качество поиска ниже, чем у Jina, а вопросы на языках, кроме английского, работают хуже; длинный код необходимо предварительно разбивать на фрагменты. Лицензия — Apache-2.0.

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

  • поиск функции по описанию её назначения
  • поиск кода по вопросу на естественном языке
  • семантическая индексация исходного кода проекта
  • поиск похожих фрагментов кода
  • векторный поиск по функциям и классам в локальном проекте

Ограничения

Контекст ограничен 384 токенами, поэтому длинный код нужно разбивать на части. Качество уступает jina-embeddings-v2-base-code, а запросы на других человеческих языках работают хуже; модель также наследует ограничения учителя.

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

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

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

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

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

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

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

Открыть на Hugging Face

Ariadne 1.0

Ariadne is the model Memtrace uses to find code by what it does, not only by its name. It turns a piece of code, or a question about code, into a list of 768 numbers, so that code and questions about the same thing end up close together.

It is small: 70 MB and 17.5 million parameters. That makes it fast enough to run on any laptop without a graphics card, and much faster with one.

Named after Ariadne's thread, the one that leads through the labyrinth. Its sibling, Aletheia, finds the decisions in a conversation.

How it was made

Ariadne learned by copying a larger model, jina-embeddings-v2-base-code. We gave both models 5 million pieces of code and taught Ariadne to give the same answers as Jina.

The 5 million pieces are exactly what Memtrace embeds when it indexes a project: functions, classes and the text inside them. They come from about 400 popular open-source projects on GitHub, all under permissive licences (MIT, Apache 2.0, BSD and similar), in 32 languages: TypeScript, Python, Go, Rust, C++, Java, C#, JavaScript, C, Swift, Kotlin, Ruby, PHP, Dart, Elixir, Zig, COBOL, Lua, Perl, R, HCL, Vue, SCSS, CSS, HTML, PL/pgSQL, T-SQL, GDScript, Nextflow, ActionScript, Bicep and Gherkin. Training took about half an hour on one graphics card.

How good it is

All of these were measured on projects Ariadne never saw during training.

TestAriadne 1.0Jina v2 base code
Find the function from its docstring, top 10, Django80.1%89.7%
Find the function from its docstring, top 10, pytest84.4%91.6%
Memtrace search on 150 real pytest issues, top 10 (three ways of asking)86.7 / 61.3 / 57.3%87.3 / 59.3 / 57.3%
Memtrace search on 150 real Keycloak issues, top 10 (three ways of asking)64.0 / 53.3 / 54.0%62.7 / 52.0 / 54.0%

On its own, Ariadne is 7 to 10 points behind Jina. Inside Memtrace, which combines exact names, keyword search, the code graph and these vectors, the two scored the same. That second result says more about Memtrace than about the model: with vectors switched off entirely, Memtrace scored about the same on those issues too. Read it as "safe to use in Memtrace", not as "as good as Jina".

Across 15 languages, Ariadne keeps two thirds of the ten closest matches Jina would pick.

How fast it is

Measured on a desktop with an Intel Core Ultra 7 265KF and an NVIDIA RTX 5070, in batches of 32:

Where it runsPieces of code per second
1 CPU threadabout 145
8 CPU threadsabout 830
Graphics card (CUDA)about 13,000

In Memtrace, embedding all of Keycloak (about 450,000 pieces) took 4 minutes with Ariadne and 14 minutes with Jina at half precision, on the same graphics card.

Using it

In Memtrace it is the default from version 1.2.23. There is nothing to set up. To keep using Jina instead, set MEMTRACE_EMBED_MODEL=jina-code or pick it on the Settings page.

Anywhere else, with ONNX Runtime and the tokenizer in this repository:

import numpy as np
import onnxruntime as ort
from huggingface_hub import snapshot_download
from tokenizers import Tokenizer

path = snapshot_download("memtrace/ariadne-1.0")
tokenizer = Tokenizer.from_file(f"{path}/tokenizer.json")
tokenizer.enable_truncation(max_length=384)
tokenizer.enable_padding(pad_id=0, pad_token="<pad>")
session = ort.InferenceSession(f"{path}/onnx/model.onnx")

texts = ["def parse_date(value): ...", "where do we turn a string into a date?"]
encoded = tokenizer.encode_batch(texts)
ids = np.array([e.ids for e in encoded], dtype=np.int64)
mask = np.array([e.attention_mask for e in encoded], dtype=np.int64)
vectors = session.run(None, {"input_ids": ids, "attention_mask": mask})[0]
print(vectors @ vectors.T)  # the vectors are already normalised: this is cosine similarity

The model takes input_ids and attention_mask and returns sentence_embedding: one normalised 768-number vector per text. Questions need no prefix.

Limits

  • It reads at most 384 tokens at a time. Split longer code into pieces first; Memtrace does this for you.
  • It learned from Jina, so it shares Jina's blind spots and does not know anything Jina did not.
  • It learned from code and the English comments and strings inside it. Questions in other human languages will work less well.
  • The files of a version never change. A better model will get a new version name.

Architecture

A 2-layer transformer encoder, 256 wide with 4 attention heads, learned positions for 384 tokens, the tokenizer of jina-embeddings-v2-base-code, mean pooling over the tokens and a linear layer up to 768 numbers. config.json lists the details.

Licence

Apache 2.0. The tokenizer files come from jinaai/jina-embeddings-v2-base-code, also Apache 2.0, and the model was trained to reproduce that model's vectors.

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

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

GPU в ailist

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

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

Модель выложена только в формате ONNX, рантайм загружает PyTorch-веса.

Класс архитектуры
AriadneEncoder
Ревизия весов
0ca83fa

0 моделей