| 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 • Build • Quickstart • Nu STD • Apps • Spec • Examples • Docs • Community
ℹ️ About
The primitive Nu is built on, in three words.
A tiny script keeps its values in memory and calls functions on them. Real apps don't stay there. Values live in a database, arrive from a browser form, render into a dashboard, get recomputed by a background job. Almost none of the code is about the values anymore — it's all interaction between systems.
Nu makes interaction the primitive.
- Ref — a name for a value, wherever it lives: a KV slot, a UI text block, an LLM endpoint, a remote object.
- Interaction — what you do with a Ref: read, write, branch, iterate, compose.
- Fabric — binds Refs to a real system. Compose as many as you need; they all speak the same primitive.
Same primitive, different system. One Ref for any resource, one Interaction for any op. Setting a browser text block is the same interaction as setting a KV slot.
Nu is the reference implementation of the interaction model in Python.
🧱 Build with Nu
A few of Nu's fabrics — state, UIs, cluster, models. Same Python, same code shape.
Persistent state
Persistent state. Stores any Python type.
Reach any value by name; it survives restarts. Same code local or sharded across a cluster.
- Serverless, scales to terabytes
- Store any Python type
...
class DB(nu.Shape):
hits = nustd.kv.IntRef.slot()
# +1 to a persistent counter
op = DB.hits.set(DB.hits + 1)
app = nu.With(
nustd.kv.rocksdb_navigator(".db"),
body=nustd.kv.auto_flow_atomic(op),
)
...
Powered by virtuals · rdbpy · RocksDB · LMDB.
Live browser UIs
Reactive UIs from Python. No JS, no build step, no websocket you had to write.
A text block, a chart, a form — set them like variables, they render. Update the value, the browser updates itself.
- 50+ components out of the box
- Live updates for free
...
class Dashboard(nustd.ui.Page):
hello = nustd.ui.TextRef.slot()
# renders live in the browser
op = Dashboard.hello.set("Hello, browser.")
app = nustd.ui.serve(Dashboard, op)
...
Distributed execution
Same code runs local or across the cluster. No worker pool to run.
Teleport any Nu tree to any worker; it runs there and returns the result. Where it runs is a binding, not a rewrite.
- Same code, local or remote
- Distribute with a single line
...
class DB(nu.Shape):
hits = nustd.kv.IntRef.slot()
# any Nu op
op = DB.hits.set(DB.hits + 1)
# same op — teleport it to a worker
remote = nustd.cluster.Teleport(op, target="gpu-0")
app = nu.With(
nustd.cluster.RayCluster(),
body=remote,
)
...
Powered by Ray.
LLM calls
One wire, N providers. Ollama, OpenAI, OpenRouter, Groq, xAI — same call.
LLM chat as a Ref. Swap the model string, keep the code. Local models and hosted APIs meet at the same interface.
- Add intelligence to any Nu app
- 7 providers out of the box
...
class Bot(nu.Service):
chat = nustd.llm.ChatRef.method(temperature=0.7)
# ask the model
op = Bot.chat(prompt="one-line haiku about rust")
app = nu.With(
nustd.llm.ollama(Bot, host="localhost", model="qwen2.5:7b"),
body=op,
)
...
And more
Nu is batteries-included and covers the common cases. In-memory state, proxy, HTTP, Python objects, Claude Code, local parallelism — same model, same shape, same primitive as the four above.
🏁 Quickstart
Install, run a demo, start hacking.
01 · Install
Python 3.10+ · everything ships in the wheel.
pip install nucore "nustd[all]" nucli
02 · Run a demo
Each one boots a live browser dashboard and picks up where it left off on restart. nu demo lists them all.
| counter | sampled |
|---|---|
nu demo counter |
nu demo sampled |
| movies | |
nu demo movies |
03 · Start hacking
- Read the docs — tutorials, how-tos, and the fabric reference.
- Browse examples — full source for every demo, plus more programs to steal from.
🔋 Nu STD
Batteries included. 26 modules ship on top of the kernel.
Twelve are fabrics. Bind one and every Ref inside the bracket reaches a real system.
The rest re-surface Python's standard library. Call them anywhere, no binding. Same names, same call shape as the stdlib, except a call hands back a tree, not a value. So it composes into the rest of the program.
pip install nucore "nustd[all]" # every backend
pip install nucore "nustd[kv,ui]" # or one extra per fabric
| Module | What | Looks like |
|---|---|---|
| nustd.kv | Persistent state. | State.movies.append(m) |
| nustd.ui | Reactive web UI. | Dashboard.count.set_value(n) |
| nustd.cluster | Cluster compute. | Teleport(op, target="gpu") |
| nustd.llm | OpenAI-compatible chat. | Bot.chat(prompt="…") |
| nustd.mem | In-memory state. | users.age.set(12) |
| nustd.proxy | Fabrics over the network. | InvisiblesProxy(Nav, address=...) |
| nustd.http | Nu meets the web. | Solana.get_slot() |
| nustd.service | Python objects as Refs. | Calc.add(a=2, b=3) |
| nustd.cc | Claude Code as a Ref. | Agent.ask(prompt="…") |
| nustd.mp | Local parallel execution. | Teleport(op, target=0) |
| nustd.mp_pool | A pool of workers, as a fabric. | Teleport(body, worker=w) |
| nustd.ws_server | Serve websocket clients. | SessionFor(body=arm) |
| nustd.math | Math functions and constants. | math.sqrt(2) |
| nustd.cmath | complex and its companions. |
cmath.polar(z) |
| nustd.random | The global RNG. | random.randint(1, 6) |
| nustd.time | The process clock. | time.monotonic() |
| nustd.datetime | Dates, times, deltas, timezones. | datetime.date.today() |
| nustd.itertools | Iterator building blocks. | itertools.product(a, b) |
| nustd.functools | A fold over a stream. | functools.reduce(Add, xs) |
| nustd.asyncio | The non-blocking sleep. | asyncio.sleep(1) |
| nustd.logging | Loggers and level shortcuts. | logging.getLogger(__name__) |
| nustd.pathlib | Lexical path operations. | pathlib.Path.of("a", "b") |
| nustd.uuid | UUIDs, all four versions. | uuid.uuid4() |
| nustd.decimal | Exact decimal arithmetic. | Decimal.of("0.1") |
| nustd.fractions | Exact rational arithmetic. | Fraction.of(1, 3) |
| nustd.fin | Nu's own financial types. | Percentage.of(75.5) |
📦 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. |
| nustackdev/nuagent | An AI agent that speaks Nu. The model answers with a program, not a tool call, so one turn reads, branches, loops and writes across real state. |
| nustackdev/nuspace | Nu runtime built on Nu, self-hosted. |
📐 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.
👥 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
Release files for nucore 0.5.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nucore-0.5.3.tar.gz | 278.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nucore-0.5.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 672.6 kB
Release files / nucore-0.5.3.tar.gz
| Download URL | nucore-0.5.3.tar.gz |
|---|---|
| Size | 278.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9487a96d087e6849b22cec772340babfba86d4b3b373d3c292254b949210199b
|
|
BLAKE2b-256 checksum How to use checksums |
4023f9189a8b7bb17160831720ff846b0abd5987a9f95c61299ab5a35354daa5
|
| 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 Sep 25, 2026.
Transparency logRelease files / nucore-0.5.3-py3-none-any.whl
| Download URL | nucore-0.5.3-py3-none-any.whl |
|---|---|
| Size | 393.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6a33a90faa661bfabada89e0575ece71f6ccc31bf6c5e55362fcc6d6e9d6951
|
|
BLAKE2b-256 checksum How to use checksums |
9d93748cdd86b77892073ca03dc09686503ba991d12a15ce2071b4bd29b26d36
|
| 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 Sep 25, 2026.
Transparency log