Langfuse Cost Tuning
jeremylongshore/tons-of-skills-marketplace
Monitor and optimize LLM costs using Langfuse analytics and dashboards.
Queries Langfuse traces, prompts, datasets and sessions, and analyzes local LLM gateway logs for requests, context growth, token use and cache hits.
SKILL.md written in Chinese; this summary is our English description.
$ npx skills add KonghaYao/peri --skill langfuse -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install KonghaYao/peri langfuse --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/KonghaYao/peri.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/langfuse .claude/skills/langfuse && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "langfuse" agent skill from https://github.com/KonghaYao/peri/tree/main/.claude/skills/langfuse into .claude/skills/langfuse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/KonghaYao/peri/tree/main/.claude/skills/langfuseType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add KonghaYao/peri --skill langfuse -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install KonghaYao/peri langfuse --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/KonghaYao/peri.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/langfuse .agents/skills/langfuse && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "langfuse" agent skill from https://github.com/KonghaYao/peri/tree/main/.claude/skills/langfuse into .agents/skills/langfuse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add KonghaYao/peri --skill langfuse -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install KonghaYao/peri langfuse --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/KonghaYao/peri.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/langfuse .cursor/skills/langfuse && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "langfuse" agent skill from https://github.com/KonghaYao/peri/tree/main/.claude/skills/langfuse into .cursor/skills/langfuse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/KonghaYao/peri.git --path .claude/skills/langfuse--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add KonghaYao/peri --skill langfuse -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install KonghaYao/peri langfuse --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/KonghaYao/peri.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/langfuse .gemini/skills/langfuse && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "langfuse" agent skill from https://github.com/KonghaYao/peri/tree/main/.claude/skills/langfuse into .gemini/skills/langfuse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install KonghaYao/peri langfuseInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add KonghaYao/peri --skill langfuse -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/KonghaYao/peri.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/langfuse .github/skills/langfuse && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "langfuse" agent skill from https://github.com/KonghaYao/peri/tree/main/.claude/skills/langfuse into .github/skills/langfuse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add KonghaYao/peri --skill langfuse -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install KonghaYao/peri langfuse --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/KonghaYao/peri.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/langfuse .opencode/skills/langfuse && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "langfuse" agent skill from https://github.com/KonghaYao/peri/tree/main/.claude/skills/langfuse into .opencode/skills/langfuse/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "langfuse", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
langfuseQueries Langfuse traces, prompts, datasets and sessions, and analyzes local LLM gateway logs for requests, context growth, token use and cache hits.
Two data sources are handled. Langfuse traces, observations, sessions, prompts, datasets and scores are reached through langfuse-cli (run with bunx) and TypeScript scripts, while local llm-gateway request.json and stream.log files are analyzed with scripts such as llm-log-query.mjs and context-growth.mjs. The local route needs no Langfuse credentials or network, and the two sources are not treated as interchangeable.
The Langfuse route needs LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY and LANGFUSE_HOST in a .env file, and the agent asks you to add them there rather than paste keys in chat. A preflight checks that the host returns JSON, discovers the installed CLI schema, fetches every page of list results (the public API limit is 100 per page) and records which fields were requested, reporting uninspected fields as not inspected instead of missing. An auth, schema or truncation failure stops diagnosis.
Raw gateway logs can hold credentials and private content, so the skill shows summaries first and confirms redaction before drilling into bodies or headers. Other scripts cover trace messages, prompt breakdown, session analysis and a daily report, and reference files cover error analysis, instrumentation, judge calibration, prompt migration, SDK upgrades and feedback. The SKILL.md mixes Chinese and English.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit d7ee444. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
WebFetch(domain:langfuse.com)Bash(curl *langfuse.com/*)Bash(bunx langfuse-cli api --help *)Bash(bunx langfuse-cli api * --help *)Bash(bunx langfuse-cli api * list *)Bash(bunx langfuse-cli api * get *)Bash(bun .claude/skills/langfuse/scripts/analyze.ts *)Bash(bun .claude/skills/langfuse/scripts/trace-search.ts *)Bash(bun .claude/skills/langfuse/scripts/trace-tree.ts *)Bash(bun .claude/skills/langfuse/scripts/trace-tokens.ts *)…and 7 more on the same allowed-tools line.
From allowed-tools in the SKILL.md frontmatter.
Ships 9 files in scripts/ (TypeScript and JavaScript, from the files we listed), which the agent can run.
Shell commands in SKILL.md call:
bunbunxcurljqFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
langfuse.comcloud.langfuse.comFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
LANGFUSE_PUBLIC_KEYLANGFUSE_SECRET_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Langfuse and LLM Gateway Logs loads about 4.3k tokens when it runs, and up to ~19k if it reads all its reference files. Until then it costs about 53 tokens; SKILL.md has 1,192 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
fuse REST API. Run via bunx (auto-loads `.env`):bunx automatically loads `.env`. Ensure it contains:re missing, ask the user to add them to `.env`. Do not ask to paste keys in chat.Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.
The full file from KonghaYao/peri at commit d7ee444, republished under its Apache-2.0 licence (© KonghaYao). 1,192 words, ~4,308 tokens.
.claude/skills/langfuse/SKILL.md (or your agent's skills folder). This skill also uses 22 other files; get the full folder from GitHub.| 数据来源 / 需求 | 使用方式 |
|---|---|
| Langfuse trace、observation、session,或平台 API / 文档 | 下文 Langfuse CLI 与 TypeScript 脚本 |
本地 llm-gateway 的 request.json、stream.log,请求差异、缓存断点、上下文增长 | 本地网关日志分析,使用 scripts/llm-log-query.mjs 与 scripts/context-growth.mjs |
Use langfuse-cli to interact with the full Langfuse REST API. Run via bunx (auto-loads .env):
bunx langfuse-cli api --help # 列出所有 resources
bunx langfuse-cli api <resource> --help # List actions for a resource
bunx langfuse-cli api <resource> <action> --help # Show args for an action
bunx langfuse-cli api <resource> <action> [options] # Executebunx automatically loads .env. Ensure it contains:
LANGFUSE_PUBLIC_KEY=pk-lf-...
LANGFUSE_SECRET_KEY=sk-lf-...
LANGFUSE_HOST=https://cloud.langfuse.com # RequiredIf credentials are missing, ask the user to add them to .env. Do not ask to paste keys in chat.
Before attributing missing or malformed data to application behavior:
LANGFUSE_HOST or LANGFUSE_BASE_URL is set, credentials are present, and the selected host returns JSON rather than an HTML fallback. Never print credentials or authorization headers.bunx langfuse-cli api --help and resource/action --help; resource names vary by CLI version, so do not assume observations-v2s or another historical alias exists.--json for machine-readable output--curl to preview HTTP request without executing--help; do not hard-code version-specific v2 aliases本节 Langfuse 查询脚本的时间与元数据过滤选项如下;本地网关日志脚本的参数见 本地网关日志分析,不要混用两套参数:
| Option | Description | Example |
|---|---|---|
--from <ISO> | Start timestamp | --from 2026-07-01T00:00:00Z |
--to <ISO> | End timestamp | --to 2026-07-31T23:59:59Z |
--days <N> | Last N days (from now) | --days 7 |
--tag <tag> | Filter by tag | --tag production |
--user <id> | Filter by user ID | --user user_123 |
--session <id> | Filter by session ID | --session sess_abc |
--name <str> | Filter by trace name | --name chat |
--limit <N> | Max results | --limit 50 |
bun .claude/skills/langfuse/scripts/trace-search.ts [选项]
# 示例
bun .claude/skills/langfuse/scripts/trace-search.ts --days 7 --tag production # 最近 7 天带 production tag 的 trace
bun .claude/skills/langfuse/scripts/trace-search.ts --session sess_abc --csv > session.csv # 导出 session 为 CSV
bun .claude/skills/langfuse/scripts/trace-search.ts --model claude-sonnet --status error # 查询特定模型的错误 trace
bun .claude/skills/langfuse/scripts/trace-search.ts --from 2026-07-01T00:00:00Z --summary # 只看汇总统计
bun .claude/skills/langfuse/scripts/trace-search.ts --days 30 --json > report.json # 导出 JSON
bun .claude/skills/langfuse/scripts/trace-search.ts --user user_123 --limit 100 # 按用户过滤
bun .claude/skills/langfuse/scripts/trace-search.ts --order latency.desc --limit 10 # 按延迟排序,找最慢的Output modes: table (default), --csv, --json, --summary (aggregate only), --full (detailed fields).
bun .claude/skills/langfuse/scripts/analyze.ts [N] # Overview + trace table + flags
bun .claude/skills/langfuse/scripts/analyze.ts --tools [N] # Tool call analysis
bun .claude/skills/langfuse/scripts/analyze.ts --growth [N] # Context growth trend
bun .claude/skills/langfuse/scripts/analyze.ts --report [N] # Full report (all 7 sections)
bun .claude/skills/langfuse/scripts/analyze.ts --trace-id <id> # Single trace detail
# 支持时间/元数据过滤
bun .claude/skills/langfuse/scripts/analyze.ts 20 --days 7 --user user_123 --report # 某用户最近 7 天的完整报告bun .claude/skills/langfuse/scripts/session-analyze.ts --session <id> [选项]
# 选项
--limit <N> 最多拉取 trace 数(默认 100)
--detail 显示每个 trace 的逐轮 token 流
--csv 导出 CSV(每个 LLM 调用一行)
# 输出内容
# - Session 总体指标(traces, tokens, cost, time span)
# - Trace 时间线表格
# - 累积 token 增长趋势
# - 工具使用频率统计
# - 异常检测bun .claude/skills/langfuse/scripts/daily-report.ts [选项]
bun .claude/skills/langfuse/scripts/daily-report.ts # 今天的日报
bun .claude/skills/langfuse/scripts/daily-report.ts --days 7 # 最近 7 天周报
bun .claude/skills/langfuse/scripts/daily-report.ts --days 30 --tag prod # 按 tag 过滤的月报
bun .claude/skills/langfuse/scripts/daily-report.ts --model claude-sonnet # 按模型过滤
bun .claude/skills/langfuse/scripts/daily-report.ts --detail # 显示所有 trace 详情
# 输出内容
# - Key Metrics(traces, sessions, errors, tokens, cost)
# - By Model 分布
# - Top Users(按输入 token)
# - Top Traces(按输入 token)
# - 异常 trace 列表# Token 流 + 缓存异常
bun .claude/skills/langfuse/scripts/trace-tokens.ts <traceId>
bun .claude/skills/langfuse/scripts/trace-tokens.ts --index 1 --days 7 # 用 --index 从过滤结果中选 trace
# 消息组成 + diff
bun .claude/skills/langfuse/scripts/trace-messages.ts <traceId> [--detail]
bun .claude/skills/langfuse/scripts/trace-messages.ts --index 3 --user user_123
# System prompt 段落拆解
bun .claude/skills/langfuse/scripts/prompt-breakdown.ts <traceId>
bun .claude/skills/langfuse/scripts/prompt-breakdown.ts --index 1 --days 7
# Trace 汇总列表
bun .claude/skills/langfuse/scripts/traces-list.ts [N] [过滤选项]bun .claude/skills/langfuse/scripts/trace-tree.ts <traceId>This command fetches all observation pages, prints a metadata-only tree, and exits non-zero when it finds duplicate IDs, missing parent observations, or cycles. A parent equal to the trace ID is a valid root attachment. Use it whenever the diagnosis concerns subagent ownership, generation/tool/batch nesting, or orphan observations; do not infer parent integrity from a flat list.
A unit/mock pass proves only local construction. After changing instrumentation or parent assignment:
trace-tree.ts on that trace and inspect expected generation/tool/batch ownership.| 需求 | 命令 |
|---|---|
| 今天所有 trace | bun .claude/skills/langfuse/scripts/daily-report.ts 或 bun .claude/skills/langfuse/scripts/trace-search.ts --days 1 |
| 本周 trace | bun .claude/skills/langfuse/scripts/daily-report.ts --days 7 |
| 本月 trace | bun .claude/skills/langfuse/scripts/daily-report.ts --days 30 |
| 特定时间段 | bun .claude/skills/langfuse/scripts/trace-search.ts --from ISO --to ISO |
| 上周 vs 本周对比 | 分别跑两次 .claude/skills/langfuse/scripts/daily-report.ts --days 7(注意时间不对齐),或用 --from/--to 精确控制 |
| 需求 | 命令 |
|---|---|
| 某用户的所有 trace | bun .claude/skills/langfuse/scripts/trace-search.ts --user <id> --days 30 |
| 某 session 完整分析 | bun .claude/skills/langfuse/scripts/session-analyze.ts --session <id> --detail |
| 某 session 导出 CSV | bun .claude/skills/langfuse/scripts/session-analyze.ts --session <id> --csv |
| 用户日报 | bun .claude/skills/langfuse/scripts/daily-report.ts --user <id> --days 1 |
| 需求 | 命令 |
|---|---|
| 找最贵的 trace | bun .claude/skills/langfuse/scripts/trace-search.ts --order totalTokens --days 7 --limit 10 |
| 全量成本报告 | bun .claude/skills/langfuse/scripts/analyze.ts 50 --days 7 --report |
| 单模型成本 | bun .claude/skills/langfuse/scripts/daily-report.ts --days 7 --model claude-sonnet |
| 缓存效率低的 trace | bun .claude/skills/langfuse/scripts/analyze.ts --days 7 --report(看 Summary & Flags 的缓存异常) |
| 需求 | 命令 |
|---|---|
| 找所有错误 trace | bun .claude/skills/langfuse/scripts/trace-search.ts --status error --days 7 |
| 某错误 trace 深挖 | bun .claude/skills/langfuse/scripts/trace-tokens.ts <traceId> + bun .claude/skills/langfuse/scripts/trace-messages.ts <traceId> |
| agent loop 检测 | bun .claude/skills/langfuse/scripts/analyze.ts --days 7 --tools(看 LLM 调用次数) |
| context 膨胀分析 | bun .claude/skills/langfuse/scripts/analyze.ts --growth --days 7 |
| 需求 | 命令 |
|---|---|
| 模型用量分布 | bun .claude/skills/langfuse/scripts/daily-report.ts --days 7(看 By Model 表) |
| 某模型所有 trace | bun .claude/skills/langfuse/scripts/trace-search.ts --model <model> --days 7 --csv |
| 需求 | 命令 |
|---|---|
| 看 system prompt 结构 | bun .claude/skills/langfuse/scripts/prompt-breakdown.ts --index 1 --days 1 |
| system prompt 是否稳定 | bun .claude/skills/langfuse/scripts/trace-messages.ts <traceId>(看 System Prompt Stability 段落) |
| 上下文增长来源 | bun .claude/skills/langfuse/scripts/trace-messages.ts <traceId> --detail(看消息 diff) |
daily-report.ts快速了解系统状态:今天/本周有多少 trace、花了多少钱、有没有异常。每天跑一次即可。
analyze.ts --report当发现异常(成本飙升、缓存降低、用户反馈质量差)时,对最近 N 条 trace 做全维度扫描。
trace-search.ts当你已经知道要找什么(某用户、某 session、某时间段、某模型),直接筛选。支持导出 CSV/JSON 做进一步分析。
trace-tokens.ts + trace-messages.ts + prompt-breakdown.ts定位到具体 trace 后,这三件套分别看 token 流、消息变化、prompt 结构,逐轮定位问题。
session-analyze.ts需要完整还原用户的一次会话时使用,看 trace 时间线、token 累积、工具使用演变。
prompt-breakdown.ts + CLI get prompt先看现有 request 中 system prompt 的段落分布(哪些段落最大),然后用 CLI 管理 Langfuse prompt:
bunx langfuse-cli api prompts list
bunx langfuse-cli api prompts get --name <name>
bunx langfuse-cli api prompts create --name <name> --type chat --prompt '[...]'| # | Section | What it shows |
|---|---|---|
| 1 | Overview | Aggregate stats, cache efficiency, output/input ratio |
| 2 | Per-Trace Table | Input/output/cache/latency per trace |
| 3 | Tool Analysis | Frequency, avg latency, redundancy detection, tool→context growth |
| 4 | Context Growth | Per-trace token trend (visual bar chart), session accumulation, cross-trace growth rate |
| 5 | System Prompt Occupancy | Section breakdown with estimated tokens, system vs conversation ratio |
| 6 | Most Expensive Trace | Per-LLM-call detail with delta |
| 7 | Summary & Flags | Auto-detected issues (low cache, redundant tools, slow calls, etc.) |
| Pattern | Threshold | Root Cause |
|---|---|---|
| Cache hit rate < 90% | Single trace | System prompt instability, cold start, or structure changing across turns |
| Effective new tokens > 20K | Single trace | Tool results or context growing unbounded |
| Output/Input ratio > 5% | Single trace | Model over-explaining |
| Output/Input ratio < 0.1% | Single trace | Massive input for tiny output — unnecessary context |
| LLM calls > 10 for simple task | Single trace | Agent looping or retrying |
| Single LLM call > 60s | Per-call | Model generating too much for the task |
After analysis, evaluate:
## Cost Reflection
### Metrics
- Traces analyzed: N
- Total input: X tokens (Y% cache hit)
- Total output: Z tokens
- Avg LLM calls per trace: M
### Findings
1. [Pattern with specific trace example]
2. [Another pattern]
### Recommendations
1. [Actionable optimization] — estimated savings: ~X tokens/trace
2. [Another recommendation]curl -s https://langfuse.com/llms.txtReturns structured list of every doc page. Use to discover the right page, then fetch it.
Append .md to any doc path:
curl -s "https://langfuse.com/docs/observability/overview.md"curl -s "https://langfuse.com/api/search-docs?query=How+do+I+trace+LangGraph+agents"Returns matching documents with URLs, titles, and excerpts. Also indexes GitHub Issues/Discussions.
当不同 trace/session 的 input tokens 存在无法解释的差异时,下载完整 input 做 diff 是最直接的定位手段。
1. 找到差异 trace 的 generation observation ID
# 列出 session 的所有 trace
bunx langfuse-cli api traces list --session-id <session_id> --json | jq '.body.data[].id'
# 列出 trace 下所有 GENERATION observation
curl -s -u "$LANGFUSE_PUBLIC_KEY:$LANGFUSE_SECRET_KEY" \
"$LANGFUSE_HOST/api/public/observations?traceId=<trace_id>&limit=100" \
| jq '[.data[] | select(.type == "GENERATION") | {id, inputTokens: .usageDetails.input}]'2. 下载完整 input 并保存
curl -s -u "$LANGFUSE_PUBLIC_KEY:$LANGFUSE_SECRET_KEY" \
"$LANGFUSE_HOST/api/public/observations/<obs_id>" \
| jq '.input' > /tmp/input_a.json
curl -s -u "$LANGFUSE_PUBLIC_KEY:$LANGFUSE_SECRET_KEY" \
"$LANGFUSE_HOST/api/public/observations/<obs_id>" \
| jq '.input' > /tmp/input_b.json3. Diff
diff /tmp/input_a.json /tmp/input_b.json| 场景 | 表现 | Diff 会发现 |
|---|---|---|
| System prompt 不稳定 | 同模型同会话类型但 input tokens 差异大 | messages[0].content(system prompt)中某段内容不同 |
| Tools 数组变化 | input tokens 差异 ~数 K | tools 数组长度或内容不同 |
| Deferred Tools / MCP 描述 | 跨会话缓存命中率为 0% | system prompt 中 Deferred Tools 段多了/少了 MCP 工具描述文本 |
| 消息历史差异 | 上下文增长异常 | messages 数组长度不同,某条消息缺失或重复 |
.input 是完整请求体(包含 messages、tools、model 等字段),diff 能精确定位任何差异jq '.input.messages[0].content' -rjq '.input.tools'usageDetails 包含 cache_read_input_tokens 和 cache_creation_input_tokens,是缓存诊断的关键数据© KonghaYao, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 22 other files (scripts, references) in .claude/skills/langfuse of KonghaYao/peri.
Open the folder on GitHubat commit d7ee444
Langfuse and LLM Gateway Logs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Langfuse and LLM Gateway Logs this skillKonghaYao/peri | 223 | — | ~4.3k | Automated safety check: Notes | Apache-2.0 | |
| Langfuse Cost Tuningjeremylongshore/tons-of-skills-marketplace | 2.8k | 1 repos | ~2.4k | Automated safety check: Pass | MIT | |
| AI Observabilityomer-metin/skills-for-antigravity | 162 | — | ~578 | Automated safety check: Pass | Apache-2.0 | |
| Telemetry AnalyzerIBM/ibm-watsonx-orchestrate-adk | 178 | — | ~10k | Automated safety check: Notes | MIT | |
| Monitoring Observabilityyonatangross/orchestkit | 289 | — | ~2.2k | Automated safety check: Pass | MIT | |
| Caveman Workflow LabelerJuliusBrussee/caveman | 110k | 1 repos | ~1.3k | Automated safety check: Pass | Apache-2.0 |
jeremylongshore/tons-of-skills-marketplace
Monitor and optimize LLM costs using Langfuse analytics and dashboards.
omer-metin/skills-for-antigravity
Implement comprehensive observability for LLM applications including tracing (Langfuse/Helicone), cost tracking, token optimization, RAG evaluation metrics (RAGAS), hallucination detection, and…
IBM/ibm-watsonx-orchestrate-adk
A skill your agent uses when the user wants to analyze agent telemetry traces to find bugs and get fix recommendations — walks through exporting traces from a local or remote watsonx Orchestrate…
yonatangross/orchestkit
Monitoring and observability patterns for Prometheus metrics, Grafana dashboards, Langfuse v4 LLM tracing (astype, scorecurrentspan, shouldexportspan, LangfuseMedia), and drift detection.
JuliusBrussee/caveman
Finds every LLM workflow in a repository, proposes a labeling table and, once you agree, wires labels so Caveman Cloud groups spend per workflow.
JuliusBrussee/caveman
Read-only review of Caveman Cloud data to explain where LLM spend goes: cost, score, workflows, traces, latency, errors, routing and verified savings.
KonghaYao/peri
Audits recent agent conversation history and turns repeated failures and successes into testable harness improvement proposals that later audits can check.
KonghaYao/peri
Runs commands, reads and edits files, and copies data on remote machines through a single-file Node script that wraps the system ssh and scp, in Chinese.
KonghaYao/peri
Sends a compact, redacted decision packet to a tool-free Opus advisor subagent when a task has high-risk trade-offs or stalled investigations, then weighs the answer.
KonghaYao/peri
Registers, lists and removes recurring agent tasks with five-field cron expressions, and sets safety rules so a schedule is created only when the user clearly asks.
KonghaYao/peri
Verifies and repairs a feature by using the real Peri terminal UI as a user would, looping verify, decide, fix and review until a fresh round shows no blockers.
KonghaYao/peri
Multi-agent workflow orchestration. An agent skill from KonghaYao/peri.
Categories
Queries Langfuse traces, prompts, datasets and sessions, and analyzes local LLM gateway logs for requests, context growth, token use and cache hits. Two data sources are handled.mjs.
Langfuse and LLM Gateway Logs fits situations like: inspecting a Langfuse trace or session to find where a run went wrong; comparing requests and context growth in local LLM gateway logs; checking token usage and prompt cache hit rates; looking up Langfuse SDK usage or API resources.
Run `npx skills add KonghaYao/peri --skill langfuse -a claude-code`. Or copy the skill folder (.claude/skills/langfuse in KonghaYao/peri) into .claude/skills/langfuse in your project. Claude Code loads it when a task matches its description.
Run `npx skills add KonghaYao/peri --skill langfuse -a codex`. Or copy the skill folder (.claude/skills/langfuse in KonghaYao/peri) into .agents/skills/langfuse in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add KonghaYao/peri --skill langfuse -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/langfuse, .gemini/skills/langfuse, .github/skills/langfuse and .opencode/skills/langfuse in your project.
Going by SKILL.md and its folder, Langfuse and LLM Gateway Logs needs TypeScript and JavaScript for the scripts in its folder, the command-line tools its instructions call (bun, bunx, curl and jq) and credentials named LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY. Our summary lists: bun, to run langfuse-cli and the bundled scripts; Langfuse API keys and host in a .env file for the remote route; Local gateway log files for the offline route. Its frontmatter pre-approves these tools: WebFetch(domain:langfuse.com), Bash(curl *langfuse.com/*), Bash(bunx langfuse-cli api --help *), Bash(bunx langfuse-cli api * --help *), Bash(bunx langfuse-cli api * list *), Bash(bunx langfuse-cli api * get *), Bash(bun .claude/skills/langfuse/scripts/analyze.ts *), Bash(bun .claude/skills/langfuse/scripts/trace-search.ts *), Bash(bun .claude/skills/langfuse/scripts/trace-tree.ts *), Bash(bun .claude/skills/langfuse/scripts/trace-tokens.ts *), Bash(bun .claude/skills/langfuse/scripts/trace-messages.ts *), Bash(bun .claude/skills/langfuse/scripts/prompt-breakdown.ts *), Bash(bun .claude/skills/langfuse/scripts/traces-list.ts *), Bash(bun .claude/skills/langfuse/scripts/session-analyze.ts *), Bash(bun .claude/skills/langfuse/scripts/daily-report.ts *), Bash(bun .claude/skills/langfuse/scripts/llm-log-query.mjs *), Bash(bun .claude/skills/langfuse/scripts/context-growth.mjs *).
SKILL.md names 2 domains. In commands or code: langfuse.com and cloud.langfuse.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.
Langfuse and LLM Gateway Logs is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 4.3k tokens (SKILL.md is roughly 17k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 15k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Langfuse and LLM Gateway Logs: Langfuse Cost Tuning (jeremylongshore/tons-of-skills-marketplace, 2.8k stars), AI Observability (omer-metin/skills-for-antigravity, 162 stars), Telemetry Analyzer (IBM/ibm-watsonx-orchestrate-adk, 178 stars) and Monitoring Observability (yonatangross/orchestkit, 289 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
KonghaYao (a GitHub user) maintains it in KonghaYao/peri, which has 223 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 8, 2026.
Source: KonghaYao/peri on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.