← all repositories
yorkie/tensorflow-nodejs

TensorFlow in Node.js by way of Python

A JavaScript wrapper that runs TensorFlow's Python API under the hood via an embedded Python bridge.

580 stars JavaScript ML Frameworks
tensorflow-nodejs
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

What it does

This package exposes TensorFlow’s Keras API to Node.js developers through familiar-looking JavaScript calls. You can load datasets, build sequential models, compile with optimizers, train, and save — all from JS. Underneath, it’s talking to Python via Boa, Alibaba’s JS-to-Python interop layer.

The interesting bit

Instead of binding to TensorFlow’s C API directly — which the README notes is itself unstable — this project cheats by embedding a Python runtime and proxying calls through it. It’s a pragmatic workaround that trades a Python dependency for API completeness.

Key highlights

  • Keras-style API: Sequential, Dense, Dropout, compile, fit, save
  • MNIST example included showing end-to-end training
  • Published as tensorflow2 on npm
  • MIT licensed, ~580 stars

Caveats

  • README explicitly warns: “not guaranteed to have a stable API”
  • Requires Python environment + Boa runtime overhead
  • Underlying TensorFlow C API instability cascades to this project

Verdict

Worth a look if you need Keras features in Node.js today and don’t mind the Python bridge tax. Skip it if you want native bindings, GPU performance without Python overhead, or API stability guarantees.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.