Elestia Open Source Ratings
2.7

brain.js

Do not start with it. 7th of 7 machine learning in JavaScript.

brain.js is a simple neural-network library for small feedforward, recurrent and LSTM nets in JavaScript. It has had no commits or npm releases for more than two years, its npm "latest" tag is still a 2.0 beta, and its GPU dependency often breaks installs. For new work, pick TensorFlow.js for training or Transformers.js for running modern models.

Best for: Learners and hobbyists who want to train a tiny neural net from plain JSON data and can accept an unmaintained library.

WebsiteGitHubnpm

Scores

Overall2.7

How strongly do we recommend it for a new project today?

Claude Opus 5.5: 2.0, likely 1.0 to 3.0

The library is dormant. It has no stable modern release, it often fails to install on current Node, and it covers only small classic networks. TensorFlow.js trains networks better, and Transformers.js, MediaPipe and WebLLM cover today's demand to run models on the device. Keep it only where it already runs; do not start with it.

GPT-6.2 Sol: 3.3, likely 2.2 to 4.5

brain.js remains practical for existing small models and teaching demos. The long maintenance gap and limited model support make TensorFlow.js the better choice for new custom training and Transformers.js the better choice for supported pretrained models. Its simple browser workflow could still be worth using in a short-lived prototype, especially with a pinned version.

Needed by many3.3

How many developers need a tool for this job?

Claude Opus 5.5: 3.5, likely 2.5 to 5.0

Running ML on the device is a clear niche among JS developers. brain.js covers only a narrow part of it: training small classic networks from scratch. Most current demand is for running pretrained models, which it does not do.

GPT-6.2 Sol: 3.1, likely 1.9 to 4.3

Local machine learning is a niche within JavaScript. In State of JavaScript 2025, 242 of 10,926 respondents to the use-case question selected machine learning. brain.js serves the smaller group building simple classifiers or sequence models, and the survey only measures the broader use case.

Helps a lot3.8

How well does it do the job for those who need it?

Claude Opus 5.5: 3.0, likely 2.0 to 4.5

The API is easy, and it is fine for toy feedforward and LSTM nets. Users report that GPU training is slower than CPU training or freezes, that the Recurrent class needs a GPU, that type errors and broken example links go unfixed, and that it does not ship as an ES module. TensorFlow.js does the same job better in every respect except simplicity.

GPT-6.2 Sol: 4.5, likely 3.3 to 5.8

Stable 1.6.1 makes small feedforward and recurrent models easy to train and reload from JSON. The 1.x TypeScript declarations cover common calls, but current examples can lead developers and coding agents to beta-specific APIs. TensorFlow.js offers more model architectures and a model conversion path. The range reflects limited recent benchmarks and unverified performance on current runtimes.

Holds up over time1.7

Will it still be a good choice in two years?

Claude Opus 5.5: 1.5, likely 0.5 to 2.5

The repository has had no commits in the last year and no push since September 2024. The last npm publish was in July 2024. An open issue from 2026 titled 'Project is dead' has no maintainer reply, and Open Collective funding is negligible. The repository is not archived, but in practice it is dormant.

GPT-6.2 Sol: 1.8, likely 0.8 to 3.1

The last repository push and npm publish were in 2024, with zero commits or releases in the past year. The 2.0 roadmap was last edited in 2021, and proposed installation and LSTM fixes have lingered. The repository remains open, but the pace of work gives little reason to expect timely compatibility fixes.

Used widely2.8

How many use it, and is that growing?

Claude Opus 5.5: 3.0, likely 2.0 to 4.0

About 17k downloads per 4 weeks, up 1.39x on a year ago. That is far below the 4.1x median, so it is losing ground fast. 631 dependent repositories and 14.9k stars mostly reflect past popularity. Peers have 50 to 1000 times more downloads.

  • npm downloadsLast4Weeks: 17,358 downloads now, against 12,465 a year ago (1.39x).
  • medianDownloadsRatio: The median ratio is 4.1x, so brain.js is falling behind.
  • dependents: 631 repositories and 85 packages, against 8,947 repositories for TensorFlow.js.
  • bluesky posts: 1 post in 24 months.

GPT-6.2 Sol: 2.5, likely 1.4 to 3.6

Four-week npm downloads rose from 12,465 to 17,358, or 1.39× year over year. That trails the 4.1× catalog median and every listed peer, pointing to a loss of relative share. The 631 dependent repos show real use, well below TensorFlow.js at 8,947, while 14,856 stars and one recent Bluesky post say little about new adoption. CDN installs and partial repo coverage leave the number of direct users uncertain.

  • npm.downloadsLast4Weeks, npm.downloadsSame4WeeksYearAgo, medianDownloadsRatio: 17,358 versus 12,465 downloads, below the catalog’s growth benchmark.
  • dependents, peers: 631 tracked repositories and 85 packages depend on it.
  • github.stars, bluesky.posts, peers: About 14,900 stars and one Bluesky post, versus 14 for Transformers.js and 15 for WebLLM.
  • jsdelivr.com/package/npm/brain.js: The CDN provides another distribution channel.
Vouched for2.2

Who stands behind it being good?

Claude Opus 5.5: 2.0, likely 1.0 to 3.0

I found no current production users, benchmarks or framework integrations. Most write-ups are beginner tutorials or older listicles, and Hacker News and Bluesky attention is almost zero. Its main past endorsements, such as a 2019 Wikipedia entry and features in tutorial sites, are dated.

GPT-6.2 Sol: 2.4, likely 1.2 to 3.6

Independent browser research and a working digit-recognition demo show that brain.js can handle small models. A published OCR package still uses stable 1.6.1 as a dependency. The strongest evaluations are old, and evidence of current production use at scale or developer satisfaction is sparse.

Safe4.8

How safe is it to depend on?

Claude Opus 5.5: 4.5, likely 3.5 to 6.0

It has no advisories and an MIT licence. But the OpenSSF Scorecard is 3.5, and the Security-Policy, Token-Permissions, Pinned-Dependencies and SAST checks all score 0. Its one dependency, gpu.js, pulls in a native GL build that is also stale. Nobody maintains it, so any future flaw would likely go unfixed.

GPT-6.2 Sol: 5.0, likely 3.7 to 6.3

The MIT license is permissive, and OSV lists zero advisories for brain.js itself. The npm default declares one direct dependency plus a gpu.js peer dependency, which has historically brought in native build tooling. OpenSSF scores the repository 3.5 out of 10, with zeros for token permissions, dependency pinning, and security policy. The release gap leaves confidence in a timely security fix low.

  • npm.license, advisories.total, npm.latestPublishedAt: MIT license, zero recorded package advisories, and no npm publish since July 2024.
  • scorecard.score, scorecard.checks: Score of 3.5 with weak code review and several missing safeguards.
  • app.unpkg.com/brain.js@2.0.0-beta.24/files/package.json: The beta manifest lists thaw.js and a separate gpu.js peer dependency.
  • github.com/BrainJS/brain.js/issues/930: Users traced Node.js installation failures to transitive native tooling.

Good

  • Very simple API: you train on plain arrays or objects, with no tensors or memory to manage.
  • It covers classic architectures (feedforward, RNN, LSTM, GRU) in the browser and in Node.js.
  • It is MIT licensed, ships its own types, and has no known security advisories.
  • It has a large back catalogue of tutorials, which makes it easy to learn from.

Bad

  • There have been no commits since September 2024 and no npm release since July 2024, and an open issue titled 'Project is dead' has no maintainer reply.
  • The npm latest tag points to 2.0.0-beta.24, and the last stable GitHub release is 1.4.10 from 2018.
  • The gpu.js and headless-gl dependency often fails at install with node-gyp errors on new Node versions and on macOS.
  • It cannot load pretrained or modern models such as transformers, ONNX or LLMs, which peers handle well.

The numbers

npm downloads, 4 weeks
17k +39% in a year
GitHub stars
15k
Commits, 12 months
0
npm version
2.0.0-beta.24 Jul 2024
Versions, 12 months
0
Advisories, 24 months
0 of 0 ever
OpenSSF Scorecard
3.5 out of 10, Nov 2026
Licence
MIT

Read on 21 November 2026 from GitHub (BrainJS/brain.js), npm (brain.js), OSV and the OpenSSF Scorecard.

Machine learning in JavaScript

  1. 8.4Transformers.js
  2. 7.8MediaPipe Tasks
  3. 7.1node-llama-cpp
  4. 6.8WebLLM
  5. 6.6Tesseract.js
  6. 4.5TensorFlow.js
  7. 2.7brain.js
Compare all 7 on six scores