TensorFlow.js brings trained machine-learning models into browser-based JavaScript applications and desktop Electron apps. It can import a saved Keras model and query it locally, allowing an application to continue working after the model is downloaded and cached. section 6.3.2
Use TensorFlow.js with practical deployment constraints in mind:
- Choose local inference when avoiding network round trips or preserving offline behavior matters. section 6.3.2
- Check model size and resource use before targeting a smartphone or laptop; CPU, GPU, and RAM remain user-device constraints. section 6.3.2
- Treat a client-delivered model as nonconfidential, especially when training data is sensitive. section 6.3.2
- Optimize before importing into TensorFlow.js when memory, power, or latency is restricted; pruning and quantization provide size–accuracy tradeoffs. section 6.3.2


