Skip to main content

Jupyter anywidget for sideloading webllm wasm

Project description

jupyter_anywidget_webllm

Example Jupyter anywidget that will sideload a web-llm model into the browser and run prompts against it.

For example:

from jupyter_anywidget_webllm import webllm_headless

# Load the headless widget
w = webllm_headless()

# Wait for webllm wasm to load (blocking;; does not work in JupyterLite)
w.ready()

# Try a conversion
# This is blocking - does not work in JupyterLite
output = w.convert("Write me a poem")
output


#Non-blocking
w.base_convert("Write me a story")
# When it's ready, collect from:
w.response
> {'status': 'processing'}
> {'status': 'completed', 'output_raw': 'OUTPUT'}

TO DO: ALLOW a json outpur template from a string or file: Use w.convert_from_file(path, output_template="", timeout=3) etc. to load from a local file path or a URL.

Installation

pip install jupyter_anywidget_webllm

or with uv:

uv add jupyter_anywidget_webllm

Open example.ipynb in JupyterLab, VS Code, for a demo...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jupyter_anywidget_webllm-0.0.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jupyter_anywidget_webllm-0.0.1-py2.py3-none-any.whl (1.7 MB view details)

Uploaded Python 2Python 3

File details

Details for the file jupyter_anywidget_webllm-0.0.1.tar.gz.

File metadata

File hashes

Hashes for jupyter_anywidget_webllm-0.0.1.tar.gz
Algorithm Hash digest
SHA256 37f4328d42e3dd84c3819afa435ce26c829c6691f6b2e00a2195604c84d42d92
MD5 a2773c42abff8072ea4f5a451604c5f8
BLAKE2b-256 bbf11245a3fec5ed89535837c6dd7afc645011c0c521d98d310afb7d718bc8bb

See more details on using hashes here.

File details

Details for the file jupyter_anywidget_webllm-0.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for jupyter_anywidget_webllm-0.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3762a1dba69bf15669936ff0d25d630e987f962f62aff1f78f253ac15138f640
MD5 428987e08370c952ea7d6215d58b7b5c
BLAKE2b-256 16de5a7cba3c0e409092f0fd811cb9786dec2f9e2965072dded5eac9f621bb8f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page