zama-ai / concrete-ml

Concrete ML: Privacy Preserving ML framework using Fully Homomorphic Encryption (FHE), built on top of Concrete, with bindings to traditional ML frameworks.
Other
960 stars 140 forks source link

Feature Request: JavaScript and WebAssembly Compatibility for Concrete-ML Client #925

Open hbulgarini opened 13 hours ago

hbulgarini commented 13 hours ago

We are building a PoC for a blockchain solution that allows negotiation and access to inferences from AI models encrypted with FHE, leveraging Zama’s Concrete-ML. A challenge we’re facing is that the client is only available in Python, making it incompatible with browsers. JavaScript or a WebAssembly equivalent solution are the only valid options for running the client in the browser, as due to the python libraries used in ConcreteML, the client.py cannot be compiled to WASM.

Enabling the client to run directly in the browser is crucial for ensuring user privacy from the outset. Since browsers are the main entry point for most cloud-based applications, securing data at this stage would allow users to maintain full control of their private interactions. Currently, with the Python-only client, the alternative solutions imply limitations:

The Python-only approach works well for scripts, command-line interfaces, Jupyter notebooks, or data science pipelines suitable for PoCs, demos, or internal workflows but not for end-user applications where privacy and ease of use are essential.

While JavaScript compatibility is our preferred solution for browser-based integration, using a Rust-based library like TFHE-rs compiled to WASM is a valid temporary solution. This would enable browser support while full JavaScript compatibility is being explored.

We believe that adding this feature to Concrete-ML is crucial, as it would greatly enhance the privacy, security, and usability of AI services for real-world applications, making it a key enabler for broader adoption and practical use.

Thank you for considering this request.

jfrery commented 9 hours ago

Hi @hbulgarini,

Thanks for the feature request. This is something that is on our roadmap. We will let you know as soon as it is shipped.

hbulgarini commented 3 hours ago

Hi @hbulgarini,

Thanks for the feature request. This is something that is on our roadmap. We will let you know as soon as it is shipped.

Thank you very much. We have the flow already working for the existing client/server python setup, if you need a testing use case please let me know.