| Drop a star to support Nu ⭐ | Join the Nu Discord community |
Nu – the interaction primitive
Build apps in one primitive that spans your whole stack — databases, UIs, AI agents, and services. No glue. 50x less code.About • Quick Start • Fabrics • Apps • Spec • Examples • Documentation • Community
ℹ️ About
A tiny program is a joy to write. Three lines, one substrate:
a = 2
b = 5
print(a + b)
Real apps don't stay here. a moves into a database. b comes from a form submission. The result renders in a browser. A background job reruns it when either input changes. Three lines become three hundred: an ORM, a request handler, a template, a websocket, a queue. Almost none of it is about a + b anymore — it's all interaction between substrates.
Nu makes interaction the primitive.
- Ref — a name for a value, wherever it lives. A KV slot, a UI widget, an LLM endpoint, a remote object.
- Interaction — what you do with a Ref. Read, write, branch, iterate, compose.
- Fabric — binds Refs to a real backend.
Same program, a and b persisted in a KV store:
import nu
class DB(nu.Shape):
a = nu.kv.IntRef.slot()
b = nu.kv.IntRef.slot()
# compute a + b and print it
compute = DB.a.set(2) >> DB.b.set(5) >> nu.print(DB.a + DB.b)
# assemble: rocksdb-backed
app = nu.With(
nu.kv.rocksdb_navigator(".dbsum"),
body=nu.kv.auto_flow_atomic(compute),
)
nu.run(app)
Same program, result rendered in a live browser dashboard:
import asyncio
import nu
class DB(nu.Shape):
a = nu.kv.IntRef.slot()
b = nu.kv.IntRef.slot()
class Dashboard(nu.ui.Page):
out = nu.ui.TextRef.slot()
class App(nu.ui.Index):
pages = nu.ui.Pages({"/": Dashboard})
# compute a + b and render into the dashboard text block
compute = DB.a.set(2) >> DB.b.set(5) >> Dashboard.out.set(DB.a + DB.b)
# assemble: rocksdb-backed, served over the browser
app = nu.With(
nu.kv.rocksdb_navigator(".dbsum"),
nu.ui.server(nu.kv.auto_flow_atomic(compute)),
)
asyncio.run(nu.arun(app))
Same primitive, different substrate. One Ref for any resource, one Interaction for any op. Nu doesn't care what the backend is.
Persistence, reactivity, atomicity, observability, distribution — not features Nu has. What falls out of naming interactions instead of executing them:
- Persist across restarts — the KV slot is already durable.
- Re-render live on input changes — wrap in a
Reactinteraction. - Handle terabytes — shard the KV Fabric; the Refs don't notice.
- Run distributed across a cluster — bind through
nu.ray; the Refs don't notice.
Full walkthrough at nustack.dev.
🏁 Quick Start
Three steps to a live counter on a browser dashboard, persisted across restarts.
1. Install (Python 3.10+):
pip install "nustack-py[all]"
2. Run the bundled demo:
nu demo run counter
3. Open the browser tab that pops up — the counter ticks once a second, the dashboard mirrors it live. Kill it, run again, it picks up where it left off.
More demos: nu demo list. Full walkthrough at nustack.dev/docs. Source in examples/. For lean installs and source builds see nustack.dev/docs/how-to/install.
🧵 Fabrics
Each fabric binds Refs to a real backend and unlocks a new capability.
| Fabric | What |
|---|---|
nu.mem |
In-memory state fabric. Perfect for cache, hot state, and in-process coordination. |
nu.kv |
Persistent state fabric. Refs over a KV backend (RocksDB, LMDB); transactions, snapshots, and change notifications, built in. |
nu.ui |
Web UI fabric. Same fabric shape as the others, but the Refs are widgets — text, buttons, tables — rendered in the browser and live-updated as your state changes. |
nu.invisibles |
Network fabric. Puts other fabrics on the network — bind a fabric in one process, use it from another; same Refs, same interactions, over TCP or Unix socket. |
nu.ray |
Cluster compute fabric. Teleport a Nu tree to any worker in your Ray cluster; it runs there and returns the result. |
📦 Apps built on Nu
End-user tools written as Nu programs.
| Repo | What |
|---|---|
| nustackdev/nulog | Pure-Python, serverless logger and metrics store. Log and observe metrics from any Python code; entries persist to an embedded KV store and scale to billions, in-process. One line boots a live viewer. |
📐 Spec
Nu is a reference implementation of the interaction model — a language-agnostic specification of what an interaction is, how Refs name locations, and how Interactions compose into programs.
🛣️ Roadmap
TODO.
👥 Community
Nu README badge
Add a Nu badge to your README if you're building on Nu:
[](https://github.com/nustackdev/nu)
Contributing to Nu
Considering contributing to Nu? Start by opening an issue or a PR — the codebase is small and readable, and the model is stable enough to build on.
More questions?
License
Apache-2.0
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nustack_py-0.1.9.tar.gz.
File metadata
- Download URL: nustack_py-0.1.9.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe770d75c01dde71fbecb8d6f1ee68552f9c5b01fe95ef1e7448a8962cb625db
|
|
| MD5 |
16f1b742c18810b4c75900eac77d52f2
|
|
| BLAKE2b-256 |
f91e35baece9d327a1f493fa555c0c9b7164bfff31324b9bb2b8da1e7b219797
|
Provenance
The following attestation bundles were made for nustack_py-0.1.9.tar.gz:
Publisher:
publish-nu.yml on nustackdev/nu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nustack_py-0.1.9.tar.gz -
Subject digest:
fe770d75c01dde71fbecb8d6f1ee68552f9c5b01fe95ef1e7448a8962cb625db - Sigstore transparency entry: 2386918051
- Sigstore integration time:
-
Permalink:
nustackdev/nu@a78e287eeaa440bd3003be599b99492f26034b4c -
Branch / Tag:
refs/tags/nu@0.1.9 - Owner: https://github.com/nustackdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-nu.yml@a78e287eeaa440bd3003be599b99492f26034b4c -
Trigger Event:
push
-
Statement type:
File details
Details for the file nustack_py-0.1.9-py3-none-any.whl.
File metadata
- Download URL: nustack_py-0.1.9-py3-none-any.whl
- Upload date:
- Size: 439.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54b0d11441ba4312c79883202b5ef164e51660040c14c58c20f246b82074a921
|
|
| MD5 |
92faed661f57fbcdb874700b3b8e61f6
|
|
| BLAKE2b-256 |
925490c0f6cb2862afc4e26d0dbe64ca367a1458bd084baf9b339fcddc02a62e
|
Provenance
The following attestation bundles were made for nustack_py-0.1.9-py3-none-any.whl:
Publisher:
publish-nu.yml on nustackdev/nu
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nustack_py-0.1.9-py3-none-any.whl -
Subject digest:
54b0d11441ba4312c79883202b5ef164e51660040c14c58c20f246b82074a921 - Sigstore transparency entry: 2386918054
- Sigstore integration time:
-
Permalink:
nustackdev/nu@a78e287eeaa440bd3003be599b99492f26034b4c -
Branch / Tag:
refs/tags/nu@0.1.9 - Owner: https://github.com/nustackdev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-nu.yml@a78e287eeaa440bd3003be599b99492f26034b4c -
Trigger Event:
push
-
Statement type: