Tủ GitHub repo xịn
Avatar headroomlabs-ai

GitHub repo xịn · Vui Coding chọn

headroomlabs-ai/headroom

Headroom là công cụ nén dữ liệu đầu ra, nhật ký, đoạn dữ liệu RAG và tập tin trước khi gửi tới mô hình LLM, giúp giảm lượng tokens tiêu thụ. Phù hợp để tối ưu phí và tăng hiệu suất cho các tác vụ AI agents.

76,3 NGitHub stars
5,9 NForks
486Open issues
0Lượt nhấp GitHub
PythonNgôn ngữ chính

Tóm tắt nhanh

Repo này làm được gì?

Headroom là công cụ nén dữ liệu đầu ra, nhật ký, đoạn dữ liệu RAG và tập tin trước khi gửi tới mô hình LLM, giúp giảm lượng tokens tiêu thụ. Phù hợp để tối ưu phí và tăng hiệu suất cho các tác vụ AI agents.

Mô tả từ GitHub

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.

Bắt đầu với repo

Cài đặt và sử dụng

Hướng dẫn cài đặt

Bước 1 — Cài đặt với lệnh: - pip install "headroom-ai[all]" - npm install headroom-ai Bước 2 — Chọn chế độ: - headroom deploy - headroom wrap claude - headroom proxy --port 8787 Bước 3 — Kiểm tra và theo dõi: - headroom doctor - headroom perf - headroom dashboard

Hướng dẫn sử dụng

Sử dụng thư viện Python: - from headroom import compress - messages = [{"role": "user", "content": "Phân tích kết quả này"}] - result = compress(messages, model="gpt-4o") - response = client.chat.completions.create(model="gpt-4o", messages=result.messages) - print(f"Tiết kiệm {result.tokens_saved} tokens ({result.compression_ratio:.0%})")

Đối chiếu README gốc

Chủ đề liên quan

#agent#ai#anthropic#claude-code#compression#context-engineering#context-window#cursor#fastapi#langchain#llm#mcp
Mở trên GitHub

Cùng hệ sinh thái

Repo liên quan