Skip to content

ngx-transformersOn-device ML for Angular

Hugging Face Transformers.js behind a signals API. Classification, embeddings, translation, Whisper speech-to-text and small LLMs, all in the browser. No server, no API key.

ngx-transformers
ngx-transformers on npmweekly npm downloadsCI statusMIT license

Install โ€‹

sh
npm install ngx-transformers @huggingface/transformers

Angular 22 or newer; @huggingface/transformers v4 is a peer dependency. Then follow Getting started: sentiment analysis is about fifteen lines.

See it live โ€‹

The published package, running here. The first click on each card downloads a model (23 to 105 MB); after that the browser cache serves it.

Open full screen โ†—

Why this exists โ€‹

Transformers.js has a React tutorial and a hooks ecosystem; Angular had nothing. This library wraps each pipeline in a small handle with signals for the lifecycle, defaults that work (a sensible checkpoint per task, quantized weights, WebGPU when the machine has it), DI-friendly configuration, automatic disposal with the owning component, and a drop-in progress line for the download. The Concepts page explains the design in a few minutes.

MIT licensed. Models come from the Hugging Face Hub under their own licenses; check the one you ship.