Llm Observability Expert logo

Llm Observability Expert

Community
roedyrustam
llm-observability-expert

Production LLM observability, token cost tracking, and GenAI tracing / Observabilitas LLM produksi, pelacakan biaya, dan tracing GenAI.

Overview

Publisherroedyrustam
Repositoryvibes-plug
Skill namellm-observability-expert
Stars
117
Forks
27
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by roedyrustam on GitHub. Read the source before you install it.

Installation

Install the Llm Observability Expert AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/roedyrustam/vibes-plug/tree/main/skills/llm-observability-expert
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/roedyrustam/vibes-plug.git /tmp/vibes-plug
mkdir -p .claude/skills
cp -r /tmp/vibes-plug/skills/llm-observability-expert .claude/skills/llm-observability-expert
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Llm Observability Expert in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Llm Observability Expert on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Llm Observability Expert is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

llm-observability-expert — vibes-plug Skill

English | Bahasa Indonesia


English

Orchestration & Integration

  • Upstream Orchestrators: Works under brainstorming (AI & LLM Integration matrix row) and zero-to-prod-orchestrator (Phase 7 - Monitoring & Production Telemetry) to provide observability for AI applications.
  • Downstream Cooperating Skills:
    • data-telemetry-expert — Extend OpenTelemetry instrumentation with LLM-specific spans and metrics.
    • llm-finops-router — Feed real-time cost data to the FinOps router for dynamic model selection.
    • kv-cache-prefix-optimizer — Monitor cache hit rates to detect prefix cache invalidation.
    • logging-error-tracking-expert — Integrate LLM traces with Sentry error tracking and Pino structured logs.
    • ai-safety-governance-expert — Log and audit AI outputs for compliance with safety policies.
    • adaptive-model-cascade — Feed model latency and error statistics to dynamic model cascading routers.
    • session-memory-manager — Store AI session traces and token usage checkpoints.

Description

Production observability framework for LLM-powered applications. Addresses the biggest blind spot in 2026 AI applications: teams deploy AI features to production with zero visibility into token costs, hallucination rates, latency distributions, cache hit ratios, or user satisfaction scores. This skill provides the instrumentation patterns, tool integrations, and dashboard architectures to make LLM behavior fully observable.

Trigger Conditions

Activate this skill when:

  • Deploying any LLM-powered feature to production (chatbots, AI assistants, code generators, content tools).
  • Investigating unexplained cost spikes in AI API billing.
  • Debugging hallucination reports or quality degradation in AI outputs.
  • Building dashboards to monitor AI feature health and cost efficiency.
  • Comparing model performance (latency, quality, cost) across providers.

Core Concepts & Patterns

1. LLM Observability Stack (2026)
LayerToolPurpose
TracingLangfuse / Helicone / LunaryEnd-to-end trace of LLM calls, including prompt, completion, tokens, latency, and metadata
Cost TrackingHelicone / LiteLLM Proxy / CustomReal-time token cost aggregation by model, feature, user, and tenant
Quality MetricsLangfuse Scores / Custom EvalsHallucination rate, factuality score, user satisfaction (thumbs up/down)
AlertingGrafana / PagerDuty / CustomCost anomaly alerts, latency SLA breaches, error rate spikes
LogsOpenTelemetry + Axiom/DatadogStructured logs with prompt/completion pairs for debugging
2. Core Metrics to Track
typescript
export interface LLMCallMetrics {
  traceId: string;
  spanId: string;
  timestamp: string;

  // Model & Provider
  model: string;
  provider: 'openai' | 'anthropic' | 'google' | 'custom';

  // Token Economics
  promptTokens: number;
  completionTokens: number;
  cachedTokens: number;
  totalCost: number;
  cacheHitRate: number;

  // Latency
  timeToFirstToken: number;
  totalLatency: number;
  tokensPerSecond: number;

  // Quality Signals
  userFeedback?: 'positive' | 'negative' | null;
  hallucinationDetected?: boolean;
  toolCallSuccess?: boolean;
  retryCount: number;

  // Context
  feature: string;
  userId?: string;
  tenantId?: string;
  sessionId: string;
}
3. Langfuse Integration (TypeScript)
typescript
import { Langfuse } from 'langfuse';

const langfuse = new Langfuse({
  publicKey: process.env.LANGFUSE_PUBLIC_KEY!,
  secretKey: process.env.LANGFUSE_SECRET_KEY!,
  baseUrl: process.env.LANGFUSE_BASE_URL,
});

export function traceLLMCall<T>(
  featureName: string,
  userId: string,
  fn: (trace: ReturnType<typeof langfuse.trace>) => Promise<T>
): Promise<T> {
  const trace = langfuse.trace({
    name: featureName,
    userId,
    metadata: { environment: process.env.NODE_ENV },
  });

  return fn(trace).finally(() => langfuse.flush());
}

// Usage in API route with graceful availability fallback:
export async function handleChatRequest(req: Request) {
  const { message, userId } = await req.json();

  return traceLLMCall('chat-assistant', userId, async (trace) => {
    let activeModel = 'gemini-4-pro';
    let response: { text: string; usage: { promptTokens: number; completionTokens: number; totalTokens: number } };

    try {
      response = await callLLM(message, activeModel);
    } catch (err) {
      // Invariant: Gracefully fall back to Gemini 3.8 Flash if Gemini 4 Pro is unprovisioned/unavailable
      console.warn('[LLMObservability] Gemini 4 Pro unavailable. Falling back to Gemini 3.8 Flash:', err);
      activeModel = 'gemini-3.8-flash';
      trace.update({ metadata: { fallbackTriggered: true, originalModel: 'gemini-4-pro', fallbackModel: activeModel } });
      response = await callLLM(message, activeModel);
    }

    const generation = trace.generation({
      name: 'chat-completion',
      model: activeModel,
      input: message,
    });

    generation.end({
      output: response.text,
      usage: {
        promptTokens: response.usage.promptTokens,
        completionTokens: response.usage.completionTokens,
        totalTokens: response.usage.totalTokens,
      },
    });

    return new Response(JSON.stringify({ text: response.text }));
  });
}
4. Cost Anomaly Detection
typescript
export interface CostAlert {
  type: 'daily_budget_exceeded' | 'cost_per_call_spike' | 'cache_hit_drop';
  severity: 'warning' | 'critical';
  currentValue: number;
  threshold: number;
  message: string;
}

export function detectCostAnomalies(
  metrics: LLMCallMetrics[],
  dailyBudget: number,
  expectedCacheHitRate: number
): CostAlert[] {
  const alerts: CostAlert[] = [];

  const dailyCost = metrics.reduce((sum, m) => sum + m.totalCost, 0);
  if (dailyCost > dailyBudget) {
    alerts.push({
      type: 'daily_budget_exceeded',
      severity: 'critical',
      currentValue: dailyCost,
      threshold: dailyBudget,
      message: `Daily AI cost $${dailyCost.toFixed(2)} exceeds budget $${dailyBudget.toFixed(2)}`,
    });
  }

  const avgCacheHit = metrics.reduce((sum, m) => sum + m.cacheHitRate, 0) / metrics.length;
  if (avgCacheHit < expectedCacheHitRate * 0.7) {
    alerts.push({
      type: 'cache_hit_drop',
      severity: 'warning',
      currentValue: avgCacheHit,
      threshold: expectedCacheHitRate,
      message: `Cache hit rate dropped to ${(avgCacheHit * 100).toFixed(1)}% (expected ${(expectedCacheHitRate * 100).toFixed(1)}%)`,
    });
  }

  return alerts;
}
5. Dashboard Architecture
┌──────────────────────────────────────────────────────┐
│                  AI OPERATIONS DASHBOARD              │
├──────────────┬───────────────┬────────────────────────┤
│ COST CENTER  │ QUALITY       │ PERFORMANCE            │
├──────────────┼───────────────┼────────────────────────┤
│ Daily spend  │ Hallucination │ P50/P95/P99 latency    │
│ by model     │ rate (24h)    │ by model               │
│              │               │                        │
│ Cost per     │ User feedback │ Tokens/second           │
│ feature      │ ratio (+/-)   │ throughput              │
│              │               │                        │
│ Cache hit    │ Tool call     │ Time-to-first-token     │
│ rate trend   │ success rate  │ distribution            │
│              │               │                        │
│ Token volume │ Retry rate    │ Error rate by           │
│ by tenant    │ by feature    │ provider                │
└──────────────┴───────────────┴────────────────────────┘

Best Practices

  1. Instrument Every LLM Call: No LLM call should go untraced. Wrap all provider SDK calls in an observability layer.
  2. Track Cost Per Feature, Not Just Total: Aggregate costs by feature name to identify the most expensive AI functions.
  3. Set Budget Alerts Early: Configure daily/weekly cost alerts before going to production, not after the first billing shock.
  4. Collect User Feedback Signals: Implement thumbs up/down buttons on AI outputs and log them as quality scores in Langfuse.
  5. Monitor Cache Hit Rates: A drop in cache hit rate directly increases costs — alert on deviations from baseline.
  6. Track Model Availability Fallbacks: When Gemini 4 falls back to Gemini 3.8 Flash or Claude Opus 5.5 falls back to Claude Opus 4.6, tag trace metadata with fallbackTriggered: true to observe provider availability and SLA compliance.

Common Pitfalls to Avoid

Anti-PatternConsequenceRemedy
No observability in production AI featuresZero visibility into costs, quality, or failuresInstrument every LLM call with Langfuse/Helicone
Logging full prompts without PII filteringGDPR/PDPA violation from stored user dataApply PII scrubbing before logging
No cost alertingSurprise $10k+ monthly billsSet daily budget alerts with automatic circuit breakers
Tracking only latency, ignoring qualityLow-latency but high-hallucination responsesTrack factuality scores alongside latency

Sovereign Execution, Token Efficiency & Invariants

DimensionSovereign Mandate & Deterministic Contract
Frontier Model CascadeMedium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast)
Availability FallbackGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Zero unhandled missing-model errors)
KV-Cache & Token ProtocolPin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out
SaaT CLI & MCP DispatchCLI: vibes skill exec llm-observability-expert <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
NFR & Anti-Slop InvariantsP99 API Gateway Latency < 85ms, OpenAPI 3.1 / TypeSpec strict schema parity, RFC 9457 Problem Details error contracts, Idempotency-Key enforcement; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict


Bahasa Indonesia

Integrasi Orkestrasi

  • Orkestrator Hulu: Beroperasi di bawah arahan brainstorming (baris "AI & LLM Integration" pada Matriks Orkestrasi) dan zero-to-prod-orchestrator (Fase 7 - Pemantauan & Telemetri Produksi) untuk menyediakan observabilitas aplikasi AI.
  • Skill Hilir & Kerja Sama:
    • data-telemetry-expert — Memperluas instrumentasi OpenTelemetry dengan span dan metrik khusus LLM.
    • llm-finops-router — Mengirim data biaya real-time ke router FinOps untuk pemilihan model dinamis.
    • kv-cache-prefix-optimizer — Memantau cache hit rate untuk mendeteksi invalidasi prefix cache.
    • logging-error-tracking-expert — Mengintegrasikan trace LLM dengan pelacakan error Sentry dan log Pino.
    • ai-safety-governance-expert — Mencatat dan mengaudit output AI untuk kepatuhan kebijakan keamanan.
    • adaptive-model-cascade — Menyalurkan statistik latensi dan error model ke router cascade model.
    • session-memory-manager — Menyimpan trace sesi AI dan checkpoint penggunaan token.

Deskripsi

Kerangka observabilitas produksi untuk aplikasi berbasis LLM. Mengatasi blind spot terbesar di aplikasi AI 2026: tim men-deploy fitur AI ke produksi tanpa visibilitas terhadap biaya token, tingkat halusinasi, distribusi latensi, rasio cache hit, atau skor kepuasan pengguna.

Kondisi Pemicu

Aktifkan skill ini ketika:

  • Men-deploy fitur berbasis LLM ke produksi (chatbot, asisten AI, generator kode).
  • Menginvestigasi lonjakan biaya tak terduga di tagihan API AI.
  • Men-debug laporan halusinasi atau degradasi kualitas output AI.
  • Membangun dashboard untuk memonitor kesehatan fitur AI.

Konsep Inti & Pola Praktik

1. Metrik Inti yang Dilacak

Setiap panggilan LLM harus mencatat: traceId, model, provider, token (prompt/completion/cached), biaya total, cache hit rate, TTFT, latensi total, feedback pengguna, deteksi halusinasi, dan konteks fitur/user/tenant.

2. Integrasi Langfuse

Gunakan Langfuse untuk tracing end-to-end setiap panggilan LLM, termasuk input prompt, output completion, penggunaan token, dan latensi.

3. Deteksi Anomali Biaya

Implementasikan alert otomatis untuk: anggaran harian terlampaui, lonjakan biaya per-panggilan, dan penurunan cache hit rate.


Praktik Terbaik

  1. Instrumenkan Setiap Panggilan LLM: Tidak ada panggilan LLM yang boleh tidak dilacak.
  2. Lacak Biaya Per Fitur: Agregasikan biaya berdasarkan nama fitur untuk mengidentifikasi fungsi AI termahal.
  3. Atur Alert Anggaran Sejak Awal: Konfigurasikan alert biaya harian/mingguan sebelum ke produksi.
  4. Kumpulkan Sinyal Feedback Pengguna: Implementasikan tombol thumbs up/down pada output AI.
  5. Pantau Pengalihan Ketersediaan (Fallback): Saat model Gemini 4 dialihkan ke Gemini 3.8 Flash atau Claude Opus 5.5 ke Claude Opus 4.6, sematkan metadata fallbackTriggered: true pada trace untuk memantau SLA ketersediaan dan variasi biaya.

Matriks Eksekusi Berdaulat, Efisiensi Token & Invarian

DimensiMandat Berdaulat & Kontrak Deterministik
Kaskade Model FrontierMedium / High (GPT-5.6 Sol Medium, Gemini 4 Argon, Claude Sonnet 5.5 High, Grok 4.7 High Fast)
Invarian Fallback KetersediaanGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Bebas gagal saat model belum tersedia/kuota penuh)
Protokol Hemat Token & KV-CacheKunci instruksi & skema statis di prefix awal (kv-cache-prefix-optimizer); kirim potongan CONTEXT_MAP.md (<250 token/panggilan) saat Fan-Out
Eksekusi SaaT CLI & MCPCLI: vibes skill exec llm-observability-expert <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_ast_query, vibes_compile_cache, vibes_optimize_budget, vibes_verify_gate
Invarian NFR & Anti-SlopLatensi P99 API < 85ms, paritas skema ketat OpenAPI 3.1 / TypeSpec, kontrak error RFC 9457 Problem Details, penegakan Idempotency-Key; kode 100% tuntas tanpa placeholder diverifikasi melalui node scripts/check-anti-slop.js --strict

Frequently asked questions

What does the Llm Observability Expert AI skill do?

Production LLM observability, token cost tracking, and GenAI tracing / Observabilitas LLM produksi, pelacakan biaya, dan tracing GenAI.

Why use Llm Observability Expert on TypingMind?

Because you install it once and use it with any model. Llm Observability Expert is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Llm Observability Expert in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/roedyrustam/vibes-plug/tree/main/skills/llm-observability-expert. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Llm Observability Expert?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Llm Observability Expert?

As many as you like. As long as a model supports skills, you can use Llm Observability Expert with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Llm Observability Expert AI skill free?

Yes. It is published on GitHub by roedyrustam under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇