3-Layer Token Compressor — Cut AI API Costs 40-60%
v1.1.0Pre-process prompts through 3 compression layers before sending to paid APIs. Uses a local Ollama model to intelligently compress messages and summarize hist...
⭐ 0· 409·2 current·2 all-time
byShadow Rose@theshadowrose
MIT-0
Download zip
LicenseMIT-0 · Free to use, modify, and redistribute. No attribution required.
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description (3-layer compression using a local Ollama model) align with the provided code and README. The library only implements message compression, history summarization, and an in-memory cache — all coherent with the stated purpose.
Instruction Scope
SKILL.md and src/token-compressor.js consistently describe POSTing compression prompts to a local Ollama instance (localhost:11434). The instructions do not read unrelated files, do not request unrelated environment variables, and do not transmit data to external endpoints. The system prompts sent to the model are explicit and limited to compression/summarization instructions.
Install Mechanism
No install spec or external downloads are present; this is an instruction-only skill with an included JS source file. No archives or third-party packages are pulled by the skill itself.
Credentials
The skill requires no credentials, config paths, or environment variables. All runtime configuration is passed via the constructor; network I/O is targeted at a local host and nothing else.
Persistence & Privilege
Skill does not request permanent presence, does not modify other skills or system configs, and uses only an in-memory cache (no disk persistence). 'always' is false and autonomous invocation is the platform default (no additional privilege requested).
Scan Findings in Context
[system-prompt-override] expected: The SKILL.md and code explicitly set a system prompt for the compression model (e.g., 'You are a text compression tool...'). The scanner flagged this pattern, but it's expected — the skill must send a system prompt to the local model to enforce concise output.
[127\.0\.0\.1] expected: OPSEC report found a literal localhost/IP reference. This is expected and appropriate because the skill is designed to contact a local Ollama instance at localhost:11434 only.
Assessment
This skill appears coherent and limited to local compression via an Ollama instance. Before installing, ensure you actually run Ollama locally (localhost:11434) and the host/port are not pointed to a remote service. Review and confirm the included src/token-compressor.js matches the shipped copy and that no modifications add external network calls or credential usage. Because compression alters message content, test the tool on non-sensitive data first to verify it preserves the details you need. Finally, if you require strong guarantees that data never leaves the machine, enforce network egress rules (firewall) so the process cannot reach external hosts even if misconfigured.Like a lobster shell, security has layers — review code before you run it.
api-costsvk9752wyys27f16svt0r1ssrh6h82rtpvbudgetvk97efatekyf16hw7ec1mgzj5v582sf6acompressionvk9752wyys27f16svt0r1ssrh6h82rtpvcost-reductionvk9752wyys27f16svt0r1ssrh6h82rtpvlatestvk9752wyys27f16svt0r1ssrh6h82rtpvollamavk9752wyys27f16svt0r1ssrh6h82rtpvprompt-optimizationvk97efatekyf16hw7ec1mgzj5v582sf6atoken-optimizationvk9752wyys27f16svt0r1ssrh6h82rtpv
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
