Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

I let a 25 MB model choose the typeface for my quote cards. It got it wrong, and I shipped it anyway.

Описание и применение

Веб‑приложение Slothpress добавило клиентскую модель MobileBERT для выбора шрифта, сохранив при этом гарантии детерминированной генерации картинок без сервера. Модель загружается только по запросу, из того же происхождения, и при сбое показывается явный откат.

Задача

Integrating a large language model into a privacy‑first quote‑card generator without compromising the promise that all processing stays on the client.

Результат

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.

Рабочий процесс

  • 1. User types a quote and clicks "Suggest a style".
  • 2. The app dynamically imports @huggingface/transformers and 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.

Доказательства

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.

Источник

  • Дата записи: 2026-10-21T13:41:20.933Z