Signal Garden

AI 工具AI TOOLS· CHAT-AGENT

leanctx

jia-gao/leanctx

一个直接替换 OpenAI 客户端的提示压缩库,不改代码就能省 40-60% token 费用。Drop-in prompt compression for production LLM apps that cuts token costs by 40–60% with no code changes.

根据公开文档整理,未运行实测;费用以项目官网为准。Based on public documentation, without runtime testing. Check the project site for pricing.

适用平台Platforms
claude-code
已识别的要求Documented requirements
API key · Local runtime
许可LICENSE
MIT

每周一 1 封:本周热度最高的 10 个 GitHub 新项目。免费,随时退订。One email each Monday: the 10 hottest new GitHub projects this week. Free, unsubscribe any time.

订阅即表示你同意我们按隐私政策发送每周一周刊。我们会记录这次订阅的来源页面和活动标签,这条记录不包含 IP 地址。Subscribing means you agree that we email the Monday weekly digest as described in the privacy policy. We record the referring page and campaign tag for the signup, and that record does not include an IP address. 隐私政策Privacy Policy

能力CAPABILITIES

它能帮你做成什么What it helps you do

  1. 01

    节省40-60%的token费用

  2. 02

    不修改代码直接替换OpenAI等客户端

  3. 03

    自动区分代码/散文选用不同压缩方式

  4. 04

    用本地模型或自选模型压缩长文本

  5. 05

    通过HTTP服务让非Python程序也能用

  1. 01

    Wrap OpenAI, Anthropic, or Gemini clients with one import change

  2. 02

    Route code and errors untouched, prose compressed automatically

  3. 03

    Run offline benchmarks to measure exact token savings

  4. 04

    Serve compression over HTTP for non-Python callers

  5. 05

    Track compression metrics with OpenTelemetry

上手GET STARTED

怎么装How to install

PIP · Python
pip install leanctx                              # core (passthrough only — useful for testing the wrapper)

选择与你的环境对应的方式。命令来自项目文档,未运行实测。Choose the option for your environment. Commands come from project documentation and have not been run-tested.

打开项目文档Open project documentation ↗

使用限制LIMITATIONS

限制与风险Limits and risk

以下要求与风险来自文档静态检查,未执行项目代码;扫描没有命中,不代表使用安全。Risk here is evidence, not an alarm. These findings come from static scanning of the docs; we never execute a project’s code.

限制LIMITS

未知Unknown

01需要 API KeyREQUIRES API KEY
是Yes
02需要本地环境NEEDS LOCAL RUNTIME
是Yes
03需要 DockerNEEDS DOCKER
未在文档中发现Not found in the docs
04难度DIFFICULTY
需要本地环境Needs a local runtime
05许可LICENSE
MITMIT
06阶段STAGE
持续活跃Active
创建于 18 APR 2026Created 18 APR 2026

静态扫描STATIC SCAN

在 README、SKILL.md 和依赖清单中没有匹配到已知风险模式。No known risk patterns matched in the README, SKILL.md or dependency list.

静态扫描未发现明显风险,但不代表安全The static scan found no known risky patterns in the documentation, but that does not guarantee the code is safe — review the source before using in sensitive environments.

项目动态PROJECT ACTIVITY

它现在处在什么位置Where it stands right now

首次发现FIRST SEEN

03 OCT 202603 OCT 2026

增长GROWTH

-0.6%-0.6%

326 → 324 stars · 58 个快照326 → 324 stars · 58 snapshots

状态STATUS

持续活跃Active

可减少 40-60% 的 token 成本,且无需修改代码,直接替换包名即可LLMLingua-2 local compression loads ~1.2 GB of model weights once, then runs free per call

每周一周刊Monday weekly digest

每周一 1 封:本周热度最高的 10 个 GitHub 新项目。免费,随时退订。One email each Monday: the 10 hottest new GitHub projects this week. Free, unsubscribe any time.

看第 1 期Read issue 1

订阅即表示你同意我们按隐私政策发送每周一周刊。我们会记录这次订阅的来源页面和活动标签,这条记录不包含 IP 地址。Subscribing means you agree that we email the Monday weekly digest as described in the privacy policy. We record the referring page and campaign tag for the signup, and that record does not include an IP address. 隐私政策Privacy Policy

订阅每周一周刊Subscribe to the Monday weekly digest
PROVENANCE · 这些结论的依据是什么Where these conclusions come from
来源 URLSource URL
https://github.com/jia-gao/leanctx
原始数据哈希Raw data hash
e681483333f8d56c5a3646d797dee9e6
解析时间Parsed at
2026-10-16T23:37:36.276Z
最后一次验证Last verified
2026-11-29T22:14:01.901Z
增长测量时间Growth measured
2026-11-30T00:11:32.205Z
发现查询Discovery queries
focus:token:repo:prompt-compression
分类来源Category source
rules
焦点Focus
token (15)
完整解析证据 JSONFull parse evidence JSON
{
  "agents": [
    {
      "agent": "claude-code",
      "evidence": "readme: …Coding agents — Cursor-like / Claude-Code-like, with growing tool-call…"
    }
  ],
  "apiKey": "workload rag # live API, set ANTHROPIC_API_KEY leanctx bench run longbench-v2 --worklo",
  "docker": null,
  "taxonomy": {
    "scores": {
      "design": 0,
      "ai-tools": 10,
      "dev-tools": 0,
      "indie-web": 0,
      "skill-agent": 0,
      "productivity": 0
    },
    "primary": "ai-tools",
    "secondary": "chat-agent"
  },
  "localRuntime": "ed-data). Open-source models, runs locally, MIT-licensed. Your prompts and user da",
  "skillMdTotal": 0,
  "skillMdErrors": [],
  "treeTruncated": false,
  "categoryScores": {
    "data": 1,
    "agent": 0,
    "media": 0,
    "design": 0,
    "browser": 0,
    "devtool": 0,
    "security": 0,
    "marketing": 0,
    "productivity": 0
  },
  "classification": [
    {
      "signal": "description mentions AI",
      "weight": 0.2
    }
  ],
  "scannedSources": [
    "readme"
  ],
  "skillMdFetched": 0
}