← 返回 Skills 市场
ekalb81

Clawfuse

作者 Frederick · GitHub ↗ · v0.0.2
cross-platform ✓ 安全检测通过
316
总下载
1
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install langfuse-continuous-optimizer
功能描述
Continuous LangFuse-driven optimization loop for OpenClaw/OpenRouter model routing and prompt usage controls with persistent local memory. Use when Codex nee...
使用说明 (SKILL.md)

Langfuse Continuous Optimizer

Overview

Run an automated observe -> evaluate -> adapt loop backed by LangFuse data.

This skill is independent and self-contained: it includes both policy builder and continuous optimizer scripts.

Quick Start

# Single optimization cycle (LangFuse API -> staged policy -> promoted live policy if gate passes)
python scripts/langfuse_openclaw_optimizer.py run-once \
  --langfuse-host https://us.cloud.langfuse.com \
  --window-hours 24 \
  --out-dir ~/.openclaw/optimizer \
  --live-policy-path ~/.openclaw/llm_routing_policy.json \
  --promote-live-policy \
  --write-memory \
  --save-config

# Continuous daemon
python scripts/langfuse_openclaw_optimizer.py daemon \
  --interval-min 30 \
  --save-config

# Toggle settings later (persisted)
python scripts/langfuse_openclaw_optimizer.py configure --disable-promote-live-policy --show
python scripts/langfuse_openclaw_optimizer.py configure --promote-live-policy --write-memory --show

Credentials:

  • LANGFUSE_PUBLIC_KEY
  • LANGFUSE_SECRET_KEY

Workflow

  1. Pull LangFuse observations and scores from the configured time window.
  2. Normalize telemetry and build staged routing policy artifacts.
  3. Compare staged policy against current live policy with switch guardrails.
  4. Promote only when gain and quality constraints are met and promotion is explicitly enabled.
  5. Persist cycle memory to reduce policy churn and enable rollback reasoning.

Safety

  • Network egress: calls LangFuse Public API.
  • Local writes: writes raw snapshots, staged artifacts, and optional memory state under --out-dir.
  • Live policy overwrite is opt-in via --promote-live-policy.
  • Without --promote-live-policy, cycles are non-destructive (stage/evaluate only).
  • Save persisted defaults with --save-config; edit/toggle with configure.

Runtime Integration

Use the generated live policy in OpenClaw/LLM runtime via:

--llm-routing-policy-file ~/.openclaw/llm_routing_policy.json
--llm-policy-reload-sec 300

Tag requests with stable task keys (planning, tool-selection, retrieval, summarization, generation, etc.) so per-task routing converges quickly.

Resources (optional)

scripts/

  • scripts/langfuse_openclaw_optimizer.py: API pull + cycle orchestration + promotion gating + persistent memory.
  • scripts/closed_loop_prompt_ops.py: normalization and policy generation engine used by the optimizer.

references/

  • references/data-contracts.md: input/output schemas and artifacts.
  • references/closed-loop-playbook.md: guardrails, mutation policy, memory strategy, runtime integration notes.
安全使用建议
This skill appears to do what it claims: it fetches LangFuse telemetry and generates staged routing policies, writing artifacts under ~/.openclaw. Before installing, consider: 1) Only provide LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY you trust the script to use; prefer environment variables over saving secrets into the config file. 2) Run initial cycles without --promote-live-policy (the default) to review staged policies before any live overwrite. 3) Inspect and, if desired, run the scripts in a sandbox or test environment to confirm behavior (especially file locations and any subprocess calls). 4) If you store secrets in config, be aware they may be persisted to ~/.openclaw/optimizer/config.json; rotate keys if you later remove the skill.
功能分析
Type: OpenClaw Skill Name: langfuse-continuous-optimizer Version: 0.0.2 The OpenClaw AgentSkills bundle is designed for continuous LangFuse-driven optimization of LLM routing policies. The `langfuse_openclaw_optimizer.py` script fetches telemetry and scores from the LangFuse Public API (using provided API keys for Basic Auth), processes this data locally via `closed_loop_prompt_ops.py` (executed as a subprocess), and generates/promotes routing policies. All network and file system operations (reading/writing config, raw data, policies, and memory files) are explicitly declared in the documentation and are directly aligned with the skill's stated purpose. While the option to persist LangFuse API keys to a local config file (`--persist-secrets`) could be a security vulnerability if the file is not properly secured, this is an opt-in feature and not indicative of malicious intent by the skill itself. There is no evidence of data exfiltration, unauthorized execution, persistence mechanisms beyond its stated daemon mode, or prompt injection attempts against the AI agent.
能力评估
Purpose & Capability
Name/description match the requested env vars (LangFuse keys) and included Python scripts. Requiring python and LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY is proportionate for a LangFuse-backed optimizer.
Instruction Scope
SKILL.md instructs the agent to call the included Python scripts to fetch LangFuse data, produce staged routing policies, and optionally promote a live policy. The documented network egress (LangFuse public API) and local writes (out-dir, live policy, optimizer memory) match the script behavior described in the files.
Install Mechanism
No external install or download steps; this is instruction + included Python scripts only. Nothing is fetched from arbitrary URLs or extracted to disk beyond the repo files and user-specified out-dir.
Credentials
Only LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY are required (primary credential set to LANGFUSE_SECRET_KEY) which is appropriate. One minor note: the script’s internal SENSITIVE_KEYS use lowercase names (langfuse_public_key / langfuse_secret_key) for CLI/config keys — you should confirm how you provide keys (env vars vs CLI vs saved config) because saving config can persist secrets if provided via config file.
Persistence & Privilege
The skill writes persistent artifacts under ~/.openclaw (config, raw snapshots, cycles, optimizer_memory). always:false and no system-level changes requested. Be aware that using --save-config or running with secrets in config could persist sensitive keys locally; promotion of live policy is opt-in via --promote-live-policy.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install langfuse-continuous-optimizer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /langfuse-continuous-optimizer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.0.2
- Added metadata field specifying environment variables and binaries required for operation. - Enhanced safety controls: live policy promotion now requires explicit --promote-live-policy flag. - Added persistent configuration management with --save-config and interactive toggling via configure subcommand. - Expanded documentation on non-destructive cycle options and local file writes. - Updated quick start examples to reflect new safety and configuration flags. - Improved workflow step: promotion occurs only if enabled, increasing guardrail safety.
v0.0.1
Initial release of langfuse-continuous-optimizer. - Automates a continuous optimization loop for OpenClaw/OpenRouter model routing using LangFuse data. - Provides both a policy builder and a persistent optimizer with safe policy promotion cycles. - Enables ingestion of LangFuse observations and evaluator scores for automated task-level routing policy generation. - Includes command-line scripts for one-off or daemonized optimization workflows. - Supports persistent memory for rollback, reduced policy churn, and improved routing adaptation. - Designed for seamless integration with OpenClaw/LLM runtime environments.
元数据
Slug langfuse-continuous-optimizer
版本 0.0.2
许可证
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Clawfuse 是什么?

Continuous LangFuse-driven optimization loop for OpenClaw/OpenRouter model routing and prompt usage controls with persistent local memory. Use when Codex nee... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 316 次。

如何安装 Clawfuse?

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

Clawfuse 是免费的吗?

是的,Clawfuse 完全免费(开源免费),可自由下载、安装和使用。

Clawfuse 支持哪些平台?

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

谁开发了 Clawfuse?

由 Frederick(@ekalb81)开发并维护,当前版本 v0.0.2。

💬 留言讨论