Nanosaur2-670M
well9472 · Kit
Makes illustrations from text prompts with a small 670M-parameter diffusion model, run through ComfyUI. Built as a low-budget research model for people who wan…

ranxianglei’s local proxy for long coding-agent sessions. It folds old conversation into summaries that can be unfolded later, so one session can run for days in a small window. Works with Claude Code, Codex, OpenCode, pi, DeepSeek’s dsh and about twenty more.
Billion Context is an open-source project on GitHub in the Developer category, listed by Mindket. It is free. This is version 2, last updated on . Install it from GitHub as its README says. Get Mindket’s setup notes on your Mindket account, as a zip.
npm install -g billion-context --prefix=~/.local
And 2 more in Where to use it
Billion Context is a proxy that runs on your computer between a coding agent and the model it calls. The model gets four tools to manage its own history: compress, decompress, search_context and acp_status. It folds a range of old messages into a summary, and it can unfold that range or search the summaries when exact detail matters. Its maker, ranxianglei, describes it as a context-compression plugin for month-long single sessions, small context windows (a 100K window is enough) and token savings (5x fewer tokens). Those figures are the maker’s claims.
Developers who leave a coding agent on one task for hours or days and watch old tool output fill the window. It also suits people on models with small windows. People who pay per token get a cache report that shows what each fold saved. Skip it if your sessions are short, or if you do not want a local proxy that updates itself. Exact recall of one sentence buried in a huge document is also weaker: the maker’s own benchmark loses ground there.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Software teams | Developers running long agent sessions | Route the agent through the proxy so old tool output is folded away as the session grows | A developer on a long refactor keeps one session going instead of restarting when the window fills. |
| Smaller or cheaper models | People whose model has a window of 100K or less | Let the model compress its own history so a small window stays usable | A user on a 100K model keeps working past the point where the full history would not fit. |
| Agent research | People testing very long agent tasks | Put the proxy in front of the agent to test long-horizon memory | The benchmark in its repository fed a 1.48M-token log through it, where the run without compression failed. |
The README names 21 clients in its table and lists launchers for three more. The topic dsh-plugin on the repository points at dsh, an open-source project from DeepSeek AI for running agents. A client connects by one of three routes.
| Client | Route | Note |
|---|---|---|
| Claude Code | Launcher, native install or plugin marketplace | With the native install, the Claude Desktop app’s Code tab bypasses the proxy |
| Codex CLI | Launcher | The plugin install alone adds tools but routes no traffic |
| OpenCode, pi, omp | Launcher or native install | Native install turns OpenCode’s own auto-compaction off |
| DeepSeek’s dsh | Launcher or dsh plugin add | dsh’s own auto-compaction is turned off |
| Kimi Code, Hermes | Launcher or native install | The Kimi Code native install needs 2.0.0 or later |
| ZCode | Native install, or a proxy and CA path set in its settings | It has no bili launcher |
| Gemini CLI, Qwen Code, aider, Copilot CLI, goose and others | Launcher, and for several the URL prefix | No native plugin. A personal Google login for Gemini CLI is not covered |
| Cline, Roo Code, Continue, OpenHands, Cursor, Warp | URL prefix | Works with an API key, not a sign-in |
Get it saves a zip of Minda’s setup notes in your downloads folder, with each client’s steps from ranxianglei’s README and docs. The main route is one npm install, then one command for your client.
| Need | Detail |
|---|---|
| Node.js | 20 or later, as the package’s engines field says. Below 22.5 the session index downloads a SQLite engine from the npm registry once, about 11 MB |
| A coding agent | One from the table above, signed in or holding your own API key |
| Ports | A manually started proxy uses 8787. Launchers and native plugins start their own from 18787 up |
npm install -g billion-context --prefix=~/.local
npm install -g billion-context
The launcher is the lightest route. It edits no config, and traffic goes direct again the moment you stop running the command.
bili claude
Claude Code can also add it from inside a session, as a plugin marketplace.
/plugin marketplace add ranxianglei/billion-context /plugin install billion-context@billion-context /billion-context:bili-setup
Work in your client as before. The model decides when to compress. By default the proxy nudges it as the conversation grows, in steps of about 50K tokens. It also folds on its own as a hard backstop when a request alone would overflow the window. The first fold comes 50K tokens past the starting content, so a large system prompt and tool list push it later.
In OpenCode, dsh and Hermes, typing /acp shows the status panel for the current conversation. The /acp-cache command prints a cache report with a health verdict and the net tokens saved per fold. The maker’s rule of thumb: compression itself costs 2 percent or less, and a healthy session sits at 95 to 97 percent cache hits. A local page at http://localhost:8787 adds logs and a config editor.
You use Claude Code with an API key and want proof that the proxy answers before a long session, so you start it in one terminal and ask for its health from another.
# terminal 1 bili # terminal 2 curl -s http://localhost:8787/__bili/health
The README shows this answer, naming the upstream the proxy forwards to:
{"ok":true,"upstream":"https://api.anthropic.com"}Then you point Claude Code at the proxy and send a message. In this manual mode CONFIGURATION.md also asks you to set CLAUDE_CODE_AUTO_COMPACT_WINDOW to bili’s window for your model, so Claude Code’s own auto-compact does not fire first.
export ANTHROPIC_BASE_URL="http://localhost:8787/bili/https://api.anthropic.com" claude
As the conversation grows, the log at ~/.local/state/billion-context/bili.log shows a line for each round and a compress event, in the README’s format:
[acp-usage] round N input=X cached=Y (cache hit Z%)
If you are new. A model can only read so much at once, and a long coding session eventually passes that limit, after which the README says the session degrades or dies. Billion Context lets the model fold old parts into summaries and unfold them again. Start small. Try the launcher with the one agent you use daily, on a throwaway project.
For experts. With a native plugin or a launcher, the agent registers the tools and runs compress itself. On the plain URL route the proxy runs compress on its side. Session state is keyed on the conversation id the client gives, such as Claude Code’s x-claude-code-session-id header. A client that sends none gets prefix affinity, which reattaches a request only when its history matches a stored session byte for byte.
By default the model your agent already uses writes the summaries. An optional external summary chain in the config names up to 16 other models, each with its own key. It never falls back to the main model when a reference does not resolve.
That run sits in the repository’s benchmarks folder, which calls it an independent third-party evaluation of version 0.1.202 with DeepSeek V4.1 Flash as the base model. It names no evaluator and is published in the maker’s own repository, so read it as the maker’s claim. The same write-up reports 71.1 percent lower cost than full context for independent sessions, and a 1.48M-token test where full context failed on all 199 items. Its trade-off line says exact needle questions fall from 69.0 percent for full context to 27.0 percent.
The proxy sees every prompt and reply you route through it. It also changes itself over time.
This kit holds setup notes only. Mindket wrote them. The Billion Context proxy and its plugins install from ranxianglei's repository: https://github.com/ranxianglei/billion-context
These notes are not made or endorsed by ranxianglei. The LICENSE file and the package entry name ranxianglei as the author.
License: MIT plus one additional term. The LICENSE file opens with "Copyright (c) 2026 ranxianglei" and the MIT text, then adds an Additional Term headed "Attribution on Product Surfaces". Source: https://github.com/ranxianglei/billion-context/blob/master/LICENSE
GitHub does not match the file to a standard license because of that extra term. The npm package entry lists MIT (https://registry.npmjs.org/billion-context/latest). The README says "This project is MIT-licensed plus one additional term". In plain words, the term says:
As we read it, using the proxy with your own coding agent does not build a product for others, so the term matters to people who ship something on top of it. Mindket's listing is notes that link to the repository, and it ships none of the software. Read the LICENSE file before you build on it. These notes are not legal advice.
billion-context. It puts the bili command on your PATH, with bili-proxy as an alias.bili is a local proxy that sits between your coding agent and its model API. It adds four context tools (compress, decompress, search_context, acp_status) to the conversation and folds old messages into summaries.bili plugin install <client>)bili <client>)http://localhost:8787/bili/engines field lists >=20 (https://registry.npmjs.org/billion-context/latest).storage.sqliteAutoDownload turns that off. Source: https://github.com/ranxianglei/billion-context/blob/master/CONFIGURATION.mdnode:24-slim base and tells you not to switch the image to Node 20. See setup/docker.md.bili start or plain bili) owns 8787. A native hook or a launcher starts its own proxy in a separate zone that begins at 18787.Linux and macOS, with a user-level prefix (no sudo):
npm install -g billion-context --prefix=~/.local
Windows, and nvm or Homebrew Node, where the default prefix is already user-writable:
npm install -g billion-context
The README says that on Linux and macOS the bili command lands in ~/.local/bin, and that you add export PATH="$HOME/.local/bin:$PATH" to ~/.bashrc or ~/.zshrc when it is not on your PATH already.
The README names these places, all under your home folder. The root CA path comes from CONFIGURATION.md.
~/.config/billion-context/billion-context.json~/.local/share/billion-context/~/.local/state/billion-context/bili.log, which rotates at 10 MB~/.local/share/billion-context/ca/root-ca.pemWhat the root CA means for you: a client set to trust it lets the proxy decrypt that client's HTTPS traffic to your model host and read the prompts and replies. CONFIGURATION.md says the CA is made on your machine, is not a system-wide install, and is trusted only by the client you point at it. It also says only listed model hosts are decrypted, and all other HTTPS traffic is tunnelled through still encrypted. A root CA can sign certificates, so keep the ca folder as private as a password file. Deleting the CA files and restarting the proxy makes new ones. The Claude Code launcher uses the /bili/ URL route and needs no CA.
Session files hold the conversation. CONFIGURATION.md says they are plain JSON unless you set BILI_ENCRYPTION_KEY, that a SQLite index (index.db) is written beside them by default, and that cleaning up old ones is opt-in (BILI_SESSION_GC=1). The local web page at http://localhost:8787 and the /__bili/* JSON endpoints listen on loopback and have no login.
Besides your model traffic, the README and CONFIGURATION.md describe five things the proxy fetches or does on its own.
ACP_AUTO_UPDATE=0, or for one run with --no-auto-update.auto-update-policy.json from the repository. CONFIGURATION.md says "Zero telemetry: plain GET, no query parameters, no device id."billion-context-advisories. A matching advisory can force-install a named version even with auto-update off. Turn it off with BILI_ADVISORY_CHECK=0.The "zero telemetry" line in CONFIGURATION.md is about the policy-file request. The README, CLIENTS.md and CONFIGURATION.md, read on 2 November 2026, make no wider telemetry statement either way.
The Docker image has self-update off by default (ACP_AUTO_UPDATE=0).
bili update checks and installs a newer version, bypassing the throttle.bili plugin remove <client>. Config snapshots go to .bili-bak./bili/ prefix, and traffic goes direct again at once, per the README FAQ.bili sessions rm <id>. bili sessions ls lists them.README.md 8 KB setup/claude-code.md 3 KB setup/codex.md 2 KB setup/docker.md 2 KB setup/dsh.md 3 KB setup/gemini-family.md 2 KB setup/hermes.md 2 KB setup/kimi-code.md 1 KB setup/omp.md 1 KB setup/opencode.md 2 KB setup/other-launchers.md 3 KB setup/pi.md 2 KB setup/url-prefix.md 3 KB setup/windows.md 2 KB setup/zcode.md 2 KB
Updated by Mindket to the current version of this kit.
Listed GitHub projects in the same category that share the most topics with this one.
| Product | Stars | Activity | Language | License | Last change |
|---|---|---|---|---|---|
| Billion Context This page | 6,358 | Active | TypeScript | — | |
| ArchifyShares dsh-plugin | 94,756 | Active | JavaScript | Apache-2.0 | |
| RufloShares dsh-plugin | 81,187 | — | — | MIT | — |
Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.
well9472 · Kit
Makes illustrations from text prompts with a small 670M-parameter diffusion model, run through ComfyUI. Built as a low-budget research model for people who wan…
Waqf-AI · Kit
Reads handwritten Arabic text from images and returns it as text. A fine-tuned PaddleOCR-VL model for people digitizing Arabic handwriting.
Wan-AI · Kit
Makes video clips from a text prompt or an image plus text, at up to 720P and 24 frames per second, in the Diffusers format for a single consumer GPU.
Wan-AI · Kit
Generates cinematic video of a character driven by an audio track, and can also lip-sync existing video. For video creators, animators and researchers with a l…
Wan-AI · Kit
Animates a character or swaps one into a video by copying a performer's movement and expressions, as one model from the Wan2.2 video family. Use only faces and…
vllm-sr · Kit
Answers choice, yes-or-no, score, box and tracking questions about text, images or video in one call, with a probability for each answer. For people building r…