A lightweight personal AI assistant framework
Project description
English | 简体中文 | 繁體中文 | Español | Français | Bahasa Indonesia | 日本語 | 한국어 | Русский | Tiếng Việt
Discord · X · WeChat / Feishu
nanoinfra
🐈 nanoinfra is an ultra-lightweight, open-source, self-hosted personal AI agent framework written in Python. It runs in a WebUI, terminal, or chat apps and combines tools, long-term memory, MCP integrations, model routing, multi-agent delegation, scheduled automation, and an OpenAI-compatible API in a small, readable core.
Start Here
| You want to... | Go to |
|---|---|
| Install nanoinfra with no terminal/config background | Start Without Technical Background |
| Install quickly and get one CLI reply | Install and Quick Start |
| Open the bundled browser UI | WebUI |
| Connect Telegram, Discord, WeChat, Slack, Email, Mattermost, or another chat app | Chat Apps |
| Configure providers, fallback models, Langfuse, MCP, web tools, or security | Docs and Configuration |
| Understand or extend the internals | Architecture and Development |
| Deploy to the cloud or keep nanoinfra running as a service | Deployment |
What can nanoinfra do?
nanoinfra is a self-hosted personal AI agent runtime. It can:
- run in a browser WebUI or terminal
- connect to Telegram, Discord, Slack, WeChat, Email, Mattermost, and other chat apps
- use tools such as files, shell, web search, web fetch, MCP, cron, image generation, and subagents
- keep session history and long-term memory through Dream
- run long-horizon goals and scheduled automations
- expose a Python SDK and OpenAI-compatible API for integrations
- deploy as a long-running local or server-side agent gateway
💡 Why nanoinfra
- Persistent workflows: goals, memory, tools, and chat context survive long-running work.
- Chat-native reach: WebUI, API, Telegram, Feishu, Slack, Discord, Teams, email, and Mattermost.
- Model freedom: OpenAI-compatible APIs, local LLMs, image generation, search, and fallbacks.
- Small core: readable internals with MCP, memory, deployment, and automation built in.
- Own your stack: inspect, customize, self-host, and extend without a giant platform.
📦 Install
[!IMPORTANT] If you want the newest features and experiments, install from source.
If you want the most stable day-to-day experience, install from PyPI or with
uv.
Pick one install method:
Prerequisites: Python 3.11 or newer. Git is only needed for a source install. Published packages already include the WebUI; a current-source install needs bun or npm to build it.
If terminals, API keys, or config files are new to you, use the guided zero-background walkthrough in Start Without Technical Background instead of this compact README path.
One-command setup
macOS / Linux:
curl -fsSL https://raw.githubusercontent.com/bet0x/nanoinfra/main/scripts/install.sh | sh
Windows PowerShell:
irm https://raw.githubusercontent.com/bet0x/nanoinfra/main/scripts/install.ps1 | iex
The default command installs or upgrades nanoinfra from PyPI. On a fresh local desktop, it then starts nanoinfra webui so you can configure the first provider and model in Settings → Models. SSH, headless, existing-config, and older-release paths keep the terminal setup wizard. The installer avoids system-wide pip installs by using an active virtual environment, uv, pipx, or a managed venv under ~/.nanoinfra/venv. It also prints the exact command it used to run nanoinfra; reuse that full command below if nanoinfra is not on PATH.
To preview the plan without changing your environment, pass --dry-run; combine it with --dev when you want to preview the main-branch install.
curl -fsSL https://raw.githubusercontent.com/bet0x/nanoinfra/main/scripts/install.sh | sh -s -- --dry-run
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/bet0x/nanoinfra/main/scripts/install.ps1))) --dry-run
To install the current main branch instead, pass --dev:
curl -fsSL https://raw.githubusercontent.com/bet0x/nanoinfra/main/scripts/install.sh | sh -s -- --dev
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/bet0x/nanoinfra/main/scripts/install.ps1))) --dev
If you prefer to inspect the script first, open scripts/install.sh or scripts/install.ps1.
Install with uv
uv tool install nanoinfra
Install from PyPI with pip
python -m pip install nanoinfra
If pip reports externally-managed-environment on macOS or Linux, use the one-command installer, uv tool install nanoinfra, pipx install nanoinfra, or install inside a virtual environment.
Install from source
bun or npm must be available. From an activated virtual environment:
git clone https://github.com/bet0x/nanoinfra.git
cd nanoinfra
python -m pip install .
On Windows, if pip reports that it cannot launch npm, run cd webui, npm.cmd install --package-lock=false, npm.cmd run build, and cd .. in order, then retry the install. Contributors who need an editable checkout should follow CONTRIBUTING.md and webui/README.md.
Verify the install:
nanoinfra --version
If nanoinfra is not on PATH, invoke it through the method that installed it: reuse the recommended installer's command, use uv tool run --from nanoinfra nanoinfra ... or pipx run --spec nanoinfra nanoinfra ..., or use the Python executable from the environment where pip installed the package.
🚀 Quick Start
Open nanoinfra in your browser
nanoinfra webui
This is the recommended first run. The launcher creates the config and workspace when needed, safely enables the local WebSocket channel after confirmation, starts the gateway, and opens http://127.0.0.1:8765. A fresh install can open before a model is configured, so setup continues in the browser instead of beginning in a JSON file. The first-run WebUI binds to localhost by default and is not exposed to your LAN.
Your first three steps
- Open Settings → Models and choose a provider, credential, and model.
- Start a new topic and send
Hello!to verify the connection. - Before project work, choose the intended workspace and access mode from the composer.
Any normal reply means the provider, model, workspace, and browser gateway are working together.
Keep nanoinfra running after you close the terminal
nanoinfra webui --background
This starts the same full gateway as nanoinfra webui, opens the browser, and leaves channels and automations running after the launcher exits. Complete first-time model setup with foreground nanoinfra webui before switching to background mode.
nanoinfra gateway status
nanoinfra gateway logs
nanoinfra gateway restart
nanoinfra gateway stop
Prefer a gateway-first workflow?
nanoinfra gateway
This skips WebUI setup and browser opening, then runs the same complete gateway in the current terminal. It is the familiar entry point if you are coming from OpenClaw or already operate agents as long-lived services. The WebUI remains available when its channel is configured; open it manually when needed.
Use nanoinfra gateway --background for the same direct entry point without keeping the terminal attached. For automatic startup and supervision by the operating system, see Deployment.
Prefer to work entirely in the terminal?
nanoinfra agent
This opens an interactive terminal chat with the same configured model, workspace, and tools while keeping its own CLI session history. It does not open a browser or keep chat channels and automations running after you exit. Type exit or press Ctrl+C when you are done.
For one request and an immediate exit, use:
nanoinfra agent -m "Hello!"
The one-shot form is useful for a quick provider check, shell scripts, and local automation. If you have not configured a model yet, run nanoinfra webui and open Settings → Models first.
Need manual JSON, another device on your LAN, or help with provider/model matching? Continue with Install and Quick Start, WebUI, or Troubleshooting.
If nanoinfra worked for you, a star on GitHub is the simplest way to support the project.
- Want a pasteable provider setup? See Provider Cookbook
- Want to understand provider/model matching? See Providers and Models
- Want web search, MCP, security settings, or more config options? See Configuration
- Want to run locally? See Ollama, vLLM or another local OpenAI-compatible server, and the full provider reference.
- Want to run nanoinfra in chat apps like Telegram, Discord, WeChat or Feishu? See Chat Apps
- Want Docker or Linux service deployment? See Deployment
☁️ Deploy
Render — one click
Deploy nanoinfra's gateway and bundled WebUI from the repository's ready-to-use Blueprint:
Render will ask for ANTHROPIC_API_KEY and a private NANOINFRA_WEB_TOKEN, then provision persistent storage for sessions, memory, and WebUI history. Persistent disks require a paid Render service.
Self-host
Prefer your own infrastructure? Follow the deployment guide for Docker, Docker Compose, Linux services, and macOS LaunchAgent setup.
🌐 WebUI
The WebUI ships inside the published wheel with no separate frontend build. It is the browser workbench for persistent topics, visible agent activity, workspace controls, Apps, Skills, Automations, and settings.
Use it to:
- keep separate topics for different tasks and projects;
- inspect reasoning, tool calls, file edits, diffs, command output, and generated artifacts;
- switch models and workspaces without leaving the conversation;
- configure providers, chat channels, Apps, Skills, and Automations from one place.
See the WebUI guide for LAN access, background operation, workspace controls, and the full feature tour. Working on the frontend itself? Use webui/README.md.
🏗️ Architecture
🐈 nanoinfra stays lightweight by centering everything around a small agent loop: messages come in from chat apps, the LLM decides when tools are needed, and memory or skills are pulled in only as context instead of becoming a heavy orchestration layer. That keeps the core path readable and easy to extend, while still letting you add channels, tools, memory, and deployment options without turning the system into a monolith.
📚 Docs
Browse the repo docs for the latest features and GitHub development version, or visit nanoinfra.wiki for the stable release documentation.
- Use task-oriented guides: Guides
- Start with no technical background: Start Without Technical Background
- Start from zero with developer basics: Install and Quick Start
- Understand the runtime model: Concepts
- Read the source-level map: Architecture
- Choose a provider/model: Providers and Models
- Copy provider setup recipes: Provider Cookbook
- Debug setup and runtime failures: Troubleshooting
- Talk to your nanoinfra with familiar chat apps: Chat App AI Agent · Chat Apps
- Schedule or trigger agent work: Automations
- Configure providers, web search, MCP, and runtime behavior: Configuration
- Integrate nanoinfra with local tools and automations: OpenAI-Compatible API · Python SDK
- Run nanoinfra with Docker or as a Linux service: Deployment
Releases
Latest release: v0.3.0 - The Agency Release
The Agency Release turns nanoinfra from a durable workbench into an agent runtime that can coordinate helpers, switch models per session, and carry authorized work through to completion.
- Consult inline subagents without leaving the current task
- Switch model presets per session directly from the composer
- Start from a guided WebUI setup with clearer execution controls
- Apply configuration changes live across a more reliable provider, channel, and tool runtime
Recent Updates
- 2026-07-24 Guided first-run setup, inline subagents, and model switching from the composer.
- 2026-07-23 Grok OAuth with hosted X Search, live image settings, and clearer fallback models.
- 2026-07-22 Parallel Search, live configuration reloads, richer app discovery, and a smoother mobile WebUI.
- 2026-07-21 Codex fast mode, visible skill references, safer configuration saves, and sturdier task cleanup.
- 2026-07-20 Cleaner code blocks and copy actions, self-contained channels, and steadier QQ reconnects.
For older updates, see the release archive or GitHub releases.
Open Source Partners
🤝 Contribute
Use nanoinfra for a real task, report what broke, and then pick a focused improvement.
- Read CONTRIBUTING.md for the development workflow.
- Browse open issues for problems to investigate.
- Open a pull request for a focused fix or integration.
Contact
Nanoinfra is a fork of nanobot, the original open-source project started by Xubin Ren. This fork is maintained by Alberto Ferrer. Feel free to contact albertof@barrahome.org for questions, ideas, or collaboration.
Contributors
Thanks for visiting ✨ nanoinfra!
Project details
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 nanoinfra-0.3.0.tar.gz.
File metadata
- Download URL: nanoinfra-0.3.0.tar.gz
- Upload date:
- Size: 2.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a26374f90cec524800edcdbdc601752ef16ac1c8c96b849a0dec30d757f35c74
|
|
| MD5 |
0c03818603b3a8b7ca0404c69623017f
|
|
| BLAKE2b-256 |
01df865666a3cb6358f1aedccd8d428fa909e3c8f4047d78c8f58ec5541be5a7
|
File details
Details for the file nanoinfra-0.3.0-py3-none-any.whl.
File metadata
- Download URL: nanoinfra-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
384c89f26d3656a9299c8ec6ae7054e567ae475cbe2ee74d596b2f9353fce510
|
|
| MD5 |
cc2a2edc03da60e85a4f18e0f373912c
|
|
| BLAKE2b-256 |
6a6754031472ec5c99aa7cc39a13e3492a672f7c378dbaadbd926b05610f2684
|