← 返回 Skills 市场
435
总下载
0
收藏
3
当前安装
2
版本数
在 OpenClaw 中安装
/install token-estimator
功能描述
预估本次请求的 Token 消耗量,支持多模型精确计算
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install token-estimator - 安装完成后,直接呼叫该 Skill 的名称或使用
/token-estimator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
精简产品文化声明,明确误差说明
v1.0.0
初始版本发布 - 多模型 Token 预估,精度±3.5%,支持 Qwen/OpenAI/Gemini
元数据
常见问题
Token Estimator 是什么?
预估本次请求的 Token 消耗量,支持多模型精确计算. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 435 次。
如何安装 Token Estimator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install token-estimator」即可一键安装,无需额外配置。
Token Estimator 是免费的吗?
是的,Token Estimator 完全免费(开源免费),可自由下载、安装和使用。
Token Estimator 支持哪些平台?
Token Estimator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Token Estimator?
由 largetool(@largetool)开发并维护,当前版本 v1.0.1。
推荐 Skills