llm-analytics-setup

Wrap LLM SDKs with PostHog instrumentation to emit generation and trace events.

58|5|Updated Jan 19, 2026
One-click install
npx skills add https://github.com/PostHog/skills --skill llm-analytics-setup-posthog
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: llm-analytics-setup
Source: https://github.com/PostHog/skills/tree/main/skills/posthog/llm-analytics/skills/setup
Command: npx skills add https://github.com/PostHog/skills --skill llm-analytics-setup-posthog

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Enables easy setup of PostHog LLM analytics across multiple providers, so you can instrument, trace, and analyze AI-generated generations without hand-wiring instrumentation for each provider.

Core Features & Use Cases

  • Provider-agnostic instrumentation: wrap your LLM SDKs (OpenAI, Cohere, Google Gemini, etc.) and automatically emit $ai_generation, $ai_trace, and related events.
  • Reference materials: includes dedicated provider installation guides under references for OpenAI, Azure OpenAI, Anthropic, Google Gen AI, Cohere, Mistral, and many more to guide integration.
  • Verification workflow: guidance to verify traces and generations in PostHog dashboards.

Quick Start

Wrap your LLM SDK with PostHog instrumentation to enable automatic generation and trace events across providers.

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 across multiple providers?

Instrument LLM analytics across providers by wrapping your existing LLM SDK with PostHog instrumentation to automatically emit trace and generation events without hand-wiring each provider.

What is PostHog LLM analytics instrumentation and how does it work?

PostHog LLM analytics instrumentation wraps your LLM SDK calls to automatically emit standard events like $ai_generation and $ai_trace, enabling you to track and analyze AI generations within PostHog dashboards.

Can I use PostHog instrumentation with Anthropic, Google Gemini, and Cohere?

Yes, PostHog instrumentation works with Anthropic, Google Gemini, Cohere, Mistral, OpenAI, and Azure OpenAI, providing dedicated reference guides for each provider to standardize SDK integration.

How do I verify LLM traces and generations in PostHog?

Verify LLM traces and generations in PostHog by following the included verification workflow guidance, which directs you to check PostHog dashboards to confirm that automatic generation and trace events are properly captured.

Do I need to hand-wire tracing for every LLM provider I use?

No, you do not need to hand-wire tracing for every provider, because PostHog offers provider-agnostic instrumentation that wraps your LLM SDKs to standardize analytics across OpenAI, Anthropic, Cohere, and others.

What's the best way to standardize AI generation tracking across different LLM SDKs?

The best way to standardize AI generation tracking across different LLM SDKs is to wrap them with PostHog's provider-agnostic instrumentation, which automatically emits consistent trace and generation events for all supported providers.