Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Langfuse Spring AI Demo Application

中文文档

官方github demo 地址

Prerequisites

  • Java 21+
  • Langfuse stack (Cloud or Self-Hosted)
  • Langfuse API Keys
  • An OpenAI Api Key

How to run

  1. Configure environment variables to connect Spring AI demo app with Langfuse.
    export SPRING_AI_OPENAI_APIKEY="sk-proj-xxx"
    export OTEL_EXPORTER_OTLP_ENDPOINT="https://cloud.langfuse.com/api/public/otel" # 🇪🇺 EU data region
    # export OTEL_EXPORTER_OTLP_ENDPOINT="https://us.cloud.langfuse.com/api/public/otel" # 🇺🇸 US data region
    # export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:3000/api/public/otel" # 🏠 Local deployment (>= v3.22.0)
    export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic $(echo -n "pk-lf-xxx:sk-lf-xxx" | base64)"
    
  2. Run the sample application with ./mvnw clean install spring-boot:run.
  3. Call the chat endpoint with curl localhost:8080/v1/chat.
  4. Observe the new trace in the Langfuse web UI.

sample-trace

About

Langfuse 3 + Spring AI demo. Tested local deployment with Docker Compose. Full LLM observability via OpenTelemetry tracing. | Langfuse 3 与 Spring AI 集成示例,支持 Docker Compose 本地部署,基于 OpenTelemetry 实现完整 LLM 可观测性。

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages