langfuse-cost-tuning

Installation
SKILL.md

Langfuse Cost Tuning

Overview

Track, analyze, and optimize LLM costs using Langfuse's built-in token/cost tracking, the Metrics API for programmatic cost analysis, model routing for cost reduction, and automated budget alerts.

Prerequisites

  • Langfuse tracing with token usage captured (via observeOpenAI or manual usage fields)
  • For Metrics API: @langfuse/client installed
  • Understanding of LLM pricing models

How Langfuse Tracks Costs

Langfuse automatically calculates costs for supported models (OpenAI, Anthropic, Google) when token usage is captured. For custom models, you can configure pricing in the Langfuse UI under Settings > Model Definitions.

Cost tracking works on observations of type generation and embedding. The observeOpenAI wrapper captures usage automatically; for manual tracing, include usage in your observation updates.

Instructions

Installs
1
GitHub Stars
2.6K
First Seen
14 days ago
langfuse-cost-tuning — jeremylongshore/claude-code-plugins