Skip to main content
Drop a star to support Nu ⭐ Join the Nu Discord community
Nu

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.

Discord Twitter Follow

Platform Support PyPI - Python Version PyPI Package License PyPI Downloads



About • Build • Quickstart • Fabrics • 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 = nu.kv.IntRef.slot()

# +1 to a persistent counter
op = DB.hits.set(DB.hits + 1)

app = nu.With(
    nu.kv.rocksdb_navigator(".db"),
    body=nu.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(nu.ui.Page):
    hello = nu.ui.TextRef.slot()

# renders live in the browser
op = Dashboard.hello.set("Hello, browser.")

app = nu.With(
    nu.ui.server(op),
)
...

Powered by React · Zustand.

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 = nu.kv.IntRef.slot()

# any Nu op
op = DB.hits.set(DB.hits + 1)

# same op — teleport it to a worker
remote = nu.cluster.Teleport(op, target="gpu-0")

app = nu.With(
    nu.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 = nu.llm.ChatRef.method(temperature=0.7)

# ask the model
op = Bot.chat(prompt="one-line haiku about rust")

app = nu.With(
    nu.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.

→ Explore all fabrics

🏁 Quickstart

Install, run a demo, start hacking.

01 · Install

Python 3.10+ · everything ships in the wheel.

pip install "nustack-py[all]"

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
counter demo A live counter, persistent across restarts.
nu demo counter
sampled demo An infinite series, live-sampled into a line-chart.
nu demo sampled
movies
movies demo A movie tracker: form, filterable table, detail pages.
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.

🧵 Fabrics

Each fabric gives your Nu app a new capability. These are the ones Nu ships with today.

Fabric What Primary interaction
nu.kv Persistent state. State.movies.append(m)
nu.ui Reactive web UI. Dashboard.count.set_value(n)
nu.cluster Cluster compute. Teleport(Add(1,2), "gpu")
nu.llm OpenAI-compatible chat. Bot.chat(prompt="…")
nu.mem In-memory state. users.age.set(12)
nu.proxy Fabrics over the network. Proxy(Nav, "10.0.0.1")
nu.http Nu meets the web. Solana.get_slot()
nu.service Python objects as Refs. Calc.add(a=2, b=3)
nu.cc Claude Code as a Ref. Agent.ask(prompt="…")
nu.mp Local parallel execution. Teleport(Add(1,2), "worker")

📦 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.

nustackdev/interaction-model

🛣️ Roadmap

nu.agents fabric — LLM authors Nu programs.

No tool-calling loop. The model's reply is a Nu tree, evaluated in the Context the agent runs in. The Refs bound in scope are the agent's surface — bind different Refs, get a different agent.

  • Safe by construction. Nu's laws validate the tree before any effect fires; With / Provide scoping bounds what the model can touch.
  • Inspectable, replayable, diffable. A Nu program is a data structure.

👥 Community

Nu README badge

Add a Nu badge to your README if you're building on Nu:

Nu

[![Nu](https://img.shields.io/badge/built%20with-Nu-%237A4CE0)](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?

  1. Read the docs
  2. Open a feature request or report a bug
  3. Join the Discord community

License

Apache-2.0

Metadata

Release files for nustack-py 0.1.15

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

Source distribution (sdist)

Source distribution for nustack-py 0.1.15
File Size Uploaded
nustack_py-0.1.15.tar.gz 1.5 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for nustack-py 0.1.15
File Interpreter ABI Platform
nustack_py-0.1.15-py3-none-any.whl Python 3 none any Details

Total release size: 1.9 MB

Release files / nustack_py-0.1.15.tar.gz

Download URL nustack_py-0.1.15.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
a1437cfd7c1a5feb3e4ddb4fb2517e628b4713f5fc4eaaa8bd98657480b56d82
BLAKE2b-256 checksum
How to use checksums
6a2cca0429f55ce3ebb25129f136e0900c9d3542e3a3efac9d0122d344fb85bb
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 Aug 19, 2026.

Transparency log

Release files / nustack_py-0.1.15-py3-none-any.whl

Download URL nustack_py-0.1.15-py3-none-any.whl
Size 480.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd09870dd1247a87f8b016e19369e7da64bc24b82da5b062867abeed7681f5f0
BLAKE2b-256 checksum
How to use checksums
ead268bfabbb48767e12f637f9f7c664ffbf8506d643ac5b62eb7b1289ea42e8
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 Aug 19, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

This release

0.1.15 This release

2 release files

0.1.14

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

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