{"_id":"@ben_labs/semanticzip","name":"@ben_labs/semanticzip","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ben_labs/semanticzip","version":"1.0.0","description":"Compress prompts with semantic token compression (SemanticZip) before sending to the LLM — save tokens and reduce cost.","type":"module","main":"index.ts","license":"MIT","keywords":["openclaw","openclaw-plugin","token-compression","semanticzip","prompt-compression","llm","cost-reduction"],"openclaw":{"extensions":["./index.ts"]},"publishConfig":{"access":"public"},"devDependencies":{"openclaw":"*"},"_id":"@ben_labs/semanticzip@1.0.0","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-H5/xeKDhnZ5NVN+iUTGQPLZvO+7kIP0LeY1YGxoAonFAtvYQa/BFOjTaG0uBitd+qe702iQqza/J0aNKpcLAWQ==","shasum":"171a87d96c09984b6742d0d2d886d76a0eecf921","tarball":"https://registry.npmjs.org/@ben_labs/semanticzip/-/semanticzip-1.0.0.tgz","fileCount":5,"unpackedSize":17166,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCr2c9od7OZNducmbttjUNeCzB4F8ywonHTBc2/IOp38AIgX0zI23sa0Nh9dslBIYsVw8lCVvSwtXArfqyiTKR8UMc="}]},"_npmUser":{"name":"ben_labs","email":"benthinker82@gmail.com"},"directories":{},"maintainers":[{"name":"ben_labs","email":"benthinker82@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/semanticzip_1.0.0_1773073865071_0.3373884772950926"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-09T16:31:04.979Z","1.0.0":"2026-03-09T16:31:05.226Z","modified":"2026-03-09T16:31:05.825Z"},"maintainers":[{"name":"ben_labs","email":"benthinker82@gmail.com"}],"description":"Compress prompts with semantic token compression (SemanticZip) before sending to the LLM — save tokens and reduce cost.","keywords":["openclaw","openclaw-plugin","token-compression","semanticzip","prompt-compression","llm","cost-reduction"],"license":"MIT","readme":"# SemanticZip Token Compression — OpenClaw Plugin\n\nAutomatically compress prompts before they reach the LLM using **SemanticZip** (Semantic Token Compression). Save tokens, reduce costs, and speed up responses — with zero changes to your workflow.\n\n## What it does\n\n- Intercepts prompts via the `before_agent_start` hook\n- Sends system prompts and user messages to the SemanticZip compression API\n- Removes low-entropy tokens that don't contribute to meaning\n- The LLM receives a shorter prompt and responds normally\n- Typical savings: **30–70%** of input tokens\n\n## Install\n\n```bash\nopenclaw plugins install @semanticzip/semanticzip\n```\n\nOr install from a local directory:\n\n```bash\nopenclaw plugins install ./path/to/semanticzip\n```\n\n## Configuration\n\nAdd to `~/.openclaw/openclaw.json`:\n\n```json\n{\n  \"plugins\": {\n    \"entries\": {\n      \"semanticzip\": {\n        \"enabled\": true,\n        \"config\": {\n          \"apiKey\": \"YOUR_API_KEY_HERE\",\n          \"threshold\": -2.0\n        }\n      }\n    }\n  }\n}\n```\n\nOr set the `SEMANTICZIP_API_KEY` environment variable.\n\n### Config options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `apiUrl` | string | `https://api.semanticzip.com` | SemanticZip API base URL |\n| `apiKey` | string | — | Your SemanticZip API key |\n| `threshold` | number | `-2.0` | Compression aggressiveness: `-0.5` light, `-1.0` moderate, `-2.0` aggressive, `-3.0` maximum |\n| `enabled` | boolean | `true` | Enable/disable compression |\n| `compressSystemPrompt` | boolean | `true` | Compress the system prompt |\n| `compressUserMessages` | boolean | `true` | Compress user messages |\n| `minTokensToCompress` | number | `50` | Skip messages shorter than this |\n\n## Get an API key\n\nSign up at [semanticzip.com](https://semanticzip.com) to get your API key.\n\n## How SemanticZip works\n\nSemanticZip uses a small language model to score every token by its information content (entropy). Tokens that are predictable from context — articles, filler words, redundant punctuation — are removed. The result reads like shorthand but retains full meaning for the LLM.\n\nExample:\n- **Before**: `The quick brown fox jumps over the lazy dog in the park`\n- **After**: `quick brown fox jumps over lazy dog park`\n- **Savings**: ~40%\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-53bc3a6808f9dedc754f0a941ec62d42"}