Instructions to use litert-community/LFM2.5-Encoder-350M-Spellchecker with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/LFM2.5-Encoder-350M-Spellchecker with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
LFM2.5-Encoder-350M-Spellchecker β LiteRT
LiquidAI/LFM2.5-Encoder-350M-Spellchecker converted to LiteRT (.tflite) for on-device inference. A GECToR-style two-head tagger that corrects misspellings and grammar token by token, fully offline (demo Space).
| File | Recipe | Size | |
|---|---|---|---|
LFM2.5-Encoder-350M-Spellchecker_wi8fc.tflite |
int8 dynamic-range (linears + embedding + tied vocab heads, convs float) | 429 MB | mobile + desktop (iPhone-verified bit-exact, 64 ms) |
LFM2.5-Encoder-350M-Spellchecker_fp16.tflite |
fp16 weights, float compute | 847 MB | desktop β phone memory limits (XNNPACK per-signature fp32 unpacking) |
Signature
gec_128 (S = 128, batch 1, right-padded; the base model's own decode uses max_len 128): input_ids int32 [1, 128] (prepend the tokenizer BOS as the sentence anchor), attention_mask int32 [1, 128] β two outputs, both zeroed at padded positions:
| Output | Shape | Meaning |
|---|---|---|
label_logits |
float32 [1, 128, 128802] |
per-token edit tag: 0 $KEEP, 1 $DELETE, 2..2+V $REPLACE_<piece>, 2+V.. $APPEND_<piece> (V = 64400 BPE pieces) |
detect_logits |
float32 [1, 128, 2] |
P(token is part of an error) gate |
Host-side decode is the base repo's algorithm: argmax the tags, gate by softmax(detect)[1] >= min_error_prob, apply the edits, and iterate (β€3 passes) until the text stops changing. The base repo also bundles an optional PyTorch reranker for its published maximum-precision operating point β that stays host-side/desktop; this artifact covers the tagger (a fully supported mode of the base model's .correct()).
Verification
Task-level parity vs the PyTorch reference ("She go to school every day ." β single $REPLACE on "go"): fp32, fp16 and int8 all produce the identical edit (same position, same replacement piece, detect head agreeing). On an iPhone 17 Pro the int8 file reproduces the desktop outputs bit-exactly on both heads β including the full [1, 128, 128802] label tensor β (cosine 1.000000, max diff 0.0) at 64 ms per pass (6 threads, XNNPACK).
License
LFM Open License v1.0 (see LICENSE, unchanged from the base model). Note the license's commercial-use threshold (Section 5). This repository redistributes converted Derivative Works of LiquidAI/LFM2.5-Encoder-350M-Spellchecker with modification notices per Section 4; all credit for the model to Liquid AI.
- Downloads last month
- -
Model tree for litert-community/LFM2.5-Encoder-350M-Spellchecker
Base model
LiquidAI/LFM2.5-350M-Base