/ Модель

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

Контекст
131 072 токена
Параметры
2,6 млрд
Размер весов
17,5 ГБ
Лицензия
Своя лицензия
Архитектура
fuse_glm · dense
Базовая модель
LFM2.5-2.6B
Библиотека
transformers
Опубликована
27 авг 2026

RivetCoder-9B-A4B

Генерация текстаТекст → текст6 профессий

Экспериментальная диалоговая модель HCHs для генерации кода, объединяющая основу LiquidAI/LFM2.5-2.6B с маршрутизируемыми экспертами GLM-5.3-Flash.

244скачиваний за 30 дней8лайковвеса обновлены27 авг 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

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

RivetCoder-9B-A4B — экспериментальная модель генерации кода от HCHs, построенная на замороженной 30-слойной основе LiquidAI/LFM2.5-2.6B с добавленными 480 замороженными FFN-экспертами из zai-org/GLM-5.3-Flash. Для каждого слоя основы выбираются четыре из 16 кандидатов на токен; маршрутизаторы, токеновые гейты и ограниченные масштабы остаточных связей обучались отдельно. Модель рассчитана на диалоговую генерацию кода и агентные сценарии. Она имеет 2,6 млрд параметров, принимает текст и поддерживает контекст до 131 072 токенов. В README описана проверка маршрутизации на небольшом наборе кодовых диалогов, но результаты стандартных бенчмарков не приведены.

Для загрузки нужен Transformers с пользовательским кодом репозитория и параметром trust_remote_code=True. BF16/FP32-смешанный чекпойнт занимает около 16,3 ГиБ; на GPU с 16 ГиБ обычно потребуется выгрузка частей модели в CPU или на диск. Архитектура экспериментальная: перенос экспертов использует фиксированный, необучаемый мост представлений, сопоставление слоёв основано на глубине, а выполнение экспертов на CPU существенно медленнее специализированного ядра. Лицензия указана как other, конкретные условия в предоставленных данных не раскрыты.

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

  • генерация фрагментов кода по текстовому запросу
  • помощь в написании кода в диалоговом формате
  • генерация кода на Python, TypeScript, Go, Rust, Java, C++ и SQL
  • использование в агентных сценариях разработки

Ограничения

Оценка ограничена небольшим внутренним набором маршрутизации; результаты HumanEval, MBPP, SWE-bench и широких регрессионных проверок не представлены. Фиксированный необучаемый мост и сопоставление слоёв по глубине могут ограничивать перенос знаний, а исполнение экспертов на CPU медленное.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

RivetCoder-9B-A4B

RivetCoder-9B-A4B is an experimental coding-oriented routed-expert model. It keeps LiquidAI/LFM2.5-2.6B as a frozen 30-layer host and adds 480 frozen FFNs derived from zai-org/GLM-5.3-Flash. Each host layer owns 16 layer-qualified candidates; four are routed per token.

The model uses custom Transformers code and must be loaded with trust_remote_code=True.

Model details

ItemValue
HostLiquidAI/LFM2.5-2.6B
Expert donorzai-org/GLM-5.3-Flash
Router teacherqwen/qwen3.8-27b via local LM Studio
Host layers30
Candidate experts16 per layer, 480 total
Active expertsTop-4 per token
Folded expert shape2048 → 2048 → 2048
Approx. total parameters8.74B
Approx. active parameters4.21B
Stored tensor bytes17,478,172,784
Routing-control training60 optimizer steps

The fixed bridge is P = [I; H] / sqrt(2), where H is a normalized, signed, deterministically permuted order-2048 Hadamard matrix. P_out = P.T and P.T @ P ≈ I. The bridge is folded into the expert and router weights and is not present as a runtime module.

The GLM post-sigmoid expert-choice correction is preserved as a frozen buffer. It affects Top-K selection only; mixture weights are gathered from the uncorrected sigmoid scores.

Installation

pip install "transformers>=5.16.1,<5.17" "torch>=2.12" "accelerate>=1.13" safetensors

Usage

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "HCHs/RivetCoder-9B-A4B"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    trust_remote_code=True,
    dtype="auto",
    device_map="auto",
)

messages = [
    {
        "role": "user",
        "content": "Implement an LRU cache in Python and include concise tests.",
    }
]
inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt",
    return_dict=True,
).to(model.device)

with torch.no_grad():
    output = model.generate(
        **inputs,
        max_new_tokens=512,
        temperature=0.2,
        do_sample=True,
    )

print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

The BF16/mixed-FP32 checkpoint is about 16.3 GiB. A single 16 GiB GPU generally requires CPU/disk placement through device_map="auto" or another offload strategy.

To run the unmodified LFM host path for comparison:

model.set_coding_enabled(False)

Expert selection and router training

GLM router behavior was profiled on 4,119 coding tokens covering Python, TypeScript, Go, Rust, Java, C++, and SQL. For each sparse donor layer, 16 experts were selected using the deterministic rank score:

2 × frequency_rank + 3 × weighted_route_mass_rank

The provisional monotonic-depth mapping assigns one donor layer to every LFM layer. Selected experts and the LFM host remain frozen.

Routing controls were trained from Qwen-generated assistant responses:

  • 20 coding conversations for training;
  • 4 held-out coding conversations;
  • 8 generic-control conversations;
  • assistant-token-only causal loss through the LFM chat template;
  • frozen-host self-KL and generic token-gate suppression;
  • trainable tensors: router weights, token gates, and bounded residual scales.

On the small held-out set (1,417 assistant tokens), assistant CE changed from 0.605825 for the expert-off host to 0.601436 for the fused model. This is a small internal routing check, not a standardized coding benchmark.

The frozen-host expert-off path remained bitwise identical after training.

Limitations

  • This is an experimental custom architecture, not a stock LFM2 checkpoint.
  • Evaluation currently consists of a very small held-out routing set; HumanEval, MBPP, SWE-bench, and broader regression results have not been reported.
  • The bridge is deterministic and untrained, so donor/host representation mismatch can limit transferred expertise.
  • The layer mapping is normalized-depth based rather than activation-alignment based.
  • Soft token gating is enabled at inference. Hard thresholding is disabled because the learned gates were not calibrated for a 0.5 compute-skip cutoff.
  • CPU expert execution is substantially slower than a dedicated grouped-GEMM kernel.

Licenses and attribution

The overall checkpoint is distributed subject to the LFM Open License v1.0 in LICENSE, inherited from the LFM host. Review that license before redistribution or commercial use.

In particular, the LFM license does not grant commercial-use rights to a legal entity whose annual revenue exceeds USD 10 million. Consult the complete license; this summary is not legal advice.

The GLM-derived expert weights originate from zai-org/GLM-5.3-Flash, whose MIT license is included at licenses/GLM-MIT.txt.

qwen/qwen3.8-27b was used only as a sequence-level teacher for router-control training. No Qwen model weights are included in this repository.

Detailed, path-sanitized source revisions, selection rules, hashes, folding checks, and training metrics are available under provenance/.

Reproducibility anchors

Combined weight index SHA-256:
939b9f2bf0c48523d6a1a2ef93d987876a3e20613b33fe3715bf6b78bbc2a1bb

Routing controls SHA-256:
740f15e9bcf68efcb4d9c0f4b2bcfebff66ba199aead9cd2666156dffc60b1ad

Training run fingerprint:
68f9fa90e18e180f7037dea5e057aa296c95b59267aa09f38285363b5e517c2a

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

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

GPU в ailist

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

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

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
FuseGlmForCausalLM
Ревизия весов
9a90b19

0 моделей