/ Модель

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

Контекст
262 144 токена
Параметры
3,7 млрд
Размер весов
8 ГБ
Лицензия
Apache 2.0
Архитектура
qwen3 · dense
Базовая модель
Athenea-4B-Coding
Библиотека
transformers
Опубликована
17 июн 2026

Rhea-4B-Coding-max

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

Дообученная модель Qwen3 с 3,7 млрд параметров для генерации, анализа и отладки кода с многоэтапной самопроверкой.

1 676скачиваний за 30 дней8лайковвеса обновлены23 ноя 2026

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

Rhea-4B-Coding — дообученная Roskosmos19 модель семейства Qwen3 для программирования, построенная на базе Aquiles-ai/Athenea-4B-Coding. Она предназначена для рассуждений о коде, генерации и дополнения программ, отладки, проектирования алгоритмов и понимания кода. Модель использует многоэтапный подход: сначала предлагает реализацию, затем проверяет её на ошибки, граничные случаи, безопасность и производительность, после чего формирует итоговый вариант. Также заявлена поддержка инструментов для агентных сценариев.

Модель имеет плотную архитектуру Qwen3ForCausalLM, содержит 3,7 млрд параметров и принимает текст. В метаданных указан контекст до 262 144 токенов; карточка заявляет обучение на программных данных с трассами рассуждений и примерами на нескольких языках программирования. Модель распространяется в формате Safetensors под лицензией Apache-2.0.

Карточка описывает её как экспериментальную модель для исследований и экспериментов, отмечая uncensored-характер базовой версии. Результаты могут содержать ошибки, поэтому сгенерированный код следует проверять; характеристики многоэтапного рассуждения и агентной работы приведены разработчиком и не гарантируют качество в конкретной задаче.

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

  • генерация кода по текстовому описанию
  • поиск ошибок и уязвимостей в коде
  • проверка граничных случаев и оптимизация реализации
  • проектирование алгоритмов и решение задач программирования
  • объяснение и анализ исходного кода
  • подготовка кода для агентных сценариев с инструментами

Ограничения

Модель может допускать ошибки в коде и оценках безопасности, поэтому результаты требуют проверки. Заявленные многоэтапное рассуждение и поддержка агентных инструментов не гарантируют качество выполнения конкретных задач.

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

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

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

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

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

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

Открыть на Hugging Face

[!NOTE] Korrektur / Correction (2026-11-23)

DE: Die Gewichte in diesem Repo sind Byte für Byte identisch mit Aquiles-ai/Athenea-4B-Coding (SHA-256 der Safetensors-Dateien verglichen). Geändert wurden nur Konfiguration, Chat-Template bzw. Doku. Aussagen über zusätzliches Training oder bessere Benchmark-Werte beziehen sich daher nicht auf andere Gewichte als das Original.

EN: The weights in this repo are byte-identical to Aquiles-ai/Athenea-4B-Coding (SHA-256 of the safetensors files compared). Only configuration, chat template and/or documentation were changed. Claims about additional training or improved benchmark scores therefore do not refer to weights that differ from the original.

image

🛠️ Repository fix (2026-11-13)

EN: The repo could not be loaded with 🤗 Transformers before this update: model.safetensors.index.json contained a tokenizer config instead of the weight map, and the tokenizer/chat-template files used corrupted special tokens (||<|im_start|>, <|eos|>, <|thinking|>), so prompts were tokenized wrongly. Fixed: valid weight index (398 tensors, 2 shards), clean tokenizer_config.json / special_tokens_map.json / added_tokens.json, a chat template with correct <|im_start|>/<|im_end|>/<think> tokens (Rhea's default system prompt kept), min_new_tokens=1024 removed from generation_config.json, and the repo id in the code examples corrected to roskosmos19/Rhea-4B-Coding-max. The weights were not changed. <review> and <final> are plain-text tags, not tokenizer special tokens.

DE: Vor diesem Update ließ sich das Repo nicht mit 🤗 Transformers laden: model.safetensors.index.json enthielt eine Tokenizer-Konfiguration statt der Gewichtszuordnung, und Tokenizer/Chat-Template nutzten beschädigte Spezial-Tokens (||<|im_start|>, <|eos|>, <|thinking|>), wodurch Prompts falsch tokenisiert wurden. Behoben: gültiger Gewichtsindex (398 Tensoren, 2 Shards), saubere tokenizer_config.json / special_tokens_map.json / added_tokens.json, Chat-Template mit korrekten <|im_start|>/<|im_end|>/<think>-Tokens (Rheas Standard-Systemprompt bleibt erhalten), min_new_tokens=1024 aus generation_config.json entfernt, Repo-ID in den Codebeispielen auf roskosmos19/Rhea-4B-Coding-max korrigiert. Die Gewichte wurden nicht verändert. <review> und <final> sind reine Text-Tags, keine Spezial-Tokens des Tokenizers.

GGUF: community quants / Community-Quantisierungen: mradermacher/Rhea-4B-Coding-max-GGUF

Rhea-4B-Coding is an optimized version of Aquiles-ai/Athenea-4B-Coding, specialized in code reasoning, debugging, agentic tools and multi-pass problem solving.

Trained on high-quality programming data with explicit reasoning traces using thinking and 思考结束 tags, the model is designed to perform detailed 3-pass reasoning for software development, algorithm design, and code comprehension tasks:

  1. Pass 1: First implementation
  2. Pass 2: Self-review for bugs, edge cases, security, performance
  3. Pass 3: Final optimized version with identical functionality

⚠️ Important Note: This model uses an uncensored base version, providing full expressive freedom and unrestricted output generation. Users are fully responsible for any use or content produced by the model. It is intended exclusively for research and experimentation purposes.

🎯 Model Description

Rhea-4B-Coding extends Athenea-4B-Coding's structured reasoning capabilities into programming-related domains with multi-pass processing, showing strong performance on logical problem-solving, code completion, debugging scenarios, and iterative code refinement.

Key features:

  • Multi-Pass Processing: 3-step reasoning with <think>, <review>, and <final> tags
  • Agentic Tools for AI Agents
  • Step-by-step code reasoning within thinking blocks
  • Self-review capabilities for bug detection and optimization
  • Specialization in algorithmic and debugging tasks
  • Uncensored output generation for full reasoning visibility
  • Improved logical consistency through focused fine-tuning
  • Compatible with open inference frameworks (Transformers, vLLM, etc.)

The model was fine-tuned using the dataset Aquiles-ai/Athenea-Coding-100k, which includes diverse programming challenges, structured reasoning chains, and natural language explanations across multiple programming languages.

🔄 Multi-Pass Architecture

The model uses special tokens for structured reasoning:

TokenPurpose
<think>Start of self-review phase (Pass 2)
</think>End of self-review phase
<review>Start of review results documentation
</review>End of review results
<final>Start of final optimized version (Pass 3)
</final>End of final version

This structure ensures identical functionality across all passes while improving code structure, comments, and robustness.

💻 Usage

Installation

uv pip install transformers torch accelerate

Basic Inference

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained("roskosmos19/Rhea-4B-Coding-max",
        dtype=torch.bfloat16,
        trust_remote_code=True,
        device_map="auto",
        attn_implementation="flash_attention_2") # Requires flash-attn

# Without flash-attn:
# model = AutoModelForCausalLM.from_pretrained("roskosmos19/Rhea-4B-Coding-max",
#     dtype="auto",
#     device_map="auto"
# )

tokenizer = AutoTokenizer.from_pretrained("roskosmos19/Rhea-4B-Coding-max", trust_remote_code=True)

messages = [
    {"role": "user", "content": "Hey, write a Python function that calculates the factorial of a number recursively."}
]

inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to('cuda')

with torch.no_grad():
    output = model.generate(
        **inputs,
        max_new_tokens=16384,  # Increased for multi-pass output
        pad_token_id=tokenizer.pad_token_id,
        eos_token_id=tokenizer.eos_token_id,
    )

# Decode and print the output
print(tokenizer.decode(output[0], skip_special_tokens=False))

Multi-Pass Inference (Recommended)

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model = AutoModelForCausalLM.from_pretrained("roskosmos19/Rhea-4B-Coding-max",
        dtype=torch.bfloat16,
        trust_remote_code=True,
        device_map="auto")

tokenizer = AutoTokenizer.from_pretrained("roskosmos19/Rhea-4B-Coding-max", trust_remote_code=True)

def generate_multi_pass(prompt, max_tokens_per_pass=4096):
    """
    Generate code with 3-pass reasoning:
    Pass 1: First implementation
    Pass 2: Self-review
    Pass 3: Final optimized version
    """
    
    # Pass 1: First implementation
    messages = [{"role": "user", "content": prompt}]
    inputs = tokenizer.apply_chat_template(
        messages,
        add_generation_prompt=True,
        tokenize=True,
        return_dict=True,
        return_tensors="pt",
    ).to('cuda')
    
    with torch.no_grad():
        output1 = model.generate(
            **inputs,
            max_new_tokens=max_tokens_per_pass,
            temperature=0.4,
            pad_token_id=tokenizer.pad_token_id,
            eos_token_id=tokenizer.eos_token_id,
        )
    
    pass1 = tokenizer.decode(output1[0], skip_special_tokens=False)
    
    # Pass 2: Self-review
    review_prompt = pass1 + "\n<<think>\n### PASS 2 - Self-Review:\n"
    inputs2 = tokenizer(review_prompt, return_tensors="pt").to('cuda')
    
    with torch.no_grad():
        output2 = model.generate(
            **inputs2,
            max_new_tokens=2048,
            temperature=0.3,
            pad_token_id=tokenizer.pad_token_id,
            eos_token_id=tokenizer.eos_token_id,
        )
    
    review = tokenizer.decode(output2[0], skip_special_tokens=False)
    
    # Pass 3: Final version
    final_prompt = review + "\n<<final>\n### PASS 3 - Final Version:\n"
    inputs3 = tokenizer(final_prompt, return_tensors="pt").to('cuda')
    
    with torch.no_grad():
        output3 = model.generate(
            **inputs3,
            max_new_tokens=max_tokens_per_pass,
            temperature=0.2,
            pad_token_id=tokenizer.pad_token_id,
            eos_token_id=tokenizer.eos_token_id,
        )
    
    final = tokenizer.decode(output3[0], skip_special_tokens=False)
    
    return {
        "pass1": pass1,
        "review": review,
        "pass3": final
    }

# Example usage
result = generate_multi_pass("Write a Python function for binary search")
print("=== PASS 1 ===")
print(result["pass1"])
print("\n=== REVIEW ===")
print(result["review"])
print("\n=== FINAL ===")
print(result["pass3"])

Streaming Inference

from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
import torch
from threading import Thread

model = AutoModelForCausalLM.from_pretrained("roskosmos19/Rhea-4B-Coding-max",
        dtype=torch.bfloat16,
        trust_remote_code=True,
        device_map="auto",
        attn_implementation="flash_attention_2")

tokenizer = AutoTokenizer.from_pretrained("roskosmos19/Rhea-4B-Coding-max", trust_remote_code=True)

messages = [
    {"role": "user", "content": "Hey, write a Python function that implements the binary search algorithm recursively."}
]

inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    tokenize=True,
    return_dict=True,
    return_tensors="pt",
).to('cuda')

# Create the streamer
streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=False)

# Build kwargs for generate
generate_kwargs = dict(
    **inputs,
    max_new_tokens=16384,  # Increased for multi-pass output
    pad_token_id=tokenizer.pad_token_id,
    eos_token_id=tokenizer.eos_token_id,
    streamer=streamer,
)

def _generate_thread(model, kwargs):
    with torch.no_grad():
        model.generate(**kwargs)

thread = Thread(target=_generate_thread, args=(model, generate_kwargs))
thread.start()

for chunk in streamer:
    print(chunk, end="", flush=True)

Production Deployment with vLLM

Start server:

vllm serve roskosmos19/Rhea-4B-Coding-max \
  --host 0.0.0.0 \
  --port 8000 \
  --api-key dummyapikey \
  --max-model-len=262144 \
  --async-scheduling \
  --gpu-memory-utilization=0.90

Request to the server from the OpenAI client:

from openai import OpenAI
client = OpenAI(api_key="dummyapikey", base_url="http://127.0.0.1:8000/v1")
stream = client.chat.completions.create(
    model="roskosmos19/Rhea-4B-Coding-max",
    messages=[{
        "role": "user",
        "content": "Hey, write a Python function that determines if a string is a palindrome, ignoring case, spaces, and punctuation."
    }],
    max_tokens=16384,  # Increased for multi-pass output
    stream=True
)
for chunk in stream:
    if chunk.choices[0].delta.content:
        print(chunk.choices[0].delta.content, end="", flush=True)

vLLM Benefits: 20-30x faster inference, OpenAI-compatible API, continuous batching, async scheduling.

📝 Model Configuration

ParameterValueDescription
temperature0.4Balanced creativity and consistency
max_new_tokens32768Full multi-pass output capacity
repetition_penalty1.0No penalty for intentional code repetition
no_repeat_ngram_size0Allows code structure repetition
use_cachetrueFaster inference for long outputs

⚙️ Files Modified for Multi-Pass

FileChanges
generation_config.jsonExtended tokens, optimized for multi-pass
config.jsonEnabled caching, full context window
tokenizer_config.jsonAdded <think>, <review>, <final> tokens
special_tokens_map.jsonRegistered new special tokens
chat_template.jinja3-pass prompt structure

Intended use & limitations / Einsatzzweck & Einschränkungen

EN:

  • Intended for research and experimentation in code reasoning, debugging and agentic workflows.
  • The base is uncensored: outputs are not safety-filtered. Do not expose it to end users in production without your own safeguards.
  • Generated code can be wrong or insecure; review and test it before running.
  • No own benchmark evaluation was run for this repo.

DE:

  • Gedacht für Forschung und Experimente rund um Code-Reasoning, Debugging und agentische Abläufe.
  • Die Basis ist unzensiert: Ausgaben werden nicht gefiltert. Nicht ohne eigene Schutzmaßnahmen produktiv für Endnutzer einsetzen.
  • Generierter Code kann falsch oder unsicher sein; vor dem Ausführen prüfen und testen.
  • Für dieses Repo wurden keine eigenen Benchmarks gemessen.

🤝 Credits

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen3ForCausalLM
Ревизия весов
75fcf26

0 моделей