← Back to Skills Marketplace
ekalb81

Clawfuse

by Frederick · GitHub ↗ · v0.0.2
cross-platform ✓ Security Clean
316
Downloads
1
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install langfuse-continuous-optimizer
Description
Continuous LangFuse-driven optimization loop for OpenClaw/OpenRouter model routing and prompt usage controls with persistent local memory. Use when Codex nee...
README (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.
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install langfuse-continuous-optimizer
  3. After installation, invoke the skill by name or use /langfuse-continuous-optimizer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug langfuse-continuous-optimizer
Version 0.0.2
License
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is Clawfuse?

Continuous LangFuse-driven optimization loop for OpenClaw/OpenRouter model routing and prompt usage controls with persistent local memory. Use when Codex nee... It is an AI Agent Skill for Claude Code / OpenClaw, with 316 downloads so far.

How do I install Clawfuse?

Run "/install langfuse-continuous-optimizer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Clawfuse free?

Yes, Clawfuse is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Clawfuse support?

Clawfuse is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Clawfuse?

It is built and maintained by Frederick (@ekalb81); the current version is v0.0.2.

💬 Comments