chatbot_kernel
A Jupyter kernel to use Jupyter as a chat window, running downloaded LLMs locally.
Installation
This kernel package can be install from PyPI
$ pip install chatbot_kernel
Once the package installed, the kernel spec can be installed to home directory by command:
$ python -m chatbot_kernel install --user
If you are using virtualenv, do
$ python -m chatbot_kernel install --sys-prefix
instead.
If you install the package to a virtual environment, you may need to set up JUPYTER_PATH=/path/to/venv/share/jupyter:$JUPYTER_PATH so that jupyter can find the kernel
Usage
A few magics are available in the kernel:
%help: Print help messages%config: Set advanced configuration. See more in%config help%load: Load a pretrained LLM%hf_home: Set the path to find downloaded LLMs, similar to setHF_HOMEenvironment variable%model_list: Show the available LLMs%new_chat: Clean up the chat history
Before start chatting, you need to at least download a model from HuggingFace. For example, huggingface-cli download meta-llama/Meta-Llama-3-8B-Instruct.
Once models are downloaded, launch a jupyter notebook/lab and execute %load <model> and start chatting. Here is an example:
%load meta-llama/Meta-Llama-3-8B-Instruct
hi
who are you
Caveat
Currently, the kernel use the AutoModelForCausalLM and it is not supported by all models.
A few models have been tested:
meta-llama/Meta-Llama-3-8B-Instructmistralai/Mistral-7B-Instruct-v0.3: needssentencepiecedependencyunsloth/llama-3-8b-Instruct-bnb-4bit: needsbitsandbytesdependency
Metadata
Release files for chatbot-kernel 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| chatbot_kernel-0.3.0.tar.gz | 8.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chatbot_kernel-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.7 kB
Release files / chatbot_kernel-0.3.0.tar.gz
| Download URL | chatbot_kernel-0.3.0.tar.gz |
|---|---|
| Size | 8.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e597536b7eb145c0b933843076fc5a72a0a4b376ccb754ed857bb404470d7960
|
|
BLAKE2b-256 checksum How to use checksums |
14dd5c25ed995e44d2d9fe1e6d2e169fb14cac27c30759314c04f11c3b55f4f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|
Release files / chatbot_kernel-0.3.0-py3-none-any.whl
| Download URL | chatbot_kernel-0.3.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbde2d81b0a4866f99ffe6305f244f832472a263b8421cc4e2004e87f982c705
|
|
BLAKE2b-256 checksum How to use checksums |
b230842eaef60a6a3404b6aa8dc617002768a3e9db55d2a14fcadf7c4b57a280
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.0
|