mlc-ai / binary-mlc-llm-libs

200 stars 45 forks source link

[WebLLM] Introduce model library versioning for WebLLM, add 0.2.30 wasms #110

Closed CharlieFRuan closed 6 months ago

CharlieFRuan commented 6 months ago

We introduce WebLLM's wasm (i.e. model library) versioning. That is, we preserve model libraries that are compatible with previous npm versions instead of overriding them.

The motivation is that, sometimes if we update WebLLM's npm version, we update model libraries as well. However, if we do not preserve the old wasms, the new WebLLM npm might not be compatible with the old wasms. It would be very tedious and hard to make sure a new npm version is compatible with all previous wasms. We also do not want to force WebLLM's users to update the npm whenever a new one is released.

Therefore, we reorganize WebLLM's prebuilt model libraries under web-llm-models, under which each folder is the npm version. However, not all new npm version needs to update the model libraries. Therefore, it is only updated when needed, i.e. it is possible that 0.2.31 WebLLM npm uses 0.2.30 wasms. We refer to prebuiltAppConfig exported by each WebLLM's npm for the only source of truth: https://github.com/mlc-ai/web-llm/blob/main/src/config.ts -- what wasms this npm version is using.

For users who want to compile their own libraries for a specific WebLLM npm version, if they compile at the same commits below for MLC-LLM and TVM, they should expect the same behavior / compatibility with the provided libraries.

0.2.30 model libraries are compiled with:

Corresponding changes in WebLLM: https://github.com/mlc-ai/web-llm/pull/355