rougail-ai/doc/WebLlm.md
2026-09-14 21:05:52 +02:00

2.3 KiB

WebLLM

liens

avec ses outils

webllmfit
webllmfit — can your machine run these models?
Hardware
  WebGPU.........: NOT available
  System RAM.....: unknown
  CPU threads....: 8
No WebGPU → no in-browser LLM can run in this browser.
Use a recent Chrome/Edge (≥ 113) or Safari 18+ (chrome://flags/#enable-unsafe-webgpu on Linux).


install webllm

Suivre l'install dans le readme.

install the python mlc local chat utility

install

L'install doit se faire avec des version très précises sinon il y a des difficultés.

  • faire un environnement virtuel
  • installer de la manière suivante :
sudo apt-get install git-lfs

pip install --pre -f https://mlc.ai/wheels \
    mlc-ai-cpu==0.20.0 \
    mlc-llm-cpu==0.20.0.dev0


pip install psutil

# wget https://github.com/mlc-ai/package/releases/download/v0.9.dev0/mlc_llm_cpu-0.20.0.dev0-py3-none-manylinux_2_28_x86_64.whl
# pip install ./mlc_llm_cpu-0.20.0.dev0-py3-none-manylinux_2_28_x86_64.whl

pip install apache-tvm-ffi==0.1.11
# https://pypi.org/project/apache-tvm-ffi/#history

usage

python -m mlc_llm chat HF://mlc-ai/Llama-3-8B-Instruct-q4f16_1-MLC
You can use the following special commands:
  /help               print the special commands
  /exit               quit the cli
  /stats              print out stats of last request (token/sec)
  /metrics            print out full engine metrics
  /reset              restart a fresh chat
  /set [overrides]    override settings in the generation config. For example,
                      `/set temperature=0.5;top_p=0.8;seed=23;max_tokens=100;stop=str1,str2`
                      Note: Separate stop words in the `stop` option with commas (,).
  Multi-line input: Use escape+enter to start a new line.