← 返回
效率工具 Key 中文

Clawfuse

Continuous LangFuse-driven optimization loop for OpenClaw/OpenRouter model routing and prompt usage controls with persistent local memory. Use when Codex nee...
LangFuse驱动的持续优化循环,用于OpenClaw/OpenRouter模型路由及提示词使用控制,配备持久化本地内存。用于Codex需要...
ekalb81
效率工具 clawhub v0.0.2 1 版本 100000 Key: 需要
★ 1
Stars
📥 567
下载
💾 4
安装
1
版本
#latest

概述

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.

版本历史

共 1 个版本

  • v0.0.2 当前
    2026-03-30 07:39 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 432 📥 103,778
productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,833
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 438 📥 147,628