Chiffre.io anonymous visit counting for clients without JavaScript
Skip to content

bg right w:100%

Machine Learning in the Browser: Fast Iteration with ONNX & WebAssembly#

Romain Clement

PyData Paris 2025 October 1st 2025


🙋 Who is able to deploy ML models from day one?#


🤕 Hard truth about ML models#

Many surveys and field experience show :

  • Most models never reach production
  • Technical difficulties for integration
  • Lack of user feedback
  • Difficulty to showcase business value
  • Privacy concerns

💡 Can we do better?#

💰 Deploy simple demos at no cost ⚙️ Use standard model interchange formats 🌍 Inference at the edge


💡 Can we do better?#

💰 Deploy simple demos at no cost → Static websites ⚙️ Use standard model interchange formats → ONNX 🌍 Inference at the edge → WebAssembly


⚙️ What is ONNX?#

Open Neural Network Exchange

  • Generic ML model representation
  • Common file format
  • Training / inference loose coopling
  • Language-agnostic
  • Backend-agnostic
  • Interoperability

bg right w:100%


🤝 ONNX Models#

Export models from favourite framework:

⚠️ Some models or layer types might not be supported by generic operators yet!


🤝 ONNX Models#

Using Netron to visualize an ONNX model

bg right w:90%


bg w:100%


🤝 ONNX Runtime#

  • C/C++
  • Python
  • ...
  • Web!

🌍 What is WebAssembly?#

WASM

  • Portable compilation target
  • Client and server applications
  • Major browsers support (desktop, mobile)
  • Fast, safe and open
  • Privacy

⚠️ Some restrictions may apply, especially regarding available memory (4GB)

bg right:40% w:200px


🌍 WebAssembly#

Famous usage in Data Science ecosystem:


Getting started with ONNX Runtime Web#

Housing value estimation demo

✅ Train a regressor with Scikit-Learn ✅ Export it to ONNX ✅ Integrate it into a static website

Source: rclement/pydata-paris-2025-ml


Getting started with 🤗 Transformers.js#

Text summarizer demo

✅ Pre-trained lightweight ONNX LLM (Google Gemma 3 270m ~1GB) ✅ Integrate it into a static website

Source: rclement/pydata-paris-2025-ml


🚢 Introducing modelship#

Local-first utility Python app

Automate the generation of application from models

OSS Apache-2 licensed

Get started: - uvx modelship static --output dist --metadata metadata.yml model.onnx - https://github.com/datalpia/modelship


🚢 modelship demo#

Let's try to gap the "extra mile"

✅ Build static web app from ONNX model and metadata ✅ Deploy on GitHub Pages using CI/CD

Source: rclement/pydata-paris-2025-modelship-demo


🚢 modelship demo#

Try the deployment yourself!

https://rclement.github.io/pydata-paris-2025-modelship-demo/

bg right:50% w:400px


🚢 modelship demo#


🚢 Takeaway#

Just start shipping!


Romain CLEMENT#

Indepedent consultant at Datalpia

bg right width:80%

Meetup Python Grenoble co-organizer

🌐 datalpia.com 🌐 romain-clement.net 🔗 linkedin.com/in/romainclement


🙋 Questions ?#

Thank you! Let's chat!


📚 References#