llm-observability

Monitor LLM applications with cost tracking, latency metrics, tracing, and feedback collection.

Updated Sep 23, 2026
One-click install
npx skills add https://github.com/ehadziabdic/WAgents --skill llm-observability-ehadziabdic
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: llm-observability
Source: https://github.com/ehadziabdic/WAgents/tree/main/opencode/skills/llm-observability
Command: npx skills add https://github.com/ehadziabdic/WAgents --skill llm-observability-ehadziabdic

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires tiktoken, langfuse, langsmith, arize-phoenix, openai, pandas, langchain-openai, traceloop-sdk, and includes scripts (resource) and references (resource) components.

What problem does it solve? LLM applications in production lack visibility into why outputs are good or bad, how much they cost, and when quality degrades. This Skill provides instrumentation patterns and scripts to track token usage, latency, errors, and user feedback across LLM providers. ## Core Features & Use Cases - Cost and Token Tracking: Log every LLM call with per-model pricing, aggregate daily spend, and detect cost anomalies with a SQLite-backed monitor script. - Tracing Integration: Instrument pipelines with LangSmith, Langfuse v3, or OpenLLMetry to capture retrieval spans, generations, and agent tool calls. - Quality and Feedback Monitoring: Collect thumbs-up/down and 1-5 ratings, detect quality degradation against baselines, and compare prompt variants in A/B tests. - Use Case: A team running a RAG chatbot uses the monitor script to log calls, sets alerts for TTFT spikes and budget overruns, and reviews weekly quality reports to catch hallucination increases. ## Quick Start Use the llm-observability skill to set up cost tracking and latency monitoring for my OpenAI-based chat application.

Frequently Asked Questions about llm-observability

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I track LLM token usage and costs in production?▼

Track LLM costs by logging input and output tokens per call and multiplying by per-model pricing per million tokens. The included llm_monitor.py script stores calls in SQLite and aggregates daily cost, token totals, and per-model breakdowns.

What is the difference between LangSmith and Langfuse for LLM tracing?▼

LangSmith is proprietary with native LangChain integration and enterprise-only self-hosting, while Langfuse is open-source with self-hosting support. Langfuse v3 is OpenTelemetry-based and uses observe decorators and explicit span context managers.

How do I measure TTFT and tokens per second for streaming responses?▼

Measure TTFT by timestamping the first streamed chunk and TPS by dividing output tokens by generation time. Enable stream_options with include_usage so the final chunk carries authoritative token counts instead of estimating from chunks.

Can I use tiktoken to count tokens for Claude models?▼

No, tiktoken only covers OpenAI tokenizers and is categorically wrong for Claude due to different vocabularies. Use the Anthropic count_tokens endpoint or read the usage block returned by the provider for exact counts.

How do I detect LLM quality degradation over time?▼

Detect degradation by comparing recent average user ratings against a historical baseline window. The quality_tracker.py script flags degradation when the rating drop exceeds a configurable threshold, given sufficient feedback samples.

What alerts should I set up for an LLM application?▼

Set alerts for error rate above 5 percent, p95 TTFT above 2000ms, daily cost spikes, average quality score below 3.5, and rate limit usage above 80 percent. Route critical alerts to PagerDuty and warnings to Slack.