langfuse
Add LLM Observability and Tracing to Your AI Applications
Debug and monitor your LLM applications with comprehensive tracing and evaluation. Langfuse provides open-source observability to track costs, latency, and quality across your AI workflows.
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「langfuse」。 User asks for help tracing an OpenAI chat application with Langfuse
預期結果:
- Initialization code showing Langfuse client setup with API keys and host configuration
- Trace creation with user_id, session_id, and metadata fields
- Generation logging that captures input messages, model parameters, and token usage
- Example of scoring traces based on user feedback or automated criteria
正在使用「langfuse」。 User needs LangChain callback integration for their RAG pipeline
預期結果:
- CallbackHandler setup with public key, secret key, and optional session tracking
- Configuration showing how to pass handlers to chain.invoke() calls
- Example of setting global callback handler for automatic tracing
- Sample trace output showing nested spans for retriever and LLM calls
安全審計
安全All 17 static analysis findings are false positives. The skill is documentation for Langfuse, an open-source LLM observability platform. External command detections are Python code examples, not shell execution. Network URLs are legitimate API endpoints. API key references are placeholder examples in documentation.
風險因素
🌐 網路存取 (2)
🔑 環境變數 (2)
品質評分
你能建構什麼
Production LLM Application Monitoring
Track and debug live AI applications with full trace visibility. Monitor token costs, response latency, and error rates across user sessions.
Prompt Development and Testing
Version prompts, compare outputs across iterations, and run A/B tests. Use datasets to systematically evaluate prompt changes before deployment.
AI Cost and Performance Optimization
Analyze token usage patterns, identify expensive operations, and optimize model selection. Set up alerts for cost anomalies and performance degradation.
試試這些提示
Help me set up Langfuse tracing for my OpenAI application. I need to track chat completions with user IDs and session IDs. Show me the Python code to initialize Langfuse and wrap my existing OpenAI calls.
I have a LangChain application with custom chains and agents. Guide me through adding Langfuse callback handlers to trace all chain executions, including nested calls and tool usage.
I want to manage multiple versions of my system prompts in Langfuse and compare their performance. Show me how to create prompts in Langfuse, retrieve them in code, and analyze which versions perform better.
Help me build an evaluation pipeline that scores my LLM outputs based on relevance and accuracy. I need to create test datasets, define scoring criteria, and run batch evaluations to compare model versions.
最佳實務
- Always call langfuse.flush() in serverless environments to ensure traces are sent before function exit
- Include user_id and session_id on all traces to enable user-level debugging and session analytics
- Use meaningful trace and span names that reflect business logic rather than generic function names
避免
- Not flushing traces in serverless functions, causing data loss when execution ends
- Tracing every operation without filtering, creating noise and performance overhead
- Missing user and session identifiers, limiting ability to debug specific user experiences