I let a 25 MB model choose the typeface for my quote cards. It got it wrong, and I shipped it anyway.
Description and use
Slothpress added a client‑side MobileBERT model to suggest fonts while keeping deterministic, offline‑only guarantees. The model loads only on demand from the same origin, with a clear fallback if it fails.
Problem
Integrating a large language model into a privacy‑first quote‑card generator without compromising the promise that all processing stays on the client.
Outcome
The app now offers an on‑device style suggestion feature while preserving its deterministic, offline‑only guarantees. The model is loaded only when requested, from the same origin, and a clear fallback is shown if it cannot load.
Workflow
- 1. User types a quote and clicks "Suggest a style".
- 2. The app dynamically imports
@huggingface/transformersand the ONNX Runtime Web runtime from the app’s own origin. - 3. The MobileBERT model and tokenizer are fetched from Hugging Face CDN only when the button is pressed.
- 4. The quote is framed as a premise and each style hypothesis is scored via zero‑shot classification.
- 5. Scores are normalized and the highest‑scoring preset is applied to the renderer.
- 6. If the model fails to load, the app displays a plain‑text fallback and counts keywords.
- 7. The resulting PNG is downloaded by the user.
- 8. The app logs network activity to confirm no third‑party runtime is requested.
Evidence
The whole app is one idea, and until this week it had no model in it at all: card = render(content, author, style)
Adding a model could have quietly destroyed that. So the rule was: the model picks a style, and nothing else.
The model is quantized ONNX, 25.72 MB.
Both files land in dist/assets/ and are served from the app's own origin, where the service worker can cache them.
- Record date: 2026-10-21T13:41:20.933Z