Skip to main content

nanoscope

A web app for learning how small language models work and for testing changes to them properly. You build a model in lessons, edit it as code or as a graph, train it, and compare it with another model with confidence intervals instead of a single loss number.

It has three parts that share one code path:

  • Lessons that build a model from a bigram up to a modern transformer block. Each lesson has a check that says why it fails, and passing one unlocks the bigger blocks.
  • A model page where one file is both code and a graph. Drag a block onto another to swap it and the file changes by one line.
  • Experiments with seeds, paired comparisons, 95% intervals, preregistered studies and baselines for the shipped models.

Installation

docker compose up
docker compose logs api | grep login

Open the link that grep prints. The app is at http://127.0.0.1:8765 and trains on one CPU worker. For an NVIDIA GPU use docker compose --profile gpu up.

Without Docker, on Python 3.10 to 3.12:

pip install "nanoscope-lab[server]"
nanoscope serve --worker cpu

That serves on http://127.0.0.1:8000. The login token lets whoever has it run code on your machine, so keep the server on localhost or behind an SSH tunnel. Setup for GPUs, remote use and backups is in docs/deploy.md.

Usage

The Learn, Tinker, Research and Extend switch hides controls you don't need yet. It doesn't change what runs. docs/gui.md describes each screen. The app calls the same code as Python and the command line:

from nanoscope import compare, run

result = run(MyModel, preset="tinystories-5min")
compare(result, "gpt2")
nanoscope run models/my_model.py:MyModel --seeds 3
nanoscope compare modern gpt2 --preset tinystories-5min
nanoscope --help

docs/research.md covers studies and docs/blocks.md covers writing your own blocks.

Develop

uv sync --all-extras
make check        # what CI runs
make web          # build the app into the package
pnpm -C web dev   # app with hot reload

Data

Tokens come from TinyStories (CDLA-Sharing-1.0) and FineWeb-Edu (ODC-By 1.0), cached under ~/.nanoscope/data.

Architecture notes are in docs/architecture.md. MIT licensed.

Metadata

Release files for nanoscope-lab 0.6.1

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

Source distribution (sdist)

Source distribution for nanoscope-lab 0.6.1
File Size Uploaded Provenance Actions
nanoscope_lab-0.6.1.tar.gz 2.7 MB With provenance Details for nanoscope_lab-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nanoscope-lab 0.6.1
File Interpreter ABI Platform Actions
nanoscope_lab-0.6.1-py3-none-any.whl Python 3 none any Details for nanoscope_lab-0.6.1-py3-none-any.whl

Total release size: 5.3 MB

Release files / nanoscope_lab-0.6.1.tar.gz

Download URL nanoscope_lab-0.6.1.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
9c7d0f8bc4a81b0f06a9ebe47d488d29d9c028b9ccf4d626cbbb8eba3b14c476
BLAKE2b-256 checksum
How to use checksums
2fd3a632c39886b593be959f1a1c36d38d26d913fa87f756e8038cbec45a7da7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / nanoscope_lab-0.6.1-py3-none-any.whl

Download URL nanoscope_lab-0.6.1-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1d6b17d042220ee995ed2853c28f123153383283fc30f339db8c5d1eb4863c6d
BLAKE2b-256 checksum
How to use checksums
70d90c614b23fcb6b6827fa944abef942eacf3a8bd3b0ce7509dfe9606596e2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Security for nanoscope-lab 0.6.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for nanoscope_lab-0.6.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

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