光轨资源网 / 开源项目

ranxianglei/billion-context

开源项目 · — · 下载 0 次 · 更新于 2026/11/8

ranxianglei/billion-context 介绍图

一个上下文压缩插件,用于长达一个月的单个会话(数十亿令牌) ,小上下文窗口( 100K上下文就足够了)和令牌节省(令牌减少5倍)。上下文压缩插件月级长会话会话, , 兼顾小窗口( 100K上下文足矣 )省令牌(省 5个倍令牌)。十亿上下文是您所需要的全部

可以做什么

一项生产规模的纵向研究: 4.5个月,三台主机, 174,327个模型调用, 18.76亿个累计输入令牌(所有主机约24.7B ) , 204,800个令牌模型的零窗口违规, 8,584-12,049个调用的马拉松会话。

怎么部署

Install

Linux / macOS — install with a user-level prefix (no sudo, no npm config

changes, and bili's self-update never hits permission errors):

npm install -g billion-context --prefix=~/.local

The bili command lands in ~/.local/bin — already on PATH in most distros;

if not, add export PATH="$HOME/.local/bin:$PATH" to ~/.bashrc or

~/.zshrc. On nvm or Homebrew Node the default prefix is already user-owned —

a plain npm install -g billion-context works as-is. On Windows the default

prefix (%APPDATA%\npm) is also user-writable — plain npm install -g billion-context.

This installs the bili command (bili-proxy is kept as an alias). Hitting

EACCES with an old root-owned prefix? Reinstall with --prefix=~/.local

(pass the flag again on any future npm reinstall of bili) — that is the

permanent fix; avoid sudo.

Prefer containers? A Dockerfile ships at the repository root — see

[Running in Docker](#running-in-docker) below.

项目信息

项目地址:https://github.com/ranxianglei/billion-context

语言:TypeScript

Star 数:4540(2026-11-07 采集)

原文简介(English)

A context-compression plugin for month-long single sessions (billions of tokens) ,small context windows (a 100K context is enough) and token savings (5x fewer tokens) .上下文压缩插件,月级长会话会话, 兼顾小窗口(100k上下文足矣)省token(省5倍token) . billion-context is all you need

前往站点查看详情并下载 →

本站资源用于学习与开发参考,请遵守对应授权协议。