Shipping large model files (10MB)

Hello, I am willing to ship an extension containing a machine learning model (in the ORT format, ORT model format | onnxruntime).

I think Firefox bans large files to be validated if they are above 5MB but my model file would weigh around 10MB. Is there a way to ship such a file inside an extension ? Would it be ok to download it at runtime from a s3 ?

Thank you :slight_smile:

1 Like

I have a feeling the smaller size limit applies only for the JS files (maybe also wasm).
You can try to run this locally:

web-ext lint

Which should use the same validation code as server and if that works, then it should be OK.

Note that addons should be self-contained, so downloading data from external source would have to be “opt-in” or maybe at least mentioned in some privacy policy during the initial setup. Although it’s hard to say if downloading and executing an AI model wouldn’t count as forbidden remote code execution.

1 Like

Thank you ! I ran into a linting issue with a large wasm file for the inference and thought it would apply to all files, I will give it a try with a large model & smaller wasm file !

1 Like

For clarity, the current limit for files parsed by addons-linter is 4 MB (source), not 5 MB.

@fdecan, you may want to check out our recent announcement regarding the experimental ML API in Firefox extensions.

1 Like