← 返回 Skills 市场
nelmaz

Inception Token Optimizer

作者 nelmaz · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
147
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install inception-token-optimizer
功能描述
Optimize Inception Labs token usage to minimize costs. Use when choosing Inception models (Mercury, etc.), crafting prompts for Inception, analyzing token co...
使用说明 (SKILL.md)

Inception Token Optimizer

Reduce Inception API token consumption through prompt engineering, context management, and budget enforcement.

Free-Tier Limits (Inception Labs)

Metric Cap
Requests/min 100
Input tokens/min 100,000
Output tokens/min 10,000

Core Strategies

1. Prompt Compression

  • Remove redundant instructions, filler words, and repeated context.
  • Use short system prompts: "Concise answers. French." beats a 200-word persona block.
  • Avoid re-sending unchanged context — only send deltas.
  • Ask for short replies: "Réponds en \x3C 100 mots."

2. Context Pruning

  • Before sending, estimate tokens: len(text) // 4 (rough heuristic).
  • If total context > target budget, drop oldest messages and replace with a 1-2 sentence summary.
  • Use references/pruning-strategies.md for detailed patterns.

3. Caching

  • Identical prompts → reuse previous response. Do not re-call.
  • Hash the prompt; if seen recently (within session), return cached reply.
  • scripts/lru_cache.py provides a drop-in LRU cache (256 items default).

4. Model Selection

  • Use cheaper/faster models for simple tasks (summarisation, classification).
  • Reserve Mercury (or flagship) for complex reasoning only.
  • Batch trivial queries into a single prompt instead of multiple calls.

5. Output Budgeting

  • Set max_tokens explicitly — never leave it open-ended.
  • Target 150-200 output tokens for conversational replies.
  • Use temperature=0.7 to reduce verbose wandering.

Token Budget Guard

scripts/token_bucket.py enforces per-minute caps using a sliding window:

from scripts.token_bucket import TokenBucket

bucket = TokenBucket(req_per_min=100, in_tok_per_min=100_000, out_tok_per_min=10_000)
bucket.wait_for_slot(in_tokens=500, out_tokens=200)
# proceed with API call

Blocks until a slot is available. Use before every Inception API call.

When to Use This Skill

  • Before sending a prompt to Inception → compress & prune first.
  • When monitoring costs → check token estimates.
  • When near free-tier limits → activate budget guard.
  • When building automation → integrate caching + bucket guard.
安全使用建议
This skill appears coherent and safe for its stated goal. Before installing: (1) be aware the token-bucket implementation counts tokens by storing timestamps (large token counts could use significant memory), and the LRU cache is in-memory only (no durable storage or encryption for cached prompts/responses); (2) you will still need your Inception API credentials elsewhere to actually call the API — this skill intentionally does not request them; (3) review and tune parameters (cache size, token estimation heuristic, max_tokens) for your workload. If you plan to use it in a multi-tenant or high-throughput environment, test for memory/latency impact and consider a persistent or centralized cache/rate-limiter implementation.
功能分析
Type: OpenClaw Skill Name: inception-token-optimizer Version: 1.0.0 The bundle provides legitimate utilities and instructions for optimizing API token usage for Inception Labs models. It includes a standard LRU cache implementation (scripts/lru_cache.py) and a sliding-window rate limiter (scripts/token_bucket.py) to manage request and token caps. The documentation in SKILL.md and references/pruning-strategies.md focuses entirely on cost-reduction techniques like prompt compression and context pruning, with no evidence of malicious intent, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
The name/description (token optimization for Inception models) matches the provided instructions and the included helper scripts (LRU cache and token-bucket rate limiter). No unrelated binaries, credentials, or config paths are requested.
Instruction Scope
SKILL.md stays focused on prompt compression, context pruning, caching, model selection, and budget guarding. It instructs the agent to estimate tokens, prune context, use an in-memory LRU cache, and call the TokenBucket before API calls. There are no directions to read system files, retrieve unrelated credentials, or transmit data to unexpected endpoints.
Install Mechanism
This is an instruction-only skill with small, included Python helper scripts and no install spec or remote downloads. No high-risk install behavior is present.
Credentials
The skill declares no required environment variables, credentials, or config paths. That aligns with its stated function; it does not ask for unrelated secrets.
Persistence & Privilege
The skill does not request persistent or elevated platform privileges (always is false). The included code uses only in-memory data structures and does not modify other skills or system-wide configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install inception-token-optimizer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /inception-token-optimizer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: token bucket rate limiter, LRU cache, prompt compression guide, context pruning strategies
元数据
Slug inception-token-optimizer
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Inception Token Optimizer 是什么?

Optimize Inception Labs token usage to minimize costs. Use when choosing Inception models (Mercury, etc.), crafting prompts for Inception, analyzing token co... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 147 次。

如何安装 Inception Token Optimizer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install inception-token-optimizer」即可一键安装,无需额外配置。

Inception Token Optimizer 是免费的吗?

是的,Inception Token Optimizer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Inception Token Optimizer 支持哪些平台?

Inception Token Optimizer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Inception Token Optimizer?

由 nelmaz(@nelmaz)开发并维护,当前版本 v1.0.0。

💬 留言讨论