← 返回
未分类 中文

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...
优化 Inception Labs token 使用以降低成本。选择 Inception 模型(如 Mercury 等)及制作提示词时使用,并分析 token 消耗。
nelmaz nelmaz 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 396
下载
💾 0
安装
1
版本
#latest

概述

Inception Token Optimizer

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

Free-Tier Limits (Inception Labs)

MetricCap
------
Requests/min100
Input tokens/min100,000
Output tokens/min10,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 < 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.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 03:43 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Z.AI Coding Plan Setup

nelmaz
配置 OpenClaw 使用 Z.AI GLM 编程方案模型,包括最优设置、区域选择、API 密钥配置、模型选择以及 MCP 工具,以提升编码效率。
★ 0 📥 468
ai-agent

Find Skills

root
帮助用户发现和安装智能体技能,当用户询问如「如何做X」、「找X的技能」、「有能做...的吗」等问题时
★ 1,546 📥 593,630
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 883 📥 358,310