Instructions to use mlboydaisuke/Mordant-3B-Think-LiteRT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use mlboydaisuke/Mordant-3B-Think-LiteRT 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
- LiteRT-LM
How to use mlboydaisuke/Mordant-3B-Think-LiteRT with LiteRT-LM:
# LiteRT-LM runs on various platforms (Android, iOS, Windows, Linux, macOS, IoT, Web/WASM) # and supports many APIs (C++, Python, Kotlin, Swift, JavaScript, Flutter). # For platform-specific integration guides, please refer to the official developer website: # https://ai.google.dev/edge/litert-lm # To try LiteRT-LM, the easiest way is to use our CLI tool. # 1. Install the LiteRT-LM CLI tool: pip install -U litert-lm # 2. Download and run this model locally: # See: https://ai.google.dev/edge/litert-lm/cli litert-lm run \ --from-huggingface-repo=mlboydaisuke/Mordant-3B-Think-LiteRT \ --prompt="Write me a poem"
- Notebooks
- Google Colab
- Kaggle
| license: apache-2.0 | |
| base_model: Kezmark/Mordant-3B-Think | |
| base_model_relation: quantized | |
| tags: | |
| - litert | |
| - litert-lm | |
| - on-device | |
| - granite | |
| - reasoning | |
| - image-prompt | |
| language: | |
| - en | |
| pipeline_tag: text-generation | |
| # Mordant-3B-Think β LiteRT-LM (on-device) | |
| On-device conversion of [Kezmark/Mordant-3B-Think](https://huggingface.co/Kezmark/Mordant-3B-Think) β | |
| a full fine-tune of [ibm-granite/granite-4.1-3b](https://huggingface.co/ibm-granite/granite-4.1-3b) | |
| for AI image-generation prompt composition with chain-of-thought reasoning β to a `.litertlm` | |
| bundle for the [LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM) runtime. All credit for | |
| the model itself goes to its author; this repo only packages it for phones and desktops. | |
| **Requires litert-lm β₯ 0.16 to run.** | |
| | file | quant | size | | |
| |---|---|---| | |
| | `Mordant-3B-Think_int8.litertlm` | dynamic int8 (linears + embedding) | 3.76 GB | | |
| ## Conversion & verification | |
| Converted with one command by [hf-to-litertlm](https://github.com/john-rocky/hf-to-litertlm) | |
| (`python scripts/convert.py Kezmark/Mordant-3B-Think`, 2026-08-25): | |
| - The finetune's own chat template β a thinking-form template that opens the assistant turn | |
| with `<think>` β is embedded verbatim (byte-equal to the checkpoint's | |
| `chat_template.jinja`, 1474/1474). | |
| - The spurious metadata start token is dropped: this family declares `bos == eos == | |
| <|end_of_text|>` and its template never renders a leading BOS, so an engine-prepended | |
| start token reads as "this document already ended" β measured on this checkpoint, it flips | |
| HF bf16 greedy output into a code-fence loop. | |
| - Reduced 7-signature prefill ladder + externalized embedder (the β₯3B ship shape; the full | |
| 11-signature ladder is killed by iOS at Metal init on this family). | |
| - Quality gate: **8/8** on the 8-question sanity gate (think-aware budget), non-degenerate. | |
| ## Performance (Apple M4 Max, litert-lm 0.16.0, `-p 256 -d 256 --runs 3 --cache no`) | |
| | backend | prefill tok/s | decode tok/s | TTFT | | |
| |---|---:|---:|---:| | |
| | CPU | 97.3 | 20.2 | 2.68 s | | |
| | GPU | 1129 | 71.9 | 0.24 s | | |
| ## Usage | |
| ```bash | |
| pip install litert-lm | |
| litert-lm run Mordant-3B-Think_int8.litertlm \ | |
| --prompt "A cat sitting on a windowsill at sunset" --max-num-tokens 4096 | |
| ``` | |
| The model answers with a `<think>β¦</think>` block followed by the composed image prompt β | |
| budget generation length accordingly. On Android, load the bundle in an app embedding the | |
| LiteRT-LM engine (e.g. Google AI Edge Gallery-style hosts). | |
| ## License | |
| apache-2.0, inherited from the source model and its granite-4.1 base. | |