Gemma4-12B for grammatical error correction

google/gemma-4-12B-it finetuned (full finetune) for grammatical error correction of Ukrainian, German and English texts.

Prompt

Send the text to correct as a single user message, prefixed with this instruction ({text} is the text to correct):

Correct all language errors in the following text. Return only the corrected text. Text to correct:
{text}

The model returns only the corrected text. Use the chat template shipped in this repo (chat_template.jinja) with thinking disabled (enable_thinking=False). vLLM and tokenizer.apply_chat_template apply it for you; the full prompt the model sees is:

<bos><|turn>user
Correct all language errors in the following text. Return only the corrected text. Text to correct:
{text}<turn|>
<|turn>model
<|channel>thought
<channel|>

Usage (vLLM)

vllm serve rstaruch/gemma4-12b-gec --language-model-only
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
text = "..."  # the text to correct
response = client.chat.completions.create(
    model="rstaruch/gemma4-12b-gec",
    messages=[{"role": "user", "content": "Correct all language errors in the following text. Return only the corrected text. Text to correct:\n{text}".format(text=text)}],
    temperature=0,
)
print(response.choices[0].message.content)

Use greedy decoding (temperature=0): generation_config.json keeps the base model's sampling defaults.

License

This model is released under CC BY-NC 4.0: you may use, share and adapt it for research and other non-commercial purposes, with attribution. Commercial use is not permitted.

It is a finetune of google/gemma-4-12B-it, which is licensed under Apache-2.0; the base model remains under its original licence.

Downloads last month
116
Safetensors
Model size
12B params
Tensor type
BF16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for rstaruch/gemma4-12b-gec

Finetuned
(339)
this model