Notebook Platforms
Setup and behavior differ across Jupyter, Google Colab, and Binder. This page covers the key differences.
Try Online
| Notebook | Platform | Link |
|---|---|---|
first.ipynb | Google Colab | |
first.ipynb | Binder | |
memory.ipynb | Google Colab | |
lisp.ipynb | Google Colab |
Comparison
| Jupyter (local) | Google Colab | Binder | |
|---|---|---|---|
| Account | None | Google account required | None |
| Install | pip install in terminal beforehand | !pip install in first cell | Pre-installed via requirements.txt |
| Restart needed | No | Yes — after first install | No |
| Startup time | Instant | Fast (~5s) | Slow (2–5 min cold start) |
| Persistence | Local filesystem | Google Drive (optional mount) | Ephemeral — lost on timeout |
| GPU | If available locally | Free tier available | Not available |
| Custom packages | Full control | !pip install per session | Via 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:
- Go to Runtime → Restart runtime (or use the button Colab shows after install)
- 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.
- First launch: Takes 2–5 minutes to build the environment
- Subsequent launches: Faster if the image is cached
- No install needed:
kongming-rs-hvis pre-installed fromrequirements.txt - Ephemeral: All work is lost when the session times out (~10 min idle)
# Cell 1 — works immediately, no install
from kongming import hv
requirements.txt (the environment is read-only).
Choosing a Platform
| Use case | Recommended |
|---|---|
| Daily development | Jupyter (local) |
| Quick demo / sharing | Google Colab |
| Zero-setup exploration | Binder |
| Teaching / workshops | Google Colab (students have accounts) |
| Persistent storage needed | Jupyter (local) or Colab + Drive |