← Back to Skills Marketplace
435
Downloads
0
Stars
3
Active Installs
2
Versions
Install in OpenClaw
/install token-estimator
Description
预估本次请求的 Token 消耗量,支持多模型精确计算
Usage Guidance
What to consider before installing:
- Functionality: The core estimator code is present and appears benign: it uses tiktoken/transformers when available and falls back to a simple character-based estimator. It does not read secrets or exfiltrate data.
- Network and disk: transformers.AutoTokenizer.from_pretrained('Qwen/Qwen-7B') will likely attempt to download tokenizer/model files at runtime if not already cached; expect network access and potentially large downloads. If you need to avoid network calls, preinstall and cache required tokenizers or run in an isolated environment.
- 'Usage meter' mismatch: The SKILL.md promises a usage/dashboard feature, but the current code has no implemented mechanism to fetch or store usage data. Don't assume the meter will work until the skill is updated or integrates with an API and you provide credentials.
- Compression claims: The '4D 压缩' savings are implemented as a fixed 70% heuristic in code — this is a convenience estimate, not measured on your data. Treat cost-savings numbers as optimistic estimates.
- Dependencies: Installing the declared Python packages is required for best accuracy; if transformers or tiktoken are absent, the estimator falls back to a less accurate method.
- Recommendations: Inspect the transformers/dashscope packages you install (especially dashscope, which may be a third-party package). Run the skill in a sandbox or VM first to observe any network/download behavior. If you rely on offline or audited environments, pre-download and pin tokenizer artifacts and/or remove the AutoTokenizer.from_pretrained calls.
If you want, I can (1) point out exactly where to change the code to avoid runtime downloads, (2) show a short checklist to safely run this in a sandbox, or (3) produce a minimal wrapper that uses only tiktoken (no transformers) for safer/easier deployment.
Capability Analysis
Type: OpenClaw Skill
Name: token-estimator
Version: 1.0.1
The OpenClaw skill 'token-estimator' is classified as benign. The `SKILL.md` provides clear, descriptive instructions without any evidence of prompt injection attempts against the AI agent. The core script `scripts/token-estimator.py` uses standard libraries (`tiktoken`, `transformers`, `dashscope`) for its stated purpose of estimating token consumption. While `transformers.AutoTokenizer.from_pretrained` involves downloading model data from external sources, this is a standard and expected behavior for the library and is not indicative of malicious intent from the skill itself. The code explicitly avoids file system manipulation, environment variable access, shell execution, and data exfiltration, aligning with the '安全机制' (security mechanism) claims in the documentation.
Capability Assessment
Purpose & Capability
Name/description align with the code: a token estimator for multiple models. Declared runtime dependency on python3 and python packages (tiktoken, transformers, dashscope) is consistent with the implementation. Nothing in required binaries/env vars is unexpected or disproportionate.
Instruction Scope
SKILL.md promises a 'Token 水表' (usage meter) and real-time usage display, but the shipped code has no implementation that fetches or aggregates usage from any external API or local store (the --usage flag is defined but not handled). SKILL.md and tests claim integration/accuracy and dashboard features that are not actually implemented, granting the skill more implied capabilities than present. Also the README instructs pip install which will cause the runtime to attempt remote downloads at usage time (see install_mechanism).
Install Mechanism
There is no explicit install spec (instruction-only), but the metadata and SKILL.md instruct users to pip install tiktoken/transformers/dashscope. The code calls AutoTokenizer.from_pretrained('Qwen/Qwen-7B'), which will attempt to download tokenizer/model artifacts from remote hosting (e.g., Hugging Face) if not cached — this can incur large downloads and network access at runtime. No downloads or obscure URLs are embedded in code, but implicit network activity is likely.
Credentials
The skill requests no environment variables or credentials and does not access system config paths. The lack of requested secrets is proportionate to the stated purpose. Note: future SKILL.md items mention integrating '百炼 API usage 字段' (dashscope usage API) but that is not implemented in this release.
Persistence & Privilege
The skill does not request persistent/always-on privileges; flags show always:false and normal autonomous invocation. The skill does not modify other skill configs or claim system-wide changes.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install token-estimator - After installation, invoke the skill by name or use
/token-estimator - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
精简产品文化声明,明确误差说明
v1.0.0
初始版本发布 - 多模型 Token 预估,精度±3.5%,支持 Qwen/OpenAI/Gemini
Metadata
Frequently Asked Questions
What is Token Estimator?
预估本次请求的 Token 消耗量,支持多模型精确计算. It is an AI Agent Skill for Claude Code / OpenClaw, with 435 downloads so far.
How do I install Token Estimator?
Run "/install token-estimator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Token Estimator free?
Yes, Token Estimator is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Token Estimator support?
Token Estimator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Token Estimator?
It is built and maintained by largetool (@largetool); the current version is v1.0.1.
More Skills