TensorFlow.js is a JavaScript library for running and developing machine-learning models in browsers and other JavaScript environments. It supports browser applications and desktop Electron apps, including offline inference after a model is downloaded and cached. section 6.3.2
TensorFlow.js supports practical deployment choices:
- Import a saved Keras model and query it from a browser-based JavaScript application or Electron desktop application. section 6.3.2
- Use the Keras API and many lower-level TensorFlow APIs through the JavaScript ecosystem. section 6.3.2
- Optimize models before deployment when device memory, power, or latency is constrained; pruning trades model size against accuracy. section 6.3.2
Offline browser inference
A browser application can download and cache a saved Keras model, then use TensorFlow.js to make predictions without another network round trip. This approach suits models small enough for the user's CPU, GPU, and RAM, and requires accepting that the downloaded model is not confidential. section 6.3.2


