跳到正文
Skillpedia
提示词与 LLM84k · #1425

omni-compression

它能做什么

这项技能展示如何在提示词发给模型之前把它压缩,使用命令输出和文本压缩两种模式。适合想降低令牌用量并先测试效果的人。

适用场景

  • ✓当用户想减少发送给模型的令牌数量的时候。
  • ✓当用户想预览压缩会如何改变某个提示词的时候。
  • ✓当用户想添加语言包或自定义压缩规则的时候。

技能链接

https://github.com/cheaper-inference/OmniRoute/blob/release/v3.8.53/skills/omni-compression/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/cheaper-inference/OmniRoute/blob/release/v3.8.53/skills/omni-compression/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“开启之前,请先预览一下压缩能让这段提示词缩短多少。”

每周 5 个新技能,1 分钟读完。

工作原理

这项技能列出预览压缩、比较结果,以及列出语言包和压缩规则的调用。它涵盖用于命令输出的 RTK 模式、用于文本的 Caveman 模式,以及把两者组合起来的叠加模式。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

<!-- generated by src/lib/agentSkills/generator.ts; manual edits will be overwritten -->

Overview

Configure RTK (command output), Caveman (prose), and stacked compression modes. Manage language packs, custom rules, and test prompt compression reducing tokens by 60–90%.

Authentication

All requests require a valid Bearer token or session cookie. Obtain a token via POST /api/auth/login or configure REQUIRE_API_KEY=false for local development.

Endpoints

POST /api/compression/preview

Preview compression for a message payload

curl -X POST http://localhost:20128/api/compression/preview \
  -H "Authorization: Bearer $OMNIROUTE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/compression/language-packs

List Caveman compression language packs

curl http://localhost:20128/api/compression/language-packs \
  -H "Authorization: Bearer $OMNIROUTE_TOKEN"

GET /api/compression/rules

List Caveman compression rule metadata

curl http://localhost:20128/api/compression/rules \
  -H "Authorization: Bearer $OMNIROUTE_TOKEN"

POST /api/compression/compare

POST compression › compare

curl -X POST http://localhost:20128/api/compression/compare \
  -H "Authorization: Bearer $OMNIROUTE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

POST /api/compression/compare/verify

POST compression › compare › verify

curl -X POST http://localhost:20128/api/compression/compare/verify \
  -H "Authorization: Bearer $OMNIROUTE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

GET /api/compression/engines

GET compression › engines

curl http://localhost:20128/api/compression/engines \
  -H "Authorization: Bearer $OMNIROUTE_TOKEN"

POST /api/compression/retrieve

POST compression › retrieve

curl -X POST http://localhost:20128/api/compression/retrieve \
  -H "Authorization: Bearer $OMNIROUTE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Payloads

See the full OpenAPI specification at GET /api/openapi/spec or docs/openapi.yaml for detailed request/response schemas.

<!-- skill:custom-start --> <!-- Migrated from skills/omniroute-compression/SKILL.md (preserved curated content) -->

OmniRoute — Compression

Requires OMNIROUTE_URL and OMNIROUTE_KEY. See entry-point SKILL for setup.

Overview

OmniRoute compresses token payloads before forwarding to providers. No code changes required — set it once, it applies to all requests transparently.

Engine Best for Typical savings
RTK Terminal / build / test / git output 60–90%
Caveman Human prose, chat history 46% input
Stacked (rtk → caveman) Mixed coding sessions 78–95%
MCP accessibility filter Browser/accessibility tool results 60–80%

Get current settings

curl $OMNIROUTE_URL/api/settings/compression \
  -H "Authorization: Bearer $OMNIROUTE_KEY"

Enable RTK (best for coding agents)

curl -X PUT $OMNIROUTE_URL/api/settings/compression \
  -H "Authorization: Bearer $OMNIROUTE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "rtk", "enabled": true }'

Enable stacked mode (maximum savings)

curl -X PUT $OMNIROUTE_URL/api/settings/compression \
  -H "Authorization: Bearer $OMNIROUTE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "stacked",
    "enabled": true,
    "stackedPipeline": ["rtk", "caveman"]
  }'

Enable Caveman (prose / chat)

curl -X PUT $OMNIROUTE_URL/api/settings/compression \
  -H "Authorization: Bearer $OMNIROUTE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "mode": "standard", "enabled": true }'

Caveman intensities: lite (safe), standard (balanced), aggressive (long sessions), ultra (context recovery).

Preview compression before enabling

curl -X POST $OMNIROUTE_URL/api/compression/preview \
  -H "Authorization: Bearer $OMNIROUTE_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "rtk",
    "text": "$ npm test\n> jest\n\nPASS src/a.test.ts (2.1s)\nPASS src/b.test.ts (1.8s)\n..."
  }'

Response incl

常见问题

什么是 RTK 压缩?

这项技能把 RTK 描述为处理命令输出的模式,而 Caveman 负责处理文本。

它能减少多少令牌?

这项技能描述的减少幅度大约为 60% 到 90%。

我能比较压缩前后的结果吗?

可以。这项技能有一个比较调用,可以返回某段数据的压缩结果。

详情

作者的原始描述

Configure RTK (command output), Caveman (prose), and stacked compression modes. Manage language packs, custom rules, and test prompt compression reducing tokens by 60–90%.

repo: cheaper-inference/OmniRoute

热度

GitHub 星标
84k
排名
#1425
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能