Spaces:
Running
Running
Add pinned local WebLLM runtime
Browse filesFiles changed (3)
- vendor/README.mdAdded+50
- vendor/build-manifest.jsonAdded+41
- vendor/web-llm.jsAdded
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950# Pocket PhD browser runtime
`web-llm.js` is the local ES module bundle of **@mlc-ai/web-llm 0.2.80**.The main page and module worker use the same file. No runtime bare-moduleimports or JavaScript CDN imports remain in this bundle.
Rebuild from the project root with Node.js and npm:
```shnpm ci --ignore-scripts --no-audit --no-fundnpm run build:vendor```
The lockfile pins WebLLM, loglevel 1.9.2 and esbuild 0.25.12, including theplatform-specific build binary. Dependency lifecycle scripts are unnecessaryand must remain disabled. The checked-in bundle requires no npm installationwhen serving the static app. Do not publish `node_modules/`.
The build checks the export names `CreateWebWorkerMLCEngine` and`WebWorkerMLCEngineHandler` and rejects any remaining external JS imports.`build-manifest.json` records the bundle SHA-256, byte count, exports and inputs.The bundle is transformed from upstream JavaScript without source changes.
## Network and verification limits
This is **not an offline model distribution**. Loading the selected model stillfetches model configuration, tokenizer and weight shards from the model'sHugging Face repository (currently `mlc-ai/Qwen2.5-1.5B-Instruct-q4f16_1-MLC`,with possible Hugging Face storage/CDN redirects). WebLLM's built-in model mapfetches the model-library WASM from`raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/`.These upstream model URLs are not pinned to immutable revisions by this patch.WebLLM also includes tokenizer/grammar runtime code and embedded WASM data.Browser caches can retain downloaded assets. Network-free inference is notpromised, and building this bundle never downloads weights or initializes GPUinference. Actual GPU/model compatibility requires a browser runtime check.
## Attribution
WebLLM and the bundled MLC runtime components are distributed under Apache 2.0;see `licenses/web-llm-Apache-2.0.txt` and the upstream package athttps://www.npmjs.com/package/@mlc-ai/web-llm/v/0.2.80 . The upstream sourcerepository is https://github.com/mlc-ai/web-llm .
loglevel is MIT licensed; see `licenses/loglevel-MIT.txt`. Upstream embeddedcopyright/license comments (including Apache Software Foundation, Microsoft,and OpenAI notices) are preserved verbatim in `licenses/upstream-notices.txt`;comments recognized as legal notices also remain inline in the bundle.esbuild is an MIT-licensed build tool, not runtime application code.Model weights and remote artifacts retain their separate upstream licenses.1234567891011121314151617181920212223242526272829303132333435363738394041{ "package": "@mlc-ai/web-llm", "version": "0.2.80", "esbuild": "0.25.12", "bytes": 6041031, "sha256": "5cefe8b25099c865536558d54f5d684cf87077097411ce99ba9f9929f9f16122", "imports": [], "exports": [ "Chat", "ChatCompletionRequestUnsupportedFields", "Completions", "CreateExtensionServiceWorkerMLCEngine", "CreateMLCEngine", "CreateServiceWorkerMLCEngine", "CreateWebWorkerMLCEngine", "Embeddings", "ExtensionServiceWorkerMLCEngine", "ExtensionServiceWorkerMLCEngineHandler", "MLCEngine", "ModelType", "ServiceWorkerMLCEngine", "ServiceWorkerMLCEngineHandler", "WebWorkerMLCEngine", "WebWorkerMLCEngineHandler", "deleteChatConfigInCache", "deleteModelAllInfoInCache", "deleteModelInCache", "deleteModelWasmInCache", "functionCallingModelIds", "hasModelInCache", "modelLibURLPrefix", "modelVersion", "postInitAndCheckFieldsChatCompletion", "postInitAndCheckFieldsCompletion", "postInitAndCheckFieldsEmbedding", "prebuiltAppConfig" ], "inputs": [ "node_modules/@mlc-ai/web-llm/lib/index.js" ]}vendor/README.mdAdded+50
vendor/build-manifest.jsonAdded+41
vendor/web-llm.jsAdded