/ Модель

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

Лицензия
Своя лицензия
Библиотека
pytorch
Опубликована
12 окт 2026

Allan-LM-Quark

Генерация текстаТекст → текст3 профессии
248скачиваний за 30 дней0лайковвеса обновлены27 ноя 2026

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

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

Небольшая русско-английская чат-модель KEYTRON для коротких ответов и выполнения арифметических и справочных задач с помощью инструментов.

Allan-LM Quark 1.1 — небольшая чат-модель KEYTRON, обученная с нуля и затем дообученная для работы в формате ассистента. Это собственная архитектура MoE с PLE: 283,7 млн параметров, из них 106,8 млн активны на токен; в модели 10 слоёв и grouped-query attention. Модель принимает текст, отвечает на русском и английском языках и может выдавать отдельный блок рассуждений и вызывать инструменты calc для вычислений и facts для справок о странах и химических элементах. Для вызова инструментов требуется системный промпт из проекта.

Модель рассчитана на короткие ответы, арифметику и школьные задачи с помощью calc, а также ответы на вопросы о странах и химических элементах через facts. В описанном тесте из 380 задач с инструментами она набрала 95%; этот результат оценивает следование форматам и применение инструментов, а не общие знания. Вне обученных форматов модель слаба: может выдумывать факты без обращения к справочнику, неверно читать результаты инструмента, отклоняться от темы в длинном диалоге и писать неработающий код. Для загрузки используются PyTorch и safetensors; архитектура не поддерживает непосредственную загрузку через Transformers, llama.cpp или Ollama. Лицензия BSL 1.1 разрешает некоммерческое использование; коммерческое использование требует согласования, а с 27 октября 2028 года заявлен переход на MIT.

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

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

Ограничения

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

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

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

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

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

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

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

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

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

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

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

Открыть на Hugging Face

Allan-LM Quark 1.1

The chat version of Allan-LM Quark, a small language model trained from scratch by KEYTRON for the Allan assistant. Quark 1.1 answers in Russian and English, reasons in a separate block and calls two tools: calc for exact arithmetic and facts for a reference of countries and chemical elements. The tools ship with the model and run inside chat.py and the serverless worker.

It is a research model of 283.7M parameters: it follows the formats it was taught well and knows very little beyond them. Read What to expect before using it.

Versions of Allan-LM are named after particles. The base model this one was tuned from, Allan-LM Quark 1.0, stays in this repo under the tag v1.0.

Model

Parameters283,661,440 total (283.7M), 106.8M active per token (136.2M incl. PLE tables)
Breakdownrouted experts 196.6M (8, top-2) · PLE 29.4M · shared expert 24.6M · tied embeddings 23.1M (vocab 36,160) · attention 9.8M
Layers10, d_model 640, 10 heads (2 KV heads, GQA)
Feed-forwardMixture of Experts: 8 experts, top-2, plus 1 shared expert
Per-Layer Embeddingsyes (d_ple 80), in the style of Gemma's E-models
Contexttrained at 1024 tokens, RoPE positions up to 2048
Tokenizerown BPE, 32,000 text tokens; the vocabulary (36,160) also holds the chat, reasoning and tool special tokens and reserved audio tokens
Weightsfp32 safetensors, tied embeddings

The architecture is custom (allan_lm/model.py); it does not load with transformers, llama.cpp or Ollama.

Chat format

<|system|> … <|end|> <|user|> … <|end|>
<|assistant|> <|think|> reasoning <|think_end|> text <|tool_call|> {"name": "calc", "args": {"expr": "17*23"}} <|end|>
<|tool_result|> 391 <|end|>
<|assistant|> … <|end|>

Every marker is a single special token. Tool calls are made only after the system prompt the model was trained with (allan_lm.agent.SYSTEM); without it Quark 1.1 answers as a plain chat model.

Training

  1. Pretraining (= Quark 1.0): ~10B tokens of Russian web text (fineweb-2, ODC-BY), English educational web text (fineweb-edu, ODC-BY) and source code (github-code-clean, per-file licenses).
  2. Supervised fine-tuning, several stages on RunPod GPUs:
SourceLicenseWhat it teaches
OpenAssistant/oasst2Apache 2.0dialogue, written by people
CohereLabs/aya_datasetApache 2.0answers in Russian and English, written by people
openai/gsm8kMITword problems, written by people
agent tasks generated by codeowntool calls with real tool output: arithmetic, files, dates, reading --help, checking the user's claims and holding a correct answer under pushback
school tasks generated by codeownequations, fractions, geometry, physics, chemistry step by step through calc; countries and elements through facts
WikidataCC0the facts tables (facts/)

The generated tasks are built by programs from templates: every number and every tool result comes from really running the tool, so the answers are correct by construction. No text written by any language model (answers, distillations, rewrites) and no machine translation was used at any stage.

Evaluation

Quark 1.0Quark 1.1
Validation CE on the SFT mix (nats/token)—1.574
Agent and school tasks with real tools, 380 tasks—95%

The 380 tasks are new samples from the same generators (a seed the training data did not use), solved with real tools. They measure whether the model uses its tools and formats correctly, not general knowledge. Most kinds (arithmetic, equations, fractions, facts) score 95–100%; reading --help to find an option is the weak one at ~50%.

What to expect

  • Good: arithmetic and school math through calc, countries, capitals and elements through facts, short factual replies built on a tool result, disagreeing with a wrong claim of the user.
  • Weak: anything outside those formats. Asked a fact without calling a tool it often invents ("Столица Австралии — Тасмания"); it may misread a correct tool result; open conversation drifts into unrelated text after a few sentences; code it writes does not work.
  • Use it to study small models with tools, not as a source of information.

Example (python chat.py, greedy):

>>> What is the capital of Japan?
  · Ask the reference about Japan.
  → facts({"query": "Japan"}) = country: Япония / Japan | capital: Токио / Tokyo | continent: Азия / Asia
The capital is Tokyo.

Usage

pip install torch safetensors tokenizers
python chat.py                                  # interactive
python chat.py -p "Посчитай (120 + 45) / 5"
from allan_lm.agent import Agent

agent = Agent(".")                              # this folder
r = agent.reply([{"role": "user", "content": "Сколько будет 17 * 23?"}])
print(r["content"])                             # Получается 391.
print(r["steps"])                               # the tool calls and their results

Serverless

serverless/handler.py is a RunPod Serverless worker with an OpenAI-compatible /v1/chat/completions (streaming included) and /v1/models. The ready image keytron46/allan-lm-worker:quark-1.1 (Docker Hub, built from serverless/Dockerfile) has the packages and this repo baked in; on start serverless/start.sh fetches only the files changed on main since the build, so each new worker serves the latest weights, and falls back to the baked copy when the Hub is not reachable. A cold start takes about two minutes, a warm request one to three seconds.

Without the image, a stock PyTorch image works too (slower start):

image:   pytorch/pytorch:2.11.0-cuda12.8-cudnn9-runtime
command: bash -c 'pip install -q runpod==1.12.0 huggingface_hub==2.2.0 safetensors==0.8.0 tokenizers==0.23.3
         && hf download keytron46/Allan-LM-Quark --local-dir /model && exec python -u /model/serverless/handler.py'

Tool calls come back as reasoning_content, the answer as content.

License

Business Source License 1.1 (see LICENSE): free for personal, academic, research and evaluation use; commercial use needs a separate agreement with the licensor. On 2028-10-27 the license changes to MIT.

Русский

Allan-LM Quark 1.1 — чат-версия своей модели Allan-LM, обученной с нуля (283.7M параметров, 106.8M активных, MoE + PLE). Отвечает по-русски и по-английски, рассуждает отдельным блоком и сама вызывает инструменты: calc для точных расчётов и facts — справочник стран и химических элементов. Дообучена только на текстах, написанных людьми (oasst2, aya, GSM8K), и на задачах, которые собирает программа с настоящими результатами инструментов; ответов других нейросетей в данных нет. На 380 задачах с инструментами — 95%, но за пределами выученных форматов модель слабая и выдумывает. Базовая модель Quark 1.0 — под тегом v1.0. Лицензия BSL 1.1: некоммерческое использование свободно, коммерческое — по договорённости; с 2028-10-27 — MIT.

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

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

GPU в ailist

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

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

Архитектура ? неизвестна transformers в образе рантайма.

Ревизия весов
697909b

0 моделей