Comprehensive LLM Tracing: Langfuse automatically captures detailed traces of all LLM interactions, including input prompts, outputs, token usage, latency, and costs. This provides complete visibility into your AI application’s behavior and helps identify performance bottlenecks and optimization opportunities.
Real-time Analytics and Monitoring: Built-in analytics dashboard provides real-time insights into model performance, usage patterns, and costs across your entire LLM stack. Monitor metrics like response times, token consumption, error rates, and user satisfaction to make data-driven decisions.
Debug and Evaluation Tools: Advanced debugging capabilities help identify and resolve issues in LLM applications through detailed trace inspection, prompt management, and automated evaluation workflows that ensure consistent model performance and output quality.
Before integrating Langfuse with TrueFoundry, ensure you have:
TrueFoundry Account: Create a Truefoundry account with atleast one model provider and generate a Personal Access Token by following the instructions in Generating Tokens
# Make a request through TrueFoundry Gateway with Langfuse tracingresponse = client.chat.completions.create( model="openai-main/gpt-4o", # Paste the model ID you copied from TrueFoundry Gateway messages=[ {"role": "system", "content": "You are a helpful AI assistant specialized in explaining AI concepts."}, {"role": "user", "content": "Why does an AI gateway help enterprises?"}, ], max_tokens=500, temperature=0.7)print(response.choices[0].message.content)# Ensure all traces are sent to Langfuselangfuse = get_client()langfuse.flush()