Metadata-Version: 2.5
Name: nudemos
Version: 0.1.1
Summary: The Nu demos as nuspace Planes: a counter, a sampled series, a film base and MNIST trained live.
Project-URL: Repository, https://github.com/nustackdev/nuverse
Author-email: Gor Arakelyan <gorarkln@gmail.com>
License-Expression: Apache-2.0
Requires-Python: >=3.10
Requires-Dist: nuspace
Provides-Extra: agents
Requires-Dist: nustd[cc]; extra == 'agents'
Provides-Extra: memes
Requires-Dist: nustd[http]; extra == 'memes'
Provides-Extra: mnist
Requires-Dist: torch>=2.2; extra == 'mnist'
Requires-Dist: torchvision>=0.17; extra == 'mnist'
Description-Content-Type: text/markdown

# nudemos

The Nu demos as [nuspace](https://github.com/nustackdev/nuspace) Planes `+` creates, under Demos:

- **Counter**: a count ticking once a second, kept in its cell's state.
- **Sampled**: a series that grows forever, charted from a reservoir sample.
- **Movies**: a film base where every film and person is its own live page.
- **MNIST**: train a small CNN, steer it while it trains, and track every run. Needs the `mnist` extra.
- **Memes**: a live terminal over the meme market on Solana: launches, trades and every coin's page, synced from public mainnet. Needs the `memes` extra.
- **Agents**: Claude Code sessions run, watched, steered and orchestrated from a space. One agent is one Claude Code session in a page, driven by a short Nu loop; fan-out with a judge, chains and task boards are a few lines of Nu each. Needs the `agents` extra and a logged-in `claude` CLI, no API key.
- **Nu demos**: all three at once, nested under one plane.

```
pip install nudemos
```

nuspace finds it on install through the `nuspace.extensions` entry point. You don't import it yourself.

## MNIST

Launch picks the knobs (optimizer, learning rate, batch size, channels, epochs, dropout) and starts a run: a page, and a headless job under it that trains in its own process. A run page shows the curves, twelve test digits and what the model reads in each, and every layer's weights and gradients over training. Drag the learning rate while it trains, stop it, resume it. Compare lines the runs up. Read puts a run's model to work: pick a run and its latest or best checkpoint, draw a digit, and it reads it on every stroke, showing the 28x28 image the model sees. Pick a run that is still training, or just launch one (the page follows the newest run until you pick), and the same drawing is read again as each checkpoint lands.

Nu owns the loop, torch owns the step: the job cell is a Nu loop over a trainer resource, reading its learning rate from state each chunk. Close the space mid run and open it again: the run carries on from its last checkpoint.

Models live in the space, not in files: each run keeps its latest checkpoint (what it resumes from) and the weights at its best test score, in its own state.

```
pip install "nudemos[mnist]"
```

MNIST downloads once, on the first run, into `~/.cache/nuverse-mnist` (`$NUVERSE_MNIST_DATA` to move it). Runs train on cuda, or mps on Apple silicon, else the cpu (`$NUVERSE_MNIST_DEVICE` to pick). Three epochs take about a minute on a laptop cpu.
