fkiene

llmtrim

fkiene

Local proxy that compresses your LLM API requests so you pay less, with no change to the answers. Trims wasted tokens from prompts, history, tool output, and code before they're sent: -31% input / -74% output, measured live. Any provider, no extra model calls. Also an MCP server and embeddable library (Rust, Python, Ruby, Kotlin, Swift, JS/TS).

AI 简介

llmtrim 是一个本地代理工具,用于无损压缩大语言模型(LLM)API 请求中的冗余文本,显著降低 token 消耗与调用成本。它通过智能裁剪提示词、对话历史、工具输出和代码块中的非必要内容,在不改变模型响应质量的前提下,实测减少31%输入与74%输出 token。支持 OpenAI、Anthropic 等主流厂商,无需额外模型调用;提供代理模式、CLI、MCP 服务器及多语言嵌入式库(Rust/Python/Ruby/Swift/Kotlin/JS)。适用于高频调用 LLM 的开发场景,如智能编程助手、Agentic 应用和 LLMOps 流水线中的成本优化环节。

Rust
GNU Affero General Public License v3.0
150
Stars
7
Forks
2
Watchers
1
Issues

Star 增长

今日0
近 7 天0
近 30 天+13
综合评分44.01
默认分支main