RepositoryPython
headroomlabs-ai

headroomlabs-ai/headroom

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

78.2kstars
6.1kforks
208issues
33views

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: compression

#1 Repository Của Tháng

1
TINIX TRENDING·Chủ đề: fastapi

#1 Repository Của Tháng

1
TINIX TRENDING·Chủ đề: context-window

#1 Repository Của Tháng

🗜️ Headroom: Lớp nén ngữ cảnh cho AI agents

Nén tool output, logs, RAG chunks, files và conversation history trước khi tới LLM — giảm 60-95% token, giữ nguyên đáp án.

Headroom là một công cụ nén ngữ cảnh chạy cục bộ (local-first), giúp các AI agents và LLM nhận được thông tin tương đương với ít token hơn. Dự án hỗ trợ nhiều dạng triển khai: dưới dạng thư viện (library), proxy trung gian, hoặc server MCP. Nó sử dụng sáu thuật toán nén khác nhau nhằm xử lý JSON, code (AST) và văn bản tự nhiên.

✨ Điểm nổi bật

  • Library: Hàm compress(messages) hỗ trợ Python và TypeScript, dùng trực tiếp trong ứng dụng.
  • Proxy: Chạy qua lệnh headroom proxy --port 8787, hỗ trợ bất kỳ ngôn ngữ nào mà không cần thay đổi code.
  • Agent wrap: Tích hợp nhanh với các agent như Claude, Codex, Cursor, Aider, Copilot, OpenCode bằng một lệnh.
  • MCP server: Cung cấp các công cụ như headroom_compress, headroom_retrieve, headroom_stats cho mọi client MCP.
  • Cross-agent memory: Lưu trữ trí nhớ chung giữa các agent (Claude, Codex, Gemini), tự động loại bỏ trùng lặp.
  • headroom learn: Phân tích session thất bại, ghi chú khắc phục vào CLAUDE.md hoặc AGENTS.md.
  • Output token reduction: Giảm token model trả về bằng cách loại bỏ nội dung không cần thiết như lặp lại code hay suy nghĩ sâu không cần thiết.
  • Reversible (CCR): Lưu trữ bản gốc cục bộ, hỗ trợ truy xuất khi cần.

💡 Vì sao đáng chú ý

Headroom không chỉ nén dữ liệu một cách ngẫu nhiên — nó dùng ContentRouter để phân biệt loại nội dung (JSON, code, văn bản) và áp dụng thuật toán nén phù hợp. Điều này giúp tiết kiệm tối đa token mà không mất thông tin quan trọng. Với công nghệ CacheAligner, Headroom còn tối ưu cả hiệu suất KV cache của nhà cung cấp LLM.

Nhờ thiết kế local-first, dữ liệu của người dùng luôn được kiểm soát, an toàn và tuân thủ quyền riêng tư. Đây là lựa chọn lý tưởng cho các nhóm phát triển muốn tối ưu chi phí và tốc độ khi làm việc với các mô hình lớn.


#AI #ContextCompression #LLM #MCP #OpenSource #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
langchain-ai/langchain

The agent engineering platform.

148.6k
Oct 28, 2026
RepositoryPython
langgenius/dify

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

159.9k
Oct 29, 2026
RepositoryJavaScript
affaan-m/ECC

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

292.5k
Oct 26, 2026
RepositoryPython
bytedance/deer-flow

An open-source long-horizon SuperAgent harness that researches, codes, and creates. With the help of sandboxes, memories, tools, skill, subagents and message gateway, it handles different levels of tasks that could take minutes to hours.

84.7k
Oct 29, 2026
RepositoryPython
NousResearch/hermes-agent

The agent that grows with you

258.4k
Oct 29, 2026
RepositoryJavaScript
Snailclimb/JavaGuide

Java 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发

159.3k
Oct 25, 2026
RepositoryPython
bojieli/ai-agent-book

《深入理解 AI Agent:设计原理与工程实践》(李博杰 著)开源主仓库:全书正文、编译版 PDF 与按章配套代码

56.5k
Oct 8, 2026
RepositoryPython
Significant-Gravitas/AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

187.8k
Oct 28, 2026
RepositoryGo
JuliusBrussee/caveman

🪨 why use many token when few token do trick. Viral skill + proxy for coding agents that cuts 65% of tokens by talking like a caveman.

116.0k
Oct 29, 2026