Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

token-optimizer-qsmtco

bởi qsmtco

Coding Agents & IDEs
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

Reduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking.

Mô tả

Kỹ năng này làm gì

A toolkit for reducing token usage and API costs in OpenClaw deployments. Provides scripts for context lazy-loading, task-based model routing, heartbeat interval management, and daily budget tracking. All analysis runs locally with no network requests unless live pricing is explicitly requested.

Bundles context lazy-loading, model routing, heartbeat throttling, and budget tracking in one local toolkit, so cost reductions apply automatically without manually selecting a model for each request.

Khi nào nên dùng

  • Automatically routing casual chat messages to cheaper model tiers
  • Reducing context token load by 80% for simple or repetitive prompts
  • Enforcing cheap models for all scheduled cronjobs and heartbeat checks
  • Monitoring daily API spend and switching models when a budget limit is hit
  • Spacing out periodic background checks to reduce unnecessary API calls

Quy trình ví dụ

ĐẦU VÀO

User asks: debug this error in the logs

AGENT
  1. 1

    Runs model_router.py with the user prompt to classify task complexity

  2. 2

    Receives Standard tier recommendation based on the debug task pattern

  3. 3

    Runs token_tracker.py to check if daily budget is within limits

  4. 4

    Falls back to Haiku model if budget status is 'exceeded'

  5. 5

    Proceeds with the selected model for the session

ĐẦU RA

Request processed with the appropriate model tier and budget constraint enforced

Yêu cầu

  • OPENROUTER_API_KEY environment variable (only needed to refresh live model pricing data)

Cài đặt

clawhub install qsmtco/token-optimizer-qsmtco

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết