Model or dataset
gakonst/nanocodex avatar
gakonst/nanocodex

Nanocodex: an embeddable OpenAI coding-agent lifecycle in Rust

Building blocks for frontier OpenAI agents in Rust. Nanocodex empowers you with Codex-level performance anywhere.

493 stars58 forksRustApache-2.0

At a glance

What is it?
Nanocodex packages the OpenAI Responses loop (retained sessions, typed history, tools, events, retries, cleanup) as a Rust library that other languages bind to. It is a narrow, opinionated stack, not a provider abstraction, and its release channel is nightly.
Who is it for?
Adopt Nanocodex if you are building a product on the OpenAI coding-agent stack and want the session, tool and cleanup lifecycle owned by Rust instead of reimplemented in your app. Do not adopt it if you need provider portability or a stable release channel: the published tags are nightly builds and the README states plainly that this is not a provider abstraction.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The rebuild work Nanocodex removes from the caller

The README frames the project around what the caller does not have to rebuild. The list is concrete: no passing previous messages, response IDs or tool results back on every turn; no separate state machine for prompt ordering, steering, compaction, reconnect replay or partially completed responses; no coupling between receiving a typed result and consuming an event stream; no orphaned shell sessions or subprocess trees when a turn is cancelled; and no second orchestration runtime when an agent forks or delegates work. Each of those is a piece of glue that normally lives in the application and drifts out of sync with the model API. The audience is therefore teams building a product around one coding agent, not teams comparing providers. The README states the scope directly: it is not a provider abstraction and it is not an app server. The public product is an embeddable agent with an owned lifecycle, and the CLI, browser apps, Python and JavaScript packages, durable actors, sandboxes, voice client and evaluation harness are described as consumers that exercise the same contract.

Turn handles, session events and a constant-time clone

The Rust example in the README shows the shape of the API. You construct an OpenAi client from OPENAI_API_KEY, then Nanocodex::builder(openai) with .instructions(...) and .workspace(std::env::current_dir()?) returns a tuple of an agent and an AgentEvents value. The first await on agent.prompt(...) accepts and orders the prompt; the returned Turn is both an independently awaitable future for TurnResult and an optional per-turn event stream. The separate AgentEvents value is the session-wide stream, and the README notes that neither stream has to be drained for the result to complete. That decoupling is the design point: a headless consumer can await results only, while a TUI can subscribe without blocking completion. Follow-on prompts reuse the same retained typed history, persistent Responses WebSocket, response chain, cache identity, tools, Code Mode worker and shell sessions. agent.clone() is described as a constant-time command capability to that same session, which means cloning the handle does not fork the agent state. agent.shutdown() cancels unfinished work and joins model, tool, transport and process cleanup.

Three install paths with different maturity

The README is explicit that the host languages differ in how you get them. Rust is a registry release: cargo add nanocodex. Node.js 22.13 or newer installs with npm install nanocodex and is described as the published package's consumer floor. The Python binding (3.11+) is currently built from a repository checkout, with the documented sequence of uv venv --python 3.11 py/bindings/.venv, then uv pip install of maturin>=1.9,<2 into that venv, then VIRTUAL_ENV="$PWD/py/bindings/.venv" py/bindings/.venv/bin/maturin develop --manifest-path py/bindings/Cargo.toml. The README states that the Python binding and the JavaScript companion packages under js/ are built from the checkout rather than published. Developing from the repository pins Rust 1.97, the wasm32-unknown-unknown target, wasm-bindgen-cli 0.2.126, Node.js 24 from .node-version, and pnpm 11.25.0 from the root packageManager field. pnpm dev starts the Turbo stack through Portless; local HTTPS needs one-time certificate trust, binding port 443 may need administrator approval on macOS, and PORTLESS_PORT=1355 pnpm dev avoids the privileged bind. The native CLI installs with curl -fsSL https://nanocodex.paradigm.xyz | bash on Apple Silicon macOS or x86-64 glibc Linux.

Account keys, provider credentials and Connect grants are three separate things

Authentication is split in a way that is easy to get wrong. The README describes nanocodex2 login signing in with an SMS code and saving an account key, nanocodex2 status verifying it, and nanocodex2 logout removing the local login; nanocodex account login/status/logout manages the same saved account. Those account keys are separate from nanocodex auth, which holds ChatGPT provider credentials, and separate again from nanocodex login/connect/status/logout, which manage Connect installation grants. The CLI account sign-in guide is cited for environment overrides, storage and key revocation. If you are embedding the library rather than running the CLI, the Rust example only needs OPENAI_API_KEY, but anyone operating the managed-agent path has three credential surfaces to keep distinct. Treat that as an operational cost, not a footnote.

Nightly tags and a checkout-built Python binding

The release list is the clearest limitation. The recent tags are nightly-10063a4ff422d5fe71155dd462417ea30797f142 (labelled Nanocodex Nightly, 2026-09-10), a plain nightly tag from 2026-07-22, and nightly-2259311e297e28233336262a127132a44476fff7 (2026-09-09). There is no stable version line in the material provided, so a team that requires semantic-versioned releases has nothing to pin to. The second limitation is distribution: the README says the Python binding and the JavaScript companion packages under js/ are built from the repository checkout, which means your build pipeline has to carry a Rust toolchain and maturin rather than resolving an artifact from a registry. The third is platform: the CLI installer names Apple Silicon macOS and x86-64 glibc Linux, so other targets are not covered by that path. Finally, the scope itself is a limitation. If your product needs to swap between model providers behind one interface, Nanocodex is the wrong tool by design, because the README states it is not a provider abstraction.

How this differs from a general agent framework

A framework such as LangChain or LlamaIndex starts from provider abstraction and composable chains, and leaves session retention, reconnect replay and subprocess cleanup to you or to add-on packages. Nanocodex inverts that: it supports one deliberately chosen OpenAI coding-agent stack and spends its complexity on the lifecycle instead of on adapters. The README's own comparison target is lower level still, assembling a model client and a loop by hand. The practical difference is where the state lives. With a hand-rolled loop, the caller owns message history, response IDs, tool result submission and cancellation cleanup. With Nanocodex, the retained typed history, the persistent Responses WebSocket and the shell sessions belong to the agent, and the caller holds a cheap cloneable handle. The trade is portability for lifecycle: you give up the ability to point the same code at a different vendor's API, and you get a turn model where an undrained event stream does not stall the result.

Licence, packaging and what maintenance looks like

The repository is Apache-2.0 per the description, while the README badge and the license link point at LICENSE-MIT and read MIT OR Apache-2.0. That discrepancy is worth resolving against the actual LICENSE files before you rely on either identifier; this is a description of what the material shows, not legal advice. Maintenance cost is dominated by the toolchain pins rather than by API churn: Rust 1.97, wasm32-unknown-unknown, wasm-bindgen-cli 0.2.126, Node.js 24 for repository development, and pnpm 11.25.0 from the packageManager field. Upgrading means moving those pins together, and the nightly tag names embed commit hashes, so a version bump is a commit bump. The desktop app adds its own surface: pnpm build:macos after preparing the documented bundled Node runtime, with the macOS README covering account setup, native controls and real-service verification. The bin/nanocodex/src/update.rs release switcher is documented separately, which suggests the CLI is intended to move between release tags rather than track a single version.

Editorial conclusion

Adopt Nanocodex if you are building a product on the OpenAI coding-agent stack and want the session, tool and cleanup lifecycle owned by Rust instead of reimplemented in your app. Do not adopt it if you need provider portability or a stable release channel: the published tags are nightly builds and the README states plainly that this is not a provider abstraction. Verify first that your target platform is covered (the CLI installer names Apple Silicon macOS and x86-64 glibc Linux), that Node.js 22.13 or newer is acceptable on the consumer side, and that your OpenAI credentials and account key model match the three separate login flows described in the CLI guide.

Official sources

  1. gakonst/nanocodex on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Community notes

Community notes