---
license: apache-2.0
license_link: https://ai.google.dev/gemma/docs/gemma_4_license
base_model: google/gemma-4-E4B-it
base_model_relation: finetune
library_name: mlx
language:
- en
- hi
pipeline_tag: text-generation
tags:
- gemma4
- grammar
- grammar-correction
- writing
- rewriting
- tone
- hindi
- hinglish
- on-device
- lora
- iris
- apple-silicon
model-index:
- name: iris-gemma-4-e4b-it-mlx
results:
- task:
type: text-generation
name: English Fix
dataset:
type: iris-blind-test
name: Iris blind test, English Fix (50 drafts)
metrics:
- type: accuracy
name: accepted (%)
value: 90
- task:
type: text-generation
name: Professional and Friendly
dataset:
type: iris-blind-test
name: Iris blind test, Professional and Friendly (100 answers)
metrics:
- type: accuracy
name: would send (%)
value: 93
- task:
type: text-generation
name: Shorter and Clearer
dataset:
type: iris-blind-test
name: Iris blind test, Shorter and Clearer (100 answers)
metrics:
- type: accuracy
name: would send (%)
value: 90
- task:
type: text-generation
name: Funny
dataset:
type: iris-blind-test
name: Iris blind test, Funny (50 answers)
metrics:
- type: accuracy
name: would send (%)
value: 66
- task:
type: text-generation
name: Hindi and Hinglish, Fix (into English)
dataset:
type: iris-blind-test
name: Iris blind test, Hindi and Hinglish, Fix (into English) (82 drafts)
metrics:
- type: accuracy
name: accepted (%)
value: 95
- task:
type: text-generation
name: Hindi and Hinglish, tones (into English)
dataset:
type: iris-blind-test
name: Iris blind test, Hindi and Hinglish, tones (into English) (240 answers)
metrics:
- type: accuracy
name: would send (%)
value: 76
---

# Iris Gemma 4 E4B (MLX)
The writing model inside [Iris](#about-iris), an on-device grammar and tone app: **"Best quality"** in the app.
It does two jobs and is trained for nothing else:
- **Fix** corrects spelling, grammar, capitals and punctuation, and changes nothing else. Your words, short forms,
slang and casual voice stay as you typed them. A message with no mistakes comes back unchanged.
- **Tones** rewrite a message as **Professional**, **Friendly**, **Shorter**, **Clearer** or **Funny**, keeping every point,
who does what, and the questions as questions.
It reads English, Hindi (Devanagari) and Hinglish (Hindi typed in English letters), and always answers in English.
| **Pick this one for** | the best answers, and the one to use for Hindi and Hinglish. For Macs with 16 GB of memory or more. |
|---|---|
| **The other one** | Lighter (E2B): [iris-gemma-4-e2b-it-mlx](https://huggingface.co/ImAXISOG/iris-gemma-4-e2b-it-mlx) |
| **All Iris models** | [Iris writing models](https://huggingface.co/collections/ImAXISOG/iris-writing-models-6afd5f1c54a5d9692f56c625) |
| **Files** | MLX, 4-bit (group size 64), 4.54 GB (this repo). For Windows and llama.cpp: [iris-gemma-4-e4b-it-gguf](https://huggingface.co/ImAXISOG/iris-gemma-4-e4b-it-gguf) (4.58 GB). |
| **Based on** | Google's [google/gemma-4-E4B-it](https://huggingface.co/google/gemma-4-E4B-it), fine-tuned with LoRA |
| **License** | Apache 2.0, a modified version of Gemma 4 (see [License](#license)) |
## Which one should I use?
| Your computer | Use | Memory it needs |
|---|---|---|
| Mac with 16 GB or more | Best quality: [iris-gemma-4-e4b-it-mlx](https://huggingface.co/ImAXISOG/iris-gemma-4-e4b-it-mlx) | 3.6 GB at peak |
| Mac with 8 GB | Lighter: [iris-gemma-4-e2b-it-mlx](https://huggingface.co/ImAXISOG/iris-gemma-4-e2b-it-mlx) | 2.9 GB at peak |
| Windows PC with 16 GB or more | Best quality: [iris-gemma-4-e4b-it-gguf](https://huggingface.co/ImAXISOG/iris-gemma-4-e4b-it-gguf) | 3.9 GB, plus the 4.6 GB file kept in memory: 8.4 GB in all |
| Windows PC with 8 GB | Lighter: [iris-gemma-4-e2b-it-gguf](https://huggingface.co/ImAXISOG/iris-gemma-4-e2b-it-gguf) | 1.9 GB, plus the 2.8 GB file kept in memory: 4.8 GB in all |
If Hindi or Hinglish matters most, use Best quality whenever the computer has 16 GB: on Hindi Fix it is accepted
95% of the time against Lighter's 71%. On Windows the model file counts too: when memory runs short, Windows drops
the file from memory and reads it from disk again, and answers slow down. That is why Best quality needs a 16 GB PC
even though its own memory is under 4 GB.
The Mac rows are the rule Iris uses at setup. The Windows numbers were measured with llama.cpp on a Mac's processor
cores. Neither has been confirmed yet on a real Windows PC or on an 8 GB computer of either kind.
## Results

| | Gemma 4 E4B-it, untrained | Iris Lighter (E2B) | Iris Best quality (E4B) |
|---|---|---|---|
| English Fix: accepted (50 drafts) | 52% | 86% | **90%** |
| Professional and Friendly: would send (100 answers) | 86% | 88% | **93%** |
| Shorter and Clearer: would send (100 answers) | 75% | 86% | **90%** |
| Funny: would send (50 answers) | 4% | 56% | **66%** |
| Hindi and Hinglish, Fix (into English): accepted (82 drafts) | 91% | 71% | **95%** |
| Hindi and Hinglish, tones (into English): would send (240 answers) | 71% | 47% | **76%** |
Judged blind by an AI model, answer by answer, on drafts written only for testing (see [How it was tested](#how-it-was-tested)).
Gaps under about 8 points are within noise.
## Examples
Real answers from this file, unedited, to drafts written for this card (temperature 0, Iris's prompts).
All 30 answers are in [`examples.jsonl`](https://huggingface.co/ImAXISOG/iris-gemma-4-e4b-it-mlx/resolve/main/examples.jsonl).
| | |
|---|---|
| **Draft** | hey are we still on for tmrw? i didnt got the slides yet, can u send them before 10 |
| **Fix** | hey are we still on for tmrw? I didn't get the slides yet, can u send them before 10? |
| **Professional** | Hi, are we still on for tomorrow? I have not received the slides yet. Could you send them before 10? |
| **Friendly** | Hey, are we still on for tomorrow? I haven't got the slides yet, could you send them before 10? Thanks! |
| **Shorter** | Hey, still on for tmrw? I haven't got the slides yet, can u send them before 10? |
| **Clearer** | Hey, are we still on for tomorrow? Can you send the slides before 10? I haven't got them yet. |
| **Funny** | Hey, are we still on for tmrw? I didn't get the slides yet, can u send them before 10? My presentation is currently running on hope. |
Hinglish and Hindi come back in English, keeping who does what:
| Draft | Mode | Answer |
|---|---|---|
| bhai kal meeting 11 baje hai, report tum bhej dena main slides bana dunga | Fix | Bro, the meeting is at 11 tomorrow, you send the report and I'll make the slides. |
| | Professional | The meeting is tomorrow at 11. Please send the report, and I will prepare the slides. |
| माफ़ कीजिए, आज मैं थोड़ा देर से आऊँगा, ट्रेन लेट है। | Fix | Sorry, I'll be a little late today, the train is late. |
A complaint stays a complaint, and Funny stays out of it:
| Draft | Mode | Answer |
|---|---|---|
| the new pump arrived damaged, this is the second time this month and nobody from your team has called me back | Professional | The new pump arrived damaged. This is the second time this month, and nobody from your team has called me back. |
| | Funny | The new pump arrived damaged, this is the second time this month and nobody from your team has called me back. |
## Memory and speed

- **Mac (MLX, Apple silicon):** peak 3.6 GB (4.2 GB at the longest message Iris takes, 6,000 characters), measured through Iris's own loader after a real download;
about 0.3 s for a typical answer on an M5 Pro.
- **Windows (GGUF, llama.cpp, processor only):** 3.9 GB of its own memory plus the 4.58 GB file, which
the system keeps in memory when it has room (8.4 GB in all); about 1.05 s an answer. Suggested: 16 GB or more of RAM.
Measured on a Mac's processor cores with no graphics chip, not yet on a Windows laptop.
## How to use
### Python (mlx-lm)
Tested with `mlx-lm` 0.32.2 on Apple silicon; it gives the same answers as the Iris app:
```python
from mlx_lm import load, generate
model, tokenizer = load("ImAXISOG/iris-gemma-4-e4b-it-mlx")
FIX = ("Proofread the message between and . Correct only clear mistakes in spelling, grammar, "
"capitalization and punctuation. Change nothing else: keep the writer's words, style, short forms, emoji, "
"numbers and line breaks. Copy placeholders like {{1}} exactly once. If there are no mistakes, return the "
"message exactly as it is. Reply with only the corrected message.")
TONE = ("Rewrite the message in a {tone} tone. {instruction}\nKeep every point of the draft and add nothing. "
"Keep who does what, and keep questions as questions. Fix grammar and spelling. Copy placeholders like "
"{{{{1}}}} exactly once. No em dashes. Reply with only the rewritten message.")
SHORTER = "Make it as short as possible by cutting filler words and repetition. Every fact, question, request, and condition stays."
def ask(system, user):
messages = [{"role": "system", "content": system}, {"role": "user", "content": user}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, enable_thinking=False)
return generate(model, tokenizer, prompt=prompt, max_tokens=400) # greedy (temperature 0) by default
draft = "hey are we still on for tmrw? i didnt got the slides yet, can u send them before 10"
print(ask(FIX, f"\n{draft}\n")) # Fix wraps the draft in tags
print(ask(TONE.format(tone="shorter", instruction=SHORTER), draft)) # tones take the bare draft
```
`mlx-lm` loads the whole model and peaks at about 5.4 GB. Iris reads the per-layer word table
(`embed_tokens_per_layer`) from disk a row at a time and skips the picture layers, which brings the peak down to
3.6 GB with the same answers word for word. Iris also uses the drafter
[mlx-community/gemma-4-E4B-it-assistant-bf16](https://huggingface.co/mlx-community/gemma-4-E4B-it-assistant-bf16) to answer faster.
### In Iris
Iris downloads this model when you pick "Best quality" in setup or Settings, and runs it on your Mac.
### The prompts it was trained with
The model learned Iris's short instructions, with thinking turned off. Other prompts work but were not measured.
Fix (English)
The draft goes in the user turn as `\n...\n`.
```text
Proofread the message between and . Correct only clear mistakes in spelling, grammar, capitalization and punctuation. Change nothing else: keep the writer's words, style, short forms, emoji, numbers and line breaks. Copy placeholders like {{1}} exactly once. If there are no mistakes, return the message exactly as it is. Reply with only the corrected message.
```
Fix for a message written in Hindi or Hinglish
Iris sends this system prompt, then one example pair (user: `maine invoice bhej diya hai, kal tak payment aa jayega`,
assistant: `I've sent the invoice, the payment will come by tomorrow`), then the draft as it is.
```text
The user's message is written in Hindi, usually in Latin letters (Hinglish), sometimes in Devanagari. Translate it into natural English.
- Keep the meaning, facts, names, numbers, and requests exactly. Keep commitments as firm as written.
- Keep who does what: "bhej dena" asks the reader to send; "bhej dunga" means the writer will send.
- Keep the tone: a casual message stays casual. Don't add greetings or sign-offs.
- Placeholders like {{1}} stand for names, links, and code. Copy every placeholder exactly once, in the same place.
- Reply with only the English translation: no Hindi words, no quotes, no labels, no explanation.
```
Tones
The draft goes in the user turn as it is. `{tone}` is the tone's name in lower case.
```text
Rewrite the message in a {tone} tone. {instruction}
Keep every point of the draft and add nothing. Keep who does what, and keep questions as questions. Fix grammar and spelling. Copy placeholders like {{1}} exactly once. No em dashes. Reply with only the rewritten message.
```
- **Professional**: Sound clear and professional, like a capable colleague. Not stiff or flowery: no "I hope this finds you well", no "kindly". Professional changes how a thing is said, never whether it is said: a complaint, a disagreement, a refusal, frustration, an apology, thanks, and a courtesy like "I know it's late" all stay, put calmly and plainly. Never drop a point because it is blunt, and never soften a complaint into a request. Keep the point, not the wording: say each point in plain professional words, turning slang, sarcasm, insults and filler words like "really" or "super" into calm, direct language, so it reads as a colleague wrote it, not as the draft with its spelling fixed.
- **Friendly**: Sound warm and easygoing, like a teammate people enjoy working with. Use contractions and plain, everyday words. Show warmth with words, never emoji: every rewrite gets one warm touch, such as a thanks, a word of acknowledgment, or a friendly opener like "Hey" or "Quick heads-up:". When the message is routine, one light, good-natured turn of phrase can make it friendlier; leave it out for bad news, apologies, complaints, or anything urgent, and never use sarcasm or joke about anyone. At most one exclamation mark. No filler openers like "Hope you're doing well". Be warm in the wording, never by hedging: if it says something will happen, it still will.
- **Shorter**: Make it as short as possible by cutting filler words and repetition. Every fact, question, request, and condition stays.
- **Clearer**: Restructure it so the reader knows what to do on the first read: put the main point or request in the first sentence, then the details. Split long sentences, use everyday words, and use a short list when there are several items or steps.
- **Funny**: Add one light, good-natured touch of humor beside the message and change nothing else: keep the message's own words, and invent no facts or details. Never joke about people, mistakes, or anything sensitive. When humor doesn't fit (bad news, an apology, a complaint), only tidy the message.
## How it was made

| **Starting point** | Google's [google/gemma-4-E4B-it](https://huggingface.co/google/gemma-4-E4B-it), as the 4-bit MLX copy [mlx-community/gemma-4-e4b-it-4bit](https://huggingface.co/mlx-community/gemma-4-e4b-it-4bit) (what Iris used before), with thinking switched off in the chat template |
|---|---|
| Lessons | 10,200 distinct examples (13,439 rows: some lessons appear more than once), 408 held back to check progress |
| Where lessons came from | Drafts and answers written and reviewed with AI models; Hindi and Hinglish translations reviewed by AI reviewers who corrected tense, idiom and who-does-what. None is taken from the test drafts, and lessons that resembled a test draft were dropped. Not released. |
| Method | LoRA on every layer: rank 16, scale 20, dropout 0.05; loss on the answers only (prompts masked) |
| Schedule | One pass, 3,360 steps, batch 4, learning rate 5e-5 with cosine decay to 2e-6, 20 warm-up steps, up to 2,048 tokens |
| Hardware | One Apple M5 Pro Mac, 2 h 17 min, with `mlx-lm` |
| Held-back loss | 0.223 |
| Afterwards | Adapter merged into the weights; 4-bit (group size 64); audio weights removed (picture weights kept so stock loaders work) |
| GGUF | Converted with llama.cpp's `convert_hf_to_gguf.py`, quantized to Q4_K_M, with the per-layer word table (`per_layer_token_embd`) at Q4_K |
## How it was tested
- **Drafts:** messages people type at work and to friends and family, written only for testing and never shown to
whoever wrote the lessons: 50 English drafts (Fix and all five tones), 82 Hindi and Hinglish drafts for Fix, and
240 tone answers on Hindi and Hinglish drafts.
- **Answers:** through the same code the app uses. The trained models at temperature 0 with Iris's short prompts; the
untrained model as Iris ran it before, with Iris's longer prompts (worked examples included) and its usual settings.
- **Judge:** an AI model, blind: the answers of all three models to a draft were shown together in shuffled order,
with no model names, and judged against written rules.
- **Fix "accepted":** no real mistake left and nothing changed beyond trivial tidying (a reworded phrase, an expanded
short form or a lost casual voice counts against it). For Hindi drafts: an accurate, natural English version.
- **Tones "would send":** the writer could send it in place of the draft: the same meaning, the tone asked for, and
it reads naturally.
- **The GGUF file** was judged on the answers that differ from the MLX model's. Against the MLX model, counted over two judging rounds (MLX against the standard Q4_K_M, then that against this smaller file): English Fix 1 fewer good answer of 50, English tones 1 fewer of 200, Funny 6 fewer of 50, Hindi and Hinglish Fix 1 more of 82, Hindi and Hinglish tones 3 more of 240.
## Limitations
- **Answers in English only.** Hindi and Hinglish drafts are read and answered in English.
- **Not a chat assistant.** It was trained for Fix and the five tones; questions or other tasks in a draft are
rewritten, not answered. Picture input was not trained or tested.
- **Funny** is the weakest tone: good enough to send 66% of the time in the test.
- **Judged by an AI model,** not by people. Its rules are strict, but it can still be wrong.
- **Not tested yet:** an 8 GB Mac or a real Windows laptop, long documents (memory only), custom tones, a writer's
own style rules, and the drafter in llama.cpp.
- Iris checks every answer before showing it (for example, that names, links and code kept as placeholders come back
exactly once). Used on its own, the model has no such checks.
## About Iris
Iris is a grammar and tone app that runs entirely on your computer: press a shortcut in any app to fix or rewrite
what you wrote. macOS now, Windows planned.
## License
Apache License 2.0 (`LICENSE`). This is a modified version of Google's Gemma 4 E4B-it
([google/gemma-4-E4B-it](https://huggingface.co/google/gemma-4-E4B-it), [Gemma 4 license](https://ai.google.dev/gemma/docs/gemma_4_license)):
fine-tuned with LoRA on writing lessons, merged, quantized, audio weights removed.