Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Notebook Platforms

Setup and behavior differ across Jupyter, Google Colab, and Binder. This page covers the key differences.

Try Online

NotebookPlatformLink
first.ipynbGoogle ColabOpen In Colab
first.ipynbBinderBinder
memory.ipynbGoogle ColabOpen In Colab
lisp.ipynbGoogle ColabOpen In Colab

Comparison

Jupyter (local)Google ColabBinder
AccountNoneGoogle account requiredNone
Installpip install in terminal beforehand!pip install in first cellPre-installed via requirements.txt
Restart neededNoYes — after first installNo
Startup timeInstantFast (~5s)Slow (2–5 min cold start)
PersistenceLocal filesystemGoogle Drive (optional mount)Ephemeral — lost on timeout
GPUIf available locallyFree tier availableNot available
Custom packagesFull control!pip install per sessionVia requirements.txt only

Jupyter (Local)

Install once in your terminal, then use in any notebook:

pip install kongming-rs-hv
# Cell 1 — no restart needed
from kongming import hv

For development workflows with frequent code changes, use autoreload:

%load_ext autoreload
%autoreload 2

Google Colab

Colab runs in the cloud with a fresh environment each session. Install in the first cell:

# Cell 1 — install
!pip install kongming-rs-hv

After the first install, Colab requires a runtime restart:

  1. Go to Runtime → Restart runtime (or use the button Colab shows after install)
  2. Then run the remaining cells
# Cell 2 — after restart
from kongming import hv
model = hv.MODEL_64K_8BIT

Subsequent sessions on the same notebook will need the install cell again — Colab does not persist pip packages across sessions.

Saving work: Use google.colab.drive to mount Google Drive for persistent storage:

from google.colab import drive
drive.mount('/content/drive')
# Then use paths like /content/drive/MyDrive/...

Binder

Binder builds a Docker image from your repo’s requirements.txt and launches a Jupyter server. No account needed.

Binder

  • First launch: Takes 2–5 minutes to build the environment
  • Subsequent launches: Faster if the image is cached
  • No install needed: kongming-rs-hv is pre-installed from requirements.txt
  • Ephemeral: All work is lost when the session times out (~10 min idle)
# Cell 1 — works immediately, no install
from kongming import hv
Limitation
You cannot install additional packages not in requirements.txt (the environment is read-only).

Choosing a Platform

Use caseRecommended
Daily developmentJupyter (local)
Quick demo / sharingGoogle Colab
Zero-setup explorationBinder
Teaching / workshopsGoogle Colab (students have accounts)
Persistent storage neededJupyter (local) or Colab + Drive
Last change: , commit: ab5cf46