Daily Tech Briefing
AI 科技速览
每天 5 分钟内学习 AI。获取最新的人工智能新闻,理解其重要性,并学习如何将其应用于您的工作。
MarkTechPost · 2026/7/30 07:43:29
Meet Token Saver: An Open-Source MCP Extension Using Local Hybrid RAG to Cut Claude PDF Token Costs 90-99%
AI 中文解读
好消息!开源工具Token Saver问世,能让Claude处理超大PDF时节省92%到99%的代币费用,而且文件全程不上传云端,隐私拉满。
为什么读PDF这么贵?原来Claude处理一份200页文档,每次提问都要把整份文件重发一遍,光文本每页就要1500到3000个代币,图表还得按图片算。Token Saver的解决办法很巧妙:它在你的电脑上跑一个本地混合检索系统,你提问时,工具先用关键词匹配(BM25)加上语义搜索(余弦相似度),只找出最相关的几段内容交给Claude作答。整个过程文件不会离开硬盘,Claude看到的只是精华片段,而不是整本书。
这个功能对科研人员、法律从业者、学生等经常要分析长文档的人特别实用——不仅省下大笔API费用,还不用担心敏感资料外泄。更重要的是,它无需配置Python环境,下载就能用,普通用户也能轻松上手。对AI重度使用者来说,这可能是今年最贴心的开源工具之一。
AI developers, researchers, and professionals frequently hit a frustrating wall when analyzing large documents with LLMs: the hidden, compounding cost of context windows. Pasting a 200-page PDF into a chat isn’t a one-time charge. Because the conversation history is re-sent to the model on every single turn, that massive document is paid for again with every follow-up question.
Marktechpost AI team just released Token Saver, an open-source Model Context Protocol (MCP) extension for Claude Desktop (MIT licensed, currently at v1.0). It was developed at Marktechpost AI Media Inc by Arnav Rai (CS student at Rochester Institute of Technology) during his internship at Marktechpost, supervised by Jean-marc Mommessin and Asif Razzaq. Token Saver fundamentally changes how Claude interacts with local documents. By implementing a Local Hybrid RAG (system directly on your machine, it allows you to ask questions about massive PDFs without ever uploading the actual file to the model.
Token consumption is slashed by 92% to 99%, privacy is guaranteed, and setup requires exactly zero Python environments or terminal configurations.
How it looks!
The Hidden Token Drain of Large PDFs
Most users assume that when they drop a PDF into Claude, it simply extracts the text. In reality, Claude’s default behavior converts each page into an image to preserve charts and layouts, while separately extracting text. Before a single image token is even counted, the text alone can run 1,500 to 3,000 tokens per page.
While Prompt Caching and Claude Projects help soften this blow, they don’t solve the core issue: the entire document still crosses the boundary to the provider’s servers. Furthermore, if you only need two relevant paragraphs from a 1,000-page textbook, forcing the LLM to search the entire 1,000 pages itself is both inefficient and prone to hallucination.
How Local Hybrid RAG Solves the Problem
Marktechpost’s Token Saver acts as a local MCP server : a lightweight background program on your machine that Claude can call as a tool. The PDF never leaves your hard drive.
When you ask a question, Token Saver utilizes Local Hybrid RAG to find the answer. Hybrid RAG is the gold standard for document retrieval because it combines two powerful search methods:
Keyword Matching (BM25): Runs over SQLite’s built-in FTS5 search (weighted at 0.4) to find exact terminology.
Semantic Search (Cosine Similarity): Uses a local all-MiniLM-L6-v2 embedding model (weighted at 0.6) to understand the meaning of your question, rather than just matching exact words.
By blending these two approaches locally, the server searches the file and hands Claude only the highly relevant passages. Claude then synthesizes the answer, citing the exact page numbers and providing a running tally of the tokens you just saved.
The 8-Stage Processing Pipeline
Token Saver runs entirely inside a single, long-running local process. Before any text reaches Claude, the local Hybrid RAG pipeline executes eight rapid steps:
Extract: Uses pypdfium2 (with pypdf as a fallback) to pull text.
Chunk: Splits text into 180-word passages, overlapping by 40 words so context is never blindly cut.
Score (Hybrid RAG): Evaluates chunks using the blended BM25 and local embedding model.
Gate: Enforces a quality threshold. Passages sharing no exact keywords must pass a semantic similarity floor of 0.25 to qualify.
Deduplicate: Drops near-identical passages.
Trim: Narrows the passage down strictly to the sentences that answer the user’s prompt.
Budget: Caps the total payload sent to Claude at 8,000 characters.
Envelope: Wraps the retrieved text in a document-chunk element containing the source file and precise page number.
(Note: The embedding model is optional but recommended. If it fails to load, the system gracefully falls back to keyword-only matching).
The Numbers: 99% Savings at Scale
Bec
分享
阅读原文 ↗