🎁 Get the FREE AI Skills Starter GuideSubscribe →
BytesAgainBytesAgain
🦀 ClawHub

3-Layer Token Compressor — Cut AI API Costs 40-60%

by @theshadowrose

Pre-process prompts through 3 compression layers before sending to paid APIs. Uses a local Ollama model to intelligently compress messages and summarize hist...

Versionv1.1.0
Installs3
⚙️ Configuration

const TokenCompressor = require('./src/token-compressor');

const compressor = new TokenCompressor({ ollamaHost: 'localhost', // default ollamaPort: 11434, // default compressionModel: 'llama3.1:8b', // default — any Ollama model works maxUncompressedTurns: 10, // keep last N turns verbatim cacheMaxSize: 100, cacheTTL: 3600000 // 1 hour });

See README.md for full API documentation and usage examples.

View on ClawHub
TERMINAL
clawhub install token-compressor

🧪 Use this skill with your agent

Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

🔍 Can't find the right skill?

Search 60,000+ AI agent skills — free, no login needed.

Search Skills →