mlc-ai / web-llm

High-performance In-browser LLM Inference Engine
https://webllm.mlc.ai
Apache License 2.0
13.44k stars 861 forks source link

webLLMGlobal reference #585

Open lestan opened 3 weeks ago

lestan commented 3 weeks ago

In the get started example, there's a reference to webLLMGlobal in the get_started.html file. I also see it in the streaming example (streaming.html).

What does this code block / variable do?

<script>
    webLLMGlobal = {};
</script>

Trying to determine if it's a global reference to the engine and if it's set by webllm when the engine is created or if it's something else. I don't see it being referenced in the code within those examples so wasn't sure of its purpose.

Appreciate any insight and guidance. Thanks!

Reference: https://github.com/mlc-ai/web-llm/blob/main/examples/get-started/src/get_started.html

flatsiedatsie commented 2 weeks ago

I'm also curious about this. I've kept it in my code, but am unsure of it's use.

tqchen commented 2 weeks ago

I belive this may be a legacy code that is no longer needed, cc @CharlieFRuan @Neet-Nestor . let us cross check and confirm, if it is not needed, we should remove from our example