llm-analytics-setup

Instrument LLM calls with PostHog analytics across major providers.

Updated Mar 21, 2026
One-click install
npx skills add https://github.com/dallasbpeters/tandra-peters-consulting --skill llm-analytics-setup-dallasbpeters
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llm-analytics-setup
Source: https://github.com/dallasbpeters/tandra-peters-consulting/tree/main/.claude/skills/llm-analytics-setup
Command: npx skills add https://github.com/dallasbpeters/tandra-peters-consulting --skill llm-analytics-setup-dallasbpeters

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PostHog LLM analytics instrumentation helps you add PostHog LLM analytics to applications using AI/LLM providers.

Core Features & Use Cases

  • Provider reference docs covering OpenAI, Azure OpenAI, Anthropic, Google GenAI, Cohere, Mistral, Perplexity, DeepSeek, Groq, Together AI, Fireworks AI, Hugging Face, Ollama, OpenRouter, LangChain, LlamaIndex, Crewai, AutoGen, Dspy, LangGraph, Pydantic AI, Vercel AI, Litellm, Instructor, Semantic Kernel, Mirascope, Mastra, Smolagents
  • Clear setup guidance for wrapping LLM calls with PostHog analytics across providers
  • Verification steps to view $ai_generation traces and generations in PostHog
  • Provider reference files in the references/ directory that include installation docs for major platforms

Quick Start

Follow the provider-specific references to instrument LLM calls with PostHog analytics.

Frequently Asked Questions about llm-analytics-setup

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

FAQPage Schema
How do I instrument LLM analytics for OpenAI and Anthropic calls in PostHog?

You instrument LLM analytics by wrapping your LLM calls with PostHog tracking using the provided provider references. This setup captures $ai_generation events and traces across platforms like OpenAI and Anthropic directly in your codebase.

What is the best way to track LLM generations and traces across multiple AI providers?

Tracking LLM generations across multiple providers is best handled by implementing standardized $ai_generation events. This approach uses provider-specific references to ensure consistent analytics capture across different platforms.

Does PostHog LLM analytics instrumentation work with frameworks like LangChain and Vercel AI?

Yes, PostHog LLM analytics instrumentation works with frameworks like LangChain, LlamaIndex, and Vercel AI. Provider reference files include setup guidance for wrapping calls within these specific frameworks.

Can I use this instrumentation to monitor local LLM calls with Ollama?

You can monitor local LLM calls with Ollama using this instrumentation. The provided references include setup documentation for Ollama alongside other providers to capture generation analytics.

How do I verify that my LLM analytics instrumentation is capturing traces correctly?

You verify LLM analytics instrumentation by checking for $ai_generation traces and generations within your PostHog dashboard. The setup guidance includes specific verification steps to confirm events are logging correctly.