Downloads · 30 days
6
7% of all-time downloads
amrshawqy/amr-lite-270m
amr-lite-270m is a text generation model from amrshawqy. Use it when you need the model to write or continue text. It is set up for transformers.js. The card lists the license as gemma.
Downloads · 30 days
6
7% of all-time downloads
All-time downloads
81
Public
Repo size
744 MB
Likes
0
Public
Click a slice to open those files.
.onnx711 MB · 95%
From the Hugging Face model README
Same product, fewer calories.
Read this before using anything below.
Amr Lite is a demonstration that a fine-tuned language model can be downloaded in about a minute and run entirely on a visitor's phone, offline. That is its whole purpose.
It was fine-tuned to render a retrieved reference answer about Amr Shawqy and Signit in a casual voice — not to know facts. At runtime the facts and the refusals come from a separate retrieval layer, and this model's output is shown alongside the verified answer, never in place of it.
Measured in our own gate, it reproduces only about 52% of the fact tokens in the reference it was given. In practice it will sometimes misstate a number, loop or repeat itself, and occasionally contradict the very reference sitting in its context. Treat every generated sentence as decoration over the retrieved answer. Do not quote it. Do not rely on it for anything about Signit or about Amr.
Nothing a visitor types leaves their device: the model runs in the browser and there is no inference server.
google/gemma-3-270m-itq4 (261 MiB, the phone target) and q8 (417 MiB, desktop and Android)LoRA with Apple MLX on an M1 Pro: rank 16, alpha 16 (scale 16), dropout 0.05, on every attention and MLP projection in all 18 layers, prompt-masked so only the assistant turn is trained. 704 examples (~19% Arabic), batch 2 with gradient accumulation 2, lr 1e-4 cosine, 8 epochs, ~20 minutes. The shipped checkpoint is not the lowest-validation-loss one — validation loss is a poor proxy here because many different phrasings are correct — but the one that scored best on the task-specific gate below.
136 held-out examples, greedy decoding, onnxruntime-node.
| dtype | fidelity% | fact% | decline% | leaks | lang% | refusal% | degen | CEO | title | polarity% |
|---|---|---|---|---|---|---|---|---|---|---|
| fp32 (reference, not shipped) | 52.4 | 41.3 | 50 | 0 | 100 | 85 | 1 | 0 | 0 | 53.3 |
| q8 | 46.4 | 37.4 | 80 | 0 | 100 | 80 | 2 | 0 | 0 | 53.3 |
| q4 | 41.1 | 33.9 | 50 | 0 | 100 | 90 | 8 | 0 | 1 | 66.7 |
Quantisation costs real quality here: q4 is the smallest and the weakest.
system-prompt.txt is uploaded alongside the weights and is the exact prompt the
model was trained against. Substitute:
{{TWIN_NAME}} → Amr Lite{{FACTS}} → exactly one retrieved answer, bare (no bullet, no label), or
the literal string (nothing retrieved) when retrieval is below threshold.Never inject two references — the model picks the wrong one. The prompt is ~139 tokens, so a full turn stays well inside the context budget.
import { pipeline } from '@huggingface/transformers';
const generator = await pipeline('text-generation', 'amrshawqy/amr-lite-270m', {
dtype: 'q4', // 'q8' on desktop and Android
device: 'webgpu', // falls back to 'wasm'
});
The on-device twin demo on Amr Shawqy's NFC business-card page, shown at LEAP. Nothing else.
Inherits the Gemma Terms of Use from
google/gemma-3-270m-it. Use of this model is subject to those terms and to
Google's Prohibited Use Policy.