schmidt-sebastian's picture
Initial upload of MediaPipe-TextProofreader-200M from MediaPipe Solutions
7f5d112
|
Raw History Blame Contribute Delete
6.69 kB
---
license: gemma
library_name: litert-lm
pipeline_tag: text-generation
tags:
- mediapipe
- litert-lm
- text-generation
- on-device
- python
- android
- ios
- flutter
- nlp
- gemma
- grammar-correction
- proofreading
- int4
- int8
---
# MediaPipe Text Proofreader (200M)
Compact 200M-parameter Gemma model quantized with mixed precision (int4 + int8) (`proofread_quant_200m.litertlm`, 117.6 MB) for identifying and correcting spelling, grammatical, and stylistic errors on-device via the [MediaPipe Text Proofreader (`TextProofreader`)](https://developers.google.com/edge/mediapipe/solutions/text/text_proofreader) task and [LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM).
<div style="border: 1px solid rgba(59, 130, 246, 0.28); background-color: rgba(59, 130, 246, 0.06); border-radius: 8px; padding: 12px 16px; margin: 16px 0;">
<p style="margin: 0 0 6px 0;"><strong>Documentation:</strong> <a href="https://developers.google.com/edge/mediapipe/solutions/text/text_proofreader">MediaPipe Text Proofreader Docs</a></p>
<p style="margin: 0 0 6px 0;"><strong>Samples:</strong> <a href="https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/text_proofreader/android">Android</a> · <a href="https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/text_proofreader/ios">iOS</a> · <a href="https://colab.research.google.com/github/google-ai-edge/mediapipe-samples/blob/main/examples/text_proofreader/python/text_proofreader.ipynb">Python Colab</a> · <a href="https://github.com/google/flutter-mediapipe/tree/main/samples/text/text_proofreader">Flutter</a></p>
<p style="margin: 0;"><strong>Try live:</strong> Browser Web Demo is not yet available for <code>TextProofreader</code> (use the samples above; see <a href="https://google-ai-edge.github.io/mediapipe-samples-web/">MediaPipe Web Demos</a>).</p>
</div>
Designed for Android, iOS, Flutter (Android & iOS), and desktop Python (`mediapipe` + LiteRT-LM runtime). Default context capacity is 8,192 tokens (`max_num_tokens=4096` in the quickstart caps context length), with peak on-device RAM usage around 200 MB–350 MB depending on input length (100 to 2,000 words).
## Files
| File | Precision | Size | SHA-256 |
|---|---|---:|---|
| [`proofread_quant_200m.litertlm`](https://huggingface.co/litert-community/MediaPipe-TextProofreader-200M/blob/main/proofread_quant_200m.litertlm) | `—` | 117.59 MB (117,587,968 B) | `2caa317d5a6f951af6e437edce3bb3a9fdedc85a7a8c2a8fcaec96318d7708cc` |
### Download
```bash
pip install -U huggingface_hub
hf download litert-community/MediaPipe-TextProofreader-200M proofread_quant_200m.litertlm --local-dir .
```
## Inputs, Outputs, and Model Specifications
### `proofread_quant_200m.litertlm`
Self-contained `.litertlm` package bundling the quantized LiteRT prefill/decode subgraphs, SentencePiece tokenizer, and prompt template metadata in a single memory-mapped file.
## Use with MediaPipe Tasks
### Python Quickstart
```bash
pip install -U mediapipe huggingface_hub
```
```python
import mediapipe as mp
from huggingface_hub import hf_hub_download
model_path = hf_hub_download(repo_id="litert-community/MediaPipe-TextProofreader-200M", filename="proofread_quant_200m.litertlm")
BaseOptions = mp.tasks.BaseOptions
TextProofreader = mp.tasks.text.TextProofreader
TextProofreaderOptions = mp.tasks.text.TextProofreaderOptions
options = TextProofreaderOptions(
base_options=BaseOptions(model_asset_path=model_path),
max_num_tokens=4096,
)
with TextProofreader.create_from_options(options) as proofreader:
result = proofreader.proofread("Their are severel typos in this sentance.")
print(result.proofread_text)
```
### Cross-Platform Guides & Samples
- **Task overview & options:** [Text Proofreader documentation](https://developers.google.com/edge/mediapipe/solutions/text/text_proofreader)
- **Platform setup guides:** [Python](https://developers.google.com/edge/mediapipe/solutions/setup_python) · [Android (Kotlin / Java)](https://developers.google.com/edge/mediapipe/solutions/setup_android) · [iOS (Swift)](https://developers.google.com/edge/mediapipe/solutions/setup_ios) · [Flutter (Dart)](https://developers.google.com/edge/mediapipe/solutions/setup_flutter)
- **Runnable sample apps:** [Android](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/text_proofreader/android) · [iOS](https://github.com/google-ai-edge/mediapipe-samples/tree/main/examples/text_proofreader/ios) · [Python Notebook](https://colab.research.google.com/github/google-ai-edge/mediapipe-samples/blob/main/examples/text_proofreader/python/text_proofreader.ipynb) · [Flutter](https://github.com/google/flutter-mediapipe/tree/main/samples/text/text_proofreader)
## Latency Benchmarks
End-to-end Pixel 10 Pro CPU benchmarks reported by the [Text Proofreader documentation](https://developers.google.com/edge/mediapipe/solutions/text/text_proofreader#benchmarks) (peak RAM ≈200 MB–350 MB):
| Device | Input Words (tokens) | Prefill (tokens/s) | Decode (tokens/s) | E2E Latency (ms) |
|---|---|---:|---:|---:|
| Pixel 10 Pro CPU | 100 (≈200 tokens) | 1,280 | 170 | 980 |
| Pixel 10 Pro CPU | 500 (≈900 tokens) | 1,095 | 163 | 4,900 |
| Pixel 10 Pro CPU | 1000 (≈1900 tokens) | 1,025 | 150 | 16,000 |
| Pixel 10 Pro CPU | 2000 (≈3600 tokens) | 980 | 140 | 28,000 |
## Intended Use, Limitations, and Fairness
- **Intended applications:** On-device grammar, spelling, and style proofreading while preserving the user's original meaning and tone without sending private text to the cloud.
- **Terms & limitations:** Subject to the [Gemma Terms of Use](https://ai.google.dev/gemma/terms). Supported on Android, iOS, Flutter (Android/iOS), and desktop Python (`LiteRT-LM` backend; not available on Web or Flutter web). Always review model-generated edits before irreversible actions.
## Provenance
Every model binary in this repository is byte-identical (unmodified LiteRT-LM package bytes) to the official artifact served by Google from `storage.googleapis.com/mediapipe-models`.
| Repo File | Upstream URL | GCS Generation | Upstream `Last-Modified` | Pinned Bucket Version |
|---|---|---|---|---|
| `proofread_quant_200m.litertlm` | [`proofread_quant_200m.litertlm`](https://storage.googleapis.com/mediapipe-models/text_proofreader/200m/latest/proofread_quant_200m.litertlm) | `1786566706550958` | Wed, 12 Aug 2026 20:31:46 GMT | `/1/` |
## License and Citation
- License: `gemma` — Subject to the [Gemma Terms of Use](https://ai.google.dev/gemma/terms), as specified on the MediaPipe task documentation page.
### Citation
Gemma family model packaged for MediaPipe Text Proofreader (`LiteRT-LM`).