# Machine learning in JavaScript

Run machine learning models in the browser or in Node.js, on the device. Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 22 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.

| Rank | Project | Overall | Needed by many | Helps a lot | Holds up over time | Used widely | Vouched for | Safe | Best for |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 1 | [Transformers.js](https://elestia.ai/opensource/ml/transformers-js/index.md) | 8.4 | 4.3 | 8.3 | 8.2 | 7.4 | 7.5 | 7.2 | JS/TS developers who want to run Hugging Face models for embeddings, classification, speech, vision or small LLMs locally in the browser or Node with a pipeline API. |
| 2 | [MediaPipe Tasks](https://elestia.ai/opensource/ml/mediapipe/index.md) | 7.8 | 3.2 | 7.9 | 7.8 | 6.5 | 6.8 | 7.5 | Web apps that need real-time face, hand, pose or segmentation tracking from a webcam, with ready-made models. |
| 3 | [node-llama-cpp](https://elestia.ai/opensource/ml/node-llama-cpp/index.md) | 7.1 | 3.7 | 7.6 | 6.3 | 4.7 | 5.8 | 6.2 | Node.js or Electron apps that need local LLM chat, embeddings or schema-constrained output inside the process, without a separate Ollama server. |
| 4 | [WebLLM](https://elestia.ai/opensource/ml/web-llm/index.md) | 6.8 | 3.4 | 7.3 | 6.3 | 4.4 | 6.0 | 7.1 | Teams building chat or agent features that must run a local LLM in the browser on WebGPU-capable desktops. |
| 5 | [Tesseract.js](https://elestia.ai/opensource/ml/tesseract-js/index.md) | 6.6 | 3.4 | 6.9 | 4.6 | 5.8 | 5.6 | 5.8 | Apps that need free, private OCR of clean printed text, run in the browser or in Node.js without a server. |
| 6 | [TensorFlow.js](https://elestia.ai/opensource/ml/tensorflow-js/index.md) | 4.5 | 4.0 | 6.0 | 2.4 | 5.2 | 5.1 | 5.8 | Teams that already ship TF.js or Keras models, or that need to train small models in the browser, and accept a library that is barely maintained. |
| 7 | [brain.js](https://elestia.ai/opensource/ml/brain-js/index.md) | 2.7 | 3.3 | 3.8 | 1.7 | 2.8 | 2.2 | 4.8 | Learners and hobbyists who want to train a tiny neural net from plain JSON data and can accept an unmaintained library. |

## The numbers

| Project | Downloads, 4 weeks | In a year | GitHub stars | Commits, 12 months | Last npm release | Advisories, 24 months |
| --- | --- | --- | --- | --- | --- | --- |
| Transformers.js | 19M | ×29 | 16k | 172 | Oct 2026 | 0 |
| MediaPipe Tasks | 33M | ×9.7 | 38k | 937 | Nov 2026 | 0 |
| node-llama-cpp | 1.6M | ×35 | 2.2k | 50 | Nov 2026 | 0 |
| WebLLM | 794k | ×7.5 | 19k | 70 | Nov 2026 | 0 |
| Tesseract.js | 24M | ×14 | 39k | 4 | Dec 2025 | 0 |
| TensorFlow.js | 2.5M | ×2.8 | 19k | 1 | Oct 2024 | 0 |
| brain.js | 17k | +39% | 15k | 0 | Jul 2024 | 0 |

All categories: https://elestia.ai/opensource/index.md
