tokenfold
View on GitHubPrivate, provider-neutral context compression for LLMs. Reversibly compress schemas and logs inside your perimeter with zero third-party calls.
Tokenfold compresses structured JSON, tool schemas, and logs before they reach an LLM. Its Rust core performs deterministic, reversible folding; optional recoverable pruning and a local proxy, CLI, Python, TypeScript, and MCP interfaces support integration.
Use Cases
Reduce token usage for structured JSON sent to LLMsCompress tool schemas in agent workflowsOptimize structured RAG feedsRoute OpenAI-compatible requests through a local compression proxy
Built With
- Language
- Rust
- Frameworks
- LangChain · LlamaIndex · LiteLLM · Instructor
Tags
LLM · context compression · token optimization · lossless compression · JSON · MCP · CLI · proxy · RAG