/ Модель

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

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

Rhea-4B-Coding-max

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

Производная модели roskosmos19/Orca-2-4B-Coding-max. Дообученная модель Qwen3 на 3,7 млрд параметров для написания, анализа и отладки кода с многошаговой самопроверкой.

521скачиваний за 30 дней2лайкавеса обновлены21 сен 2026

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Карточка модели roskosmos19/Rhea-4B-Coding-max на Hugging Face совпадает с карточкой roskosmos19/Orca-2-4B-Coding-max, поэтому описание составлено по ней.

Rhea-4B-Coding — дообученная Roskosmos19 модель для программирования на базе Aquiles-ai/Athenea-4B-Coding. Это плотная авторегрессионная модель семейства Qwen3 с 3,7 млрд параметров; она работает через Transformers, принимает текст и генерирует текст. В карточке заявлено контекстное окно до 262 144 токенов.

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

Модель рассчитана на задачи разработки с несколькими языками программирования; метаданные указывают английский язык. Карточка описывает её как uncensored и предназначенную для исследований и экспериментов. Лицензия — Apache-2.0. Качество рассуждений и работы с инструментами зависит от запроса и настроек инференса; отдельные результаты оценки в карточке не приведены.

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

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

Ограничения

В карточке не приведены результаты сравнительных оценок; качество зависит от задачи и настроек генерации. Заявленная поддержка агентных инструментов сама по себе не гарантирует совместимость с конкретной средой или протоколом.

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

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

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

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

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

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

Открыть на Hugging Face

image

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",
        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",
#     dtype="auto",
#     device_map="auto"
# )

tokenizer = AutoTokenizer.from_pretrained("Roskosmos19/Rhea-4B-Coding", 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",
        dtype=torch.bfloat16,
        trust_remote_code=True,
        device_map="auto")

tokenizer = AutoTokenizer.from_pretrained("Roskosmos19/Rhea-4B-Coding", 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",
        dtype=torch.bfloat16,
        trust_remote_code=True,
        device_map="auto",
        attn_implementation="flash_attention_2")

tokenizer = AutoTokenizer.from_pretrained("Roskosmos19/Rhea-4B-Coding", 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 \
  --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",
    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

🤝 Credits

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей