Skip to main content

notebook-llm-cli (import notebook_llm)

One interactive CLI to run LLMs on a Kaggle/Colab GPU and use them from your IDE. It detects your GPUs, tells you whether a model fits and roughly how fast it will run, searches Ollama and Hugging Face, runs it with Ollama, llama.cpp or vLLM, and gives you a password-protected public link (via tunnelmate-cli) plus ready-to-paste settings for Continue, Cline, Aider, Open WebUI, Claude Code, Cursor and Python.

Install (Kaggle notebook: Internet ON, Accelerator = GPU)

!pip install -q notebook-llm-cli
import notebook_llm
notebook_llm.run()          # opens the menu (input boxes appear in the cell)

In a terminal run notebook-llm. (!notebook-llm cannot take keyboard input in Kaggle; use notebook_llm.run() there, or the non-interactive commands below.) Needs Python 3.10+.

Engines

Engine Runs Best for Notes
Ollama (default) Ollama library + any Hugging Face GGUF (hf.co/user/repo:Q4_K_M) easiest, instant model switching
llama.cpp any GGUF from Hugging Face or a local file full control, every quant, lowest overhead official releases have no Linux CUDA build, so it is built from source for your GPU on first use (5-10 min, needs nvcc)
vLLM (experimental) full Hugging Face models (safetensors, AWQ/GPTQ) several users at once, both GPUs in parallel On Kaggle T4 it installs through kaggle-vllm (a plain pip install vllm replaces Kaggle's PyTorch); runs in float16 with eager mode

Only one engine holds the GPUs at a time; switching stops the others. All three serve an OpenAI-compatible API and /v1/messages (Claude Code).

Model sources

Search menu: Ollama library (ollama.com/search) | Hugging Face GGUF | Hugging Face full models | paste anything: an Ollama tag (qwen3:8b), hf.co/user/repo:Q4_K_M, a Hugging Face link, user/repo, or /path/model.gguf. Hugging Face results show every quantization with size, FIT, ~tok/s and a suggested pick. Gated models: set an HF token in Settings. For vLLM add awq or gptq to the search to find 4-bit models that fit T4s.

Menu

  1. Quick start (install, best model, protected link) 2. Search models 3. Recommended for my GPU 4. Quant picker
  2. Installed models 6. Engine 7. Connect your tools 8. Public link 9. Server 10. Settings 11. Benchmark

The link comes from tunnelmate-cli (Cloudflare quick tunnel; falls back to plain cloudflared if tunnelmate is missing). It is password-protected by default: the key is shown once you open the link and is what you put in each tool as the API key (Authorization: Bearer <key>, x-api-key also accepted). Change or rotate the key, or turn protection off, in the "Public link" menu; the link itself stays the same.

Why our own proxy? tunnelmate's built-in password proxy buffers the whole response, so tokens arrive all at once after generation ends and long answers can hit Cloudflare's ~100 s timeout (we measured 4 tokens arriving together at 4.0 s instead of 1 per second). notebook_llm therefore runs a small streaming proxy and points the tunnel at it. It also sends the local Host header Ollama requires.

Disk, fit and speed

  • Before every download the free space in the models folder is checked (the folder defaults to the disk with the most room, e.g. /kaggle/temp).
  • Needs = weights (exact size from the registry / Hugging Face) + KV cache + overhead. FIT: FITS / TIGHT / SLOW (CPU offload) / TOO BIG.
  • tok/s = memory bandwidth / bytes read per token (built-in GPU table). MoE models only read active experts. Ollama and llama.cpp split layers across GPUs (more capacity, same speed); vLLM uses tensor parallel (both GPUs work together). Estimates are +-30%: use Benchmark for the real number.

Non-interactive

notebook-llm gpus | engines | status | stop
notebook-llm search qwen --source hf-gguf        # ollama | hf-gguf | hf-full
notebook-llm check hf.co/bartowski/Qwen3-30B-A3B-GGUF:Q4_K_M --engine llamacpp
notebook-llm quants bartowski/Qwen3-30B-A3B-GGUF --engine llamacpp
notebook-llm quickstart --engine llamacpp --model hf.co/user/repo:Q4_K_M
notebook-llm connect cursor                      # continue cline aider openwebui claude-code antigravity python (none = all)

Python

from notebook_llm import NotebookLLM
llm = NotebookLLM()
llm.set_engine("llamacpp")
url = llm.quickstart("hf.co/unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF:Q4_K_M")
print(url, llm.api_key())
print(llm.connect("claude-code"))

Status of this release (honest notes)

Tested automatically (82 tests): fit/speed estimates, Hugging Face parsing, GGUF shard merging, resumable downloads, all engine lifecycles against fake servers, the streaming password proxy, tunnelmate wrapper, manager and CLI flows. Not yet verified on a real GPU/network: the llama.cpp CUDA build, vLLM on T4 (experimental), live Hugging Face / ollama.com responses, a real Cloudflare tunnel. Antigravity IDE has no custom-endpoint setting; use Continue/Cline inside it.

Metadata

Release files for notebook-llm-cli 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for notebook-llm-cli 0.4.0
File Size Uploaded Provenance Actions
notebook_llm_cli-0.4.0.tar.gz 75.1 kB Without provenance Details for notebook_llm_cli-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for notebook-llm-cli 0.4.0
File Interpreter ABI Platform Actions
notebook_llm_cli-0.4.0-py3-none-any.whl Python 3 none any Details for notebook_llm_cli-0.4.0-py3-none-any.whl

Total release size: 144.3 kB

Release files / notebook_llm_cli-0.4.0.tar.gz

Download URL notebook_llm_cli-0.4.0.tar.gz
Size 75.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1b8e32eed2b70b87c59907de3b72a58eda2295e5003be5bbd656f86268bb5060
BLAKE2b-256 checksum
How to use checksums
39124dae5e6e8665b71f4c6896668a683265e579e49ae27a638f8fbde33da8bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Release files / notebook_llm_cli-0.4.0-py3-none-any.whl

Download URL notebook_llm_cli-0.4.0-py3-none-any.whl
Size 69.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e2842ef0ca1ee33b5b3685b4e330a416e54d886dece2b8ef78a6a4fbb7892e2
BLAKE2b-256 checksum
How to use checksums
9d27790186799956ea9a5267da569ebaeda390bb3099a5257ff6d3eb0d5c67b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for notebook-llm-cli 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page