Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Expert in Langfuse - the open-source LLM observability platform. Covers tracing, prompt management, evaluation, datasets, and integration with LangChain, LlamaIndex, and OpenAI. Essential for debugging, monitoring, and improving LLM applications in production.
.claude/skills/sickn33-langfuse/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 6% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 109% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 72% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 87% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 132% | 0% |
Expert in Langfuse - the open-source LLM observability platform. Covers tracing, prompt management, evaluation, datasets, and integration with LangChain, LlamaIndex, and OpenAI. Essential for debugging, monitoring, and improving LLM applications in production.
Role: LLM Observability Architect
You are an expert in LLM observability and evaluation. You think in terms of traces, spans, and metrics. You know that LLM applications need monitoring just like traditional software - but with different dimensions (cost, quality, latency). You use data to drive prompt improvements and catch regressions.
Instrument LLM calls with Langfuse
When to use: Any LLM application
from langfuse import Langfuse
langfuse = Langfuse( public_key="pk-...", secret_key="sk-...", host="https://cloud.langfuse.com" # or self-hosted URL )
trace = langfuse.trace( name="chat-completion", user_id="user-123", session_id="session-456", # Groups related traces metadata={"feature": "customer-support"}, tags="production", "v2"] )
generation = trace.generation( name="gpt-4o-response", model="gpt-4o", model_parameters={"temperature": 0.7}, input={"messages": {"role": "user", "content": "Hello"}]}, metadata={"attempt": 1} )
response = openai.chat.completions.create( model="gpt-4o", messages={"role": "user", "content": "Hello"}] )
generation.end( output=response.choices0].message.content, usage={ "input": response.usage.prompt_tokens, "output": response.usage.completion_tokens } )
trace.score( name="user-feedback", value=1, # 1 = positive, 0 = negative comment="User clicked helpful" )
langfuse.flush()
Automatic tracing with OpenAI SDK
When to use: OpenAI-based applications
from langfuse.openai import openai
response = openai.chat.completions.create( model="gpt-4o", messages={"role": "user", "content": "Hello"}], # Langfuse-specific parameters name="greeting", # Trace name session_id="session-123", user_id="user-456", tags="test"], metadata={"feature": "chat"} )
stream = openai.chat.completions.create( model="gpt-4o", messages={"role": "user", "content": "Tell me a story"}], stream=True, name="story-generation" )
for chunk in stream: print(chunk.choices0].delta.content, end="")
import asyncio from langfuse.openai import AsyncOpenAI
async_client = AsyncOpenAI()
async def main(): response = await async_client.chat.completions.create( model="gpt-4o", messages={"role": "user", "content": "Hello"}], name="async-greeting" )
Trace LangChain applications
When to use: LangChain-based applications
from langchain_openai import ChatOpenAI from langchain_core.prompts import ChatPromptTemplate from langfuse.callback import CallbackHandler
langfuse_handler = CallbackHandler( public_key="pk-...", secret_key="sk-...", host="https://cloud.langfuse.com", session_id="session-123", user_id="user-456" )
llm = ChatOpenAI(model="gpt-4o")
prompt = ChatPromptTemplate.from_messages( ("system", "You are a helpful assistant."), ("user", "{input}") ])
chain = prompt | llm
response = chain.invoke( {"input": "Hello"}, config={"callbacks": langfuse_handler]} )
import langchain langchain.callbacks.manager.set_handler(langfuse_handler)
response = chain.invoke({"input": "Hello"})
from langchain.agents import create_openai_tools_agent
agent = create_openai_tools_agent(llm, tools, prompt) agent_executor = AgentExecutor(agent=agent, tools=tools)
result = agent_executor.invoke( {"input": "What's the weather?"}, config={"callbacks": langfuse_handler]} )
Version and deploy prompts
When to use: Managing prompts across environments
from langfuse import Langfuse
langfuse = Langfuse()
prompt = langfuse.get_prompt("customer-support-v2")
compiled = prompt.compile( customer_name="John", issue="billing question" )
response = openai.chat.completions.create( model=prompt.config.get("model", "gpt-4o"), messages=compiled, temperature=prompt.config.get("temperature", 0.7) )
trace = langfuse.trace(name="support-chat") generation = trace.generation( name="response", model="gpt-4o", prompt=prompt # Links to specific version )
langfuse.create_prompt( name="customer-support-v3", prompt= {"role": "system", "content": "You are a support agent..."}, {"role": "user", "content": "{{user_message}}"} ], config={ "model": "gpt-4o", "temperature": 0.7 }, labels="production"] # or "staging", "development"] )
prompt = langfuse.get_prompt( "customer-support-v3", label="production" # Gets latest with this label )
Evaluate LLM outputs systematically
When to use: Quality assurance and improvement
from langfuse import Langfuse
langfuse = Langfuse()
trace = langfuse.trace(name="qa-flow")
trace.score( name="relevance", value=0.85, # 0-1 scale comment="Response addressed the question" )
trace.score( name="correctness", value=1, # Binary: 0 or 1 data_type="BOOLEAN" )
def evaluate_response(question: str, response: str) -> float: eval_prompt = f""" Rate the response quality from 0 to 1.
Question: {question} Response: {response}
Output only a number between 0 and 1. """
result = openai.chat.completions.create( model="gpt-4o-mini", # Cheaper model for eval messages={"role": "user", "content": eval_prompt}] )
return float(result.choices0].message.content.strip())
score = evaluate_response(question, response) trace.score( name="quality-llm-judge", value=score )
dataset = langfuse.create_dataset(name="support-qa-v1")
langfuse.create_dataset_item( dataset_name="support-qa-v1", input={"question": "How do I reset my password?"}, expected_output="Go to settings > security > reset password" )
dataset = langfuse.get_dataset("support-qa-v1")
for item in dataset.items: # Generate response response = generate_response(item.input"question"])
# Link to dataset item trace = langfuse.trace(name="eval-run") trace.generation( name="response", input=item.input, output=response )
# Score against expected similarity = calculate_similarity(response, item.expected_output) trace.score(name="similarity", value=similarity)
# Link trace to dataset item item.link(trace, "eval-run-1")
Clean instrumentation with decorators
When to use: Function-based applications
from langfuse.decorators import observe, langfuse_context
@observe() # Creates a trace def chat_handler(user_id: str, message: str) -> str: # All nested @observe calls become spans context = get_context(message) response = generate_response(message, context) return response
@observe() # Becomes a span under parent trace def get_context(message: str) -> str: # RAG retrieval docs = retriever.get_relevant_documents(message) return "\n".join(d.page_content for d in docs])
@observe(as_type="generation") # LLM generation span def generate_response(message: str, context: str) -> str: response = openai.chat.completions.create( model="gpt-4o", messages= {"role": "system", "content": f"Context: {context}"}, {"role": "user", "content": message} ] ) return response.choices0].message.content
@observe() def main_flow(user_input: str): # Update current trace langfuse_context.update_current_trace( user_id="user-123", session_id="session-456", tags="production"] )
result = process(user_input)
# Score the trace langfuse_context.score_current_trace( name="success", value=1 if result else 0 )
return result
@observe() async def async_handler(message: str): result = await async_generate(message) return result
Skills: langfuse, langgraph
Workflow:
1. Build agent with LangGraph
2. Add Langfuse callback handler
3. Trace all LLM calls and tool uses
4. Score outputs for quality
5. Monitor and iterateSkills: langfuse, structured-output
Workflow:
1. Build RAG with retrieval and generation
2. Trace retrieval and LLM calls
3. Score relevance and accuracy
4. Track costs and latency
5. Optimize based on dataSkills: langfuse, langgraph, structured-output
Workflow:
1. Build agent with structured outputs
2. Create evaluation dataset
3. Run evaluations with traces
4. Compare prompt versions
5. Deploy best performersWorks well with: langgraph, crewai, structured-output, autonomous-agents
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 22,741 | 17,425 | -23% | 1 | 1 | 0% | 4,618 | 4,892 | +6% | 0 | 0 | — |
case-02 | fail→pass | 15,330 | 13,503 | -12% | 1 | 1 | 0% | 2,920 | 6,089 | +109% | 0 | 0 | — |
case-03 | pass→pass | 19,124 | 11,602 | -39% | 1 | 1 | 0% | 3,563 | 5,547 | +56% | 0 | 0 | — |
case-04 | fail→pass | 15,022 | 9,273 | -38% | 1 | 1 | 0% | 2,944 | 5,063 | +72% | 0 | 0 | — |
case-05 | fail→pass | 14,668 | 8,547 | -42% | 1 | 1 | 0% | 2,586 | 4,825 | +87% | 0 | 0 | — |
case-06 | pass→pass | 12,443 | 8,687 | -30% | 1 | 1 | 0% | 2,217 | 4,946 | +123% | 0 | 0 | — |
case-07 | fail→pass | 10,368 | 5,791 | -44% | 1 | 1 | 0% | 1,829 | 4,245 | +132% | 0 | 0 | — |
case-08 | fail→pass | 11,295 | 9,968 | -12% | 1 | 1 | 0% | 2,221 | 5,196 | +134% | 0 | 0 | — |
case-09 | fail→pass | 10,648 | 11,487 | +8% | 1 | 1 | 0% | 2,112 | 5,481 | +160% | 0 | 0 | — |
case-10 | fail→pass | 14,444 | 10,831 | -25% | 1 | 1 | 0% | 2,556 | 5,364 | +110% | 0 | 0 | — |
case-11 | pass→pass | 11,221 | 10,480 | -7% | 1 | 1 | 0% | 2,183 | 5,404 | +148% | 0 | 0 | — |
case-12 | fail→pass | 12,993 | 5,622 | -57% | 1 | 1 | 0% | 2,614 | 4,296 | +64% | 0 | 0 | — |
case-13 | fail→pass | 15,081 | 12,962 | -14% | 1 | 1 | 0% | 2,924 | 5,844 | +100% | 0 | 0 | — |
case-14 | fail→pass | 14,834 | 10,798 | -27% | 1 | 1 | 0% | 2,671 | 5,336 | +100% | 0 | 0 | — |
case-15 | fail→fail | 13,710 | 19,683 | +44% | 1 | 1 | 0% | 2,399 | 6,543 | +173% | 0 | 0 | — |
case-16 | fail→pass | 12,456 | 9,478 | -24% | 1 | 1 | 0% | 2,350 | 5,226 | +122% | 0 | 0 | — |
case-17 | pass→pass | 12,552 | 11,229 | -11% | 1 | 1 | 0% | 2,359 | 5,526 | +134% | 0 | 0 | — |
case-18 | fail→pass | 13,278 | 10,751 | -19% | 1 | 1 | 0% | 2,394 | 5,343 | +123% | 0 | 0 | — |
case-19 | fail→pass | 11,576 | 6,806 | -41% | 1 | 1 | 0% | 2,195 | 4,472 | +104% | 0 | 0 | — |
case-20 | pass→pass | 12,680 | 10,784 | -15% | 1 | 1 | 0% | 2,766 | 5,580 | +102% | 0 | 0 | — |
case-21 | pass→fail | 13,734 | 11,904 | -13% | 1 | 1 | 0% | 2,763 | 5,680 | +106% | 0 | 0 | — |
case-22 | pass→pass | 18,361 | 13,854 | -25% | 1 | 1 | 0% | 3,712 | 5,960 | +61% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +59 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.