llm-log-analyzer

Solid

分析 llm-gateway 代理产生的请求/响应日志。当用户说"分析日志"、"查看 LLM 请求"、"对比 session"、"检查 token 用量"、"日志里有什么"、"帮我看看 data 目录"、"哪个请求失败了"、"找一下 session 的请求"等涉及 LLM 网关日志分析的场景时使用此 skill。即使用户只是笼统地说"看看日志"或"data 里有什么",也应触发。

AI & Automation 131 stars 26 forks Updated yesterday Apache-2.0

Install

View on GitHub

Quality Score: 87/100

Stars 20%
71
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# LLM Log Analyzer 分析 `./data/` 下的 LLM 请求/响应日志。 ## 日志结构 每个请求对应一个目录,命名格式 `YYYY-MM-DD_HH-MM-SS-mmm_NNNN`: ### 新格式(当前) ``` data/ └── 2026-05-20_03-56-28-921_0014/ ├── request.json # { headers: {...}, body: {...} } └── stream.log # SSE 流式响应原文(含 usage 数据) ``` ### 旧格式(兼容) ``` data/ └── 2026-05-14_10-30-15-123_0003/ ├── request.json # { headers?: {...}, body?: {...} } 或裸 body ├── response.json # JSON 响应(非流式) ├── stream.log # SSE 流式响应原文 └── log.txt # 终端格式的人类可读日志 ``` **request.json 格式**:`{ "headers": {...}, "body": {...} }`。body 包含以下字段: - `model`:模型名称(如 `deepseek-v4-pro`) - `system`:system prompt 数组(Anthropic 格式),每项含 `text` + 可选 `cache_control` - `messages`:消息数组 - `tools`:工具定义数组(Anthropic 格式用 `name`,OpenAI 格式用 `function.name`) - `thinking`:推理配置(如 `{"type": "enabled", "budget_tokens": 8000}`) - `output_config`:输出配置(如 `{"effort": "high"}`) - `stream`:是否流式(`true`) - `max_tokens`:最大输出 token `headers` 中的 `x-session-id` 可按 session 追踪同一 agent 的多次请求。`host` 头用于推断 API 路由(如 `api.deepseek.com` → `deepseek`)。 **stream.log 格式**:SSE 事件流,包含: - `message_start`:初始 usage(`input_tokens`、`cache_read_input_tokens`、`cache_creation_input_tokens`、`output_tokens=0`) - `content_block_start/delta/stop`:thinking、text、tool_use 内容块 - `message_delta`:最终 usage(含实际 `output_tokens`)+ `stop_reason` - `message_stop`:流结束标记 工具自动从 `stream.log` 的 `message_delta` 事件提取 token usage 数据,无需 `response.json`。 ## 分析工具 `scripts/llm-log-query.mjs` 提供以下子命令,用 ...

Details

Author
KonghaYao
Repository
KonghaYao/peri
Created
4 months ago
Last Updated
yesterday
Language
Rust
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

log-analyzer

日志分析助手 — 智能解析日志文件,识别异常模式,定位问题根因

686 Updated 2 days ago
laolaoshiren
AI & Automation Solid

log-analyzer

Senior-SRE log analysis specialist. Use when investigating incidents from logs, triaging error spikes, extracting timelines, correlating distributed traces, or separating signal from noise across plain-text, JSON (slog/zap), syslog, journald, container, and Kubernetes logs. ALWAYS use when the user asks to "analyze logs", "find the error", "what went wrong", "investigate this outage", "correlate request_id/trace_id", "look at the log file", or hands over log dumps / aggregator queries / kubectl logs output. Hands off to incident-postmortem when a blameless post-mortem document is requested.

27 Updated yesterday
johnqtcg
AI & Automation Listed

ai-usage-mirror

照一面"AI 使用行为的镜子":读取本地 Claude Code + Codex 的真实交互记录,归一进 SQLite, 产出你的 AI 使用习惯画像、常用代码/任务、协作摩擦点、重复求助;还能蒸馏你的**编码习惯** (技术栈指纹 / 需求表达风格 / 验证纪律 / 反复摩擦)成一份两层 markdown。当用户说"分析我的 AI 使用习惯 / AI 使用报告 / 我常用什么任务 / 我常让 AI 干什么 / 复盘我怎么用 AI / my AI usage habits / ai usage mirror / 我的 AI 使用画像 / 沉淀我的编码习惯 / 我的编码指纹 / 我的技术栈偏好 / coding profile"时触发。本地只读、零上传。

0 Updated 1 weeks ago
Lazarus893