You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

RastNus-Base-12B

RastNus-Base-12B

ڕاستنووس — Kurdish Grammar & Spelling Correction

Built by PawanKrd · Based on Google Gemma 4 12B · Apache 2.0

License Language Base Org


Overview

RastNus (ڕاستنووس, "correct writing") is a 12-billion-parameter language model specialized in grammar, spelling, and punctuation correction for Central Kurdish (Sorani / کوردیی ناوەندی).

Kurdish is one of the most under-served languages in modern NLP. Everyday written Sorani commonly contains orthographic inconsistencies — missing diacritic letters (ی/ێ, و/ۆ, ر/ڕ), spacing errors, informal punctuation, and mixed loanword usage. RastNus takes raw Sorani text and returns a clean, standardized, correctly written version, while preserving the author's meaning and voice.

RastNus is developed and released by PawanKrd as part of our commitment to bringing state-of-the-art AI to the Kurdish language and its speakers.

Key Capabilities

  • Spelling correction — fixes common orthographic errors and non-standard letter usage (e.g. کتیبکتێب, زورزۆر, مروفمرۆڤ)
  • Grammar correction — repairs agreement, morphology, and word-form errors
  • Punctuation control — optionally adds and normalizes punctuation, or leaves punctuation untouched, via a dedicated control token
  • Pure Kurdish mode — optionally replaces non-Kurdish loanwords with pure Kurdish equivalents, via a dedicated control token
  • Meaning-preserving — corrects without paraphrasing, summarizing, or adding content

Model Family

Model Status
RastNus-Large Not publicly available - Try it now
RastNus-Medium Under development
RastNus-Base ✅ You are here
RastNus-Small Under development
RastNus-Tiny Under development

Example

Input

خویندنەوەی کتیب زور گرنگە بو مروف ، چونکە بیروهۆش دەکاتەوە ئەو کەسە ی کتێب دەخوێنەوە؛ ئاستی رۆشنبیری یان بەرز ترە لەوانی تر

Output

خوێندنەوەی کتێب زۆر گرنگە بۆ مرۆڤ، چونکە بیروهۆش دەکاتەوە. ئەو کەسەی کتێب دەخوێنێتەوە، ئاستی ڕۆشنبیرییان بەرزترە لەوانی تر.

Model Details

Developed by PawanKrd
Model type Causal decoder-only transformer (Gemma 4 architecture)
Base model Google Gemma 4 12B
Parameters ~12B
Language Central Kurdish / Sorani (ckb), Arabic script
Task Text correction (grammar, spelling, punctuation)
Precision bfloat16
Context length Long-context (inherited from Gemma 4); recommended working length up to ~8K tokens per request
License Apache 2.0

Prompt Format & Control Tokens

RastNus uses a task-specific prompt format with dedicated special tokens (added to the tokenizer vocabulary). The behavior of the model is controlled by two switches:

Token Effect
<|punct:on|> / <|punct:off|> Add & normalize punctuation, or leave punctuation untouched
<|pure:on|> / <|pure:off|> Replace non-Kurdish loanwords with pure Kurdish equivalents, or keep original vocabulary

The full sequence layout:

<bos><|task:kurdish_correction|><|punct:on|><|pure:off|><|input|>
{your Kurdish text}
<|output|>
{corrected text}<eos>

You do not need to build this manually — the repository ships with a chat template that handles it (see below). Defaults are punctuationEnabled=True and kurdishPureMode=False.

Usage

Transformers

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_id = "PawanKrd/RastNus-Base-12B"

tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
    model_id, torch_dtype=torch.bfloat16, device_map="auto"
)

text = "خویندنەوەی کتیب زور گرنگە بو مروف"

prompt = tokenizer.apply_chat_template(
    [{"role": "user", "content": text}],
    tokenize=False,
    add_generation_prompt=True,
    punctuationEnabled=True,   # add/normalize punctuation
    kurdishPureMode=False,     # keep loanwords as-is
)

inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(**inputs, max_new_tokens=1024, do_sample=False)
print(tokenizer.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Note: pass add_special_tokens=False when tokenizing — the chat template already emits <bos>.

vLLM (OpenAI-compatible server)

vllm serve PawanKrd/RastNus-Base-12B
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="none")

resp = client.chat.completions.create(
    model="PawanKrd/RastNus-Base-12B",
    messages=[{"role": "user", "content": "خویندنەوەی کتیب زور گرنگە بو مروف"}],
    extra_body={"chat_template_kwargs": {
        "punctuationEnabled": True,
        "kurdishPureMode": True,   # enable pure-Kurdish word replacement
    }},
    temperature=0.0,
)
print(resp.choices[0].message.content)

Recommended Generation Settings

  • Greedy decoding (do_sample=False / temperature=0) — correction is a deterministic task
  • max_new_tokens ≈ 1.5 × input token count (the corrected output is roughly the same length as the input)
  • For documents longer than ~4,000–5,000 characters, split at sentence/paragraph boundaries, correct each chunk, and rejoin

Intended Use & Limitations

Intended uses: proofreading and standardization of Sorani text in publishing, education, journalism, document processing, writing assistants, and any pipeline that needs clean, orthographically consistent Kurdish.

Limitations:

  • The model targets Central Kurdish (Sorani) written in Arabic script. It is not designed for Kurmanji (Latin script), Zazaki, or other Kurdish varieties.
  • It is a correction model, not a general chat assistant — it expects the task prompt format above and will not follow open-ended instructions.
  • Like all language models, it can occasionally miss errors or over-correct rare proper nouns, dialect-specific spellings, or intentional stylistic choices. Human review is recommended for high-stakes publishing.
  • Pure-Kurdish mode applies vocabulary substitutions that may not match every publication's style guide; review its output for terminology-sensitive content.

About PawanKrd

Pawan.Krd (PKRD, LLC) builds AI and cloud infrastructure — LLMs, ASR, TTS, and related APIs — with a focus on reliability and open models. RastNus is part of that work: first-class writing tools for Kurdish, released openly.


License & Attribution

This model is released under the Apache License, Version 2.0. See the LICENSE file for the full text and the NOTICE file for attribution details.

RastNus-Base-12B is a derivative work of Gemma 4 12B by Google LLC / Google DeepMind, which is also licensed under Apache 2.0. In accordance with the license:

  • The original Apache 2.0 license text is included in this repository.
  • The NOTICE file carries the required attribution to Google and a prominent statement that the model weights, tokenizer, and chat template have been modified by PawanKrd.
  • Gemma is a trademark of Google LLC, used here only to describe the origin of the base model. This project is not affiliated with, endorsed by, or sponsored by Google.

This model is provided "AS IS", without warranties or conditions of any kind. See Sections 7 and 8 of the Apache License for the disclaimer of warranty and limitation of liability.

Citation

@misc{rastnus2026,
  title   = {RastNus-Base-12B: A Central Kurdish (Sorani) Grammar and Spelling Correction Model},
  author  = {PawanKrd},
  year    = {2026},
  url     = {https://huggingface.co/PawanKrd/RastNus-Base-12B},
  note    = {Derivative of Google Gemma 4 12B, Apache License 2.0}
}
Downloads last month
23
Safetensors
Model size
12B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support