PostHog LLM Analytics

•
63
•

Instruments AI models and frameworks with PostHog observability to trace token counts, latency, costs, and user sessions.

PostHog LLM Analytics enables developers to inspect codebases, detect AI providers and orchestration frameworks, and inject production-grade LLM tracing without disrupting existing application architecture. It tracks critical AI operational metrics such as input and output token counts, execution latency, estimated model costs, and user distinct IDs across leading LLM providers (including OpenAI, Anthropic, Google Gemini, and DeepSeek) and popular frameworks like LangChain, LlamaIndex, CrewAI, and Vercel AI SDK.

Key Features

01Supports major providers and frameworks including OpenAI, Anthropic, LangChain, and Vercel AI
02Associates AI model generations with identified users via distinct IDs for full user journey tracking
03Automates PostHog SDK installation and environment variable setup via MCP integration
0463 GitHub stars
05Automatically detects LLM SDKs, AI frameworks, and package managers across project codebases
06Traces token usage, generation latency, model parameters, and costs for every generation

Use Cases

01Adding telemetry and cost monitoring after implementing new generative AI features
02Reviewing pull requests to ensure all LLM calls are properly instrumented with analytics
03Standardizing observability and user attribution across multi-model or multi-agent workflows