is anyone using langfuse to analyse the STT-LLM-TT...
# agents
h
is anyone using langfuse to analyse the STT-LLM-TTS pipeline? If so, 1. are you getting multiple traces broken down weirdly? Like multiple TTS traces for 1 message or no STT trace at all 2. Have you been able to add a session id to it to compile all traces under 1 session/room?
I got the second one working and first partially. the example to use is here -> https://github.com/livekit/agents/blob/main/examples/voice_agents/langfuse_trace.py It returns the tracker to the entrypoint function. But I’m still not getting proper STT node data. for example which model was used. Example of trace attached: user_turn data:
Copy code
{
  "attributes": {
    "langfuse.session.id": "room-01k4m89c8asjyx91g3h4htegpq-1699787030",
    "lk.user_transcript": "Yeah. I think, uh, I need to give you a middle name as well.",
    "lk.transcript_confidence": "0.99902344",
    "lk.transcription_delay": "2.3042168617248535",
    "lk.end_of_utterance_delay": "3.0082478523254395"
  },
  "resourceAttributes": {
    "telemetry.sdk.language": "python",
    "telemetry.sdk.name": "opentelemetry",
    "telemetry.sdk.version": "1.37.0",
    "service.name": "unknown_service"
  },
  "scope": {
    "name": "livekit-agents",
    "attributes": {}
  }
}
j
for the first one, if you are using tts.FallbackAdapter or tts.StreamAdapter (for non-streaming tts like openai tts), there will be multiple tts span nested for one generation since each wrapper has a span, and if it’s non-streaming tts, the generation is done by sentence, so each sentence will have a span nested under the tts_node. stt has no span because it works in streaming mode in livekit, the audio is always sent to the stt (or the stt.StreamAdapter), the user transcript, transcription latency and confidence are added as attrs to the
user_turn
span.
h
STT data not being tracked makes is a bit odd setup. Given major stt model services (we're using deepgram and assemblyai for fallback) have pricing per minute/hour, only being able to track the final output does not help in the matter. Is there a way to work it in?
There also the issue if the model not being provided in the TTS or stt in the model data of langufuse's telemetry. So it's blind for performance and cost estimation as it needs the model to be able to do those things. Any way we can push those in the langfuse plugin? Given the example I've attached in top message?
j
a pr to add the model provider and name to the metrics https://github.com/livekit/agents/pull/3165/files
👍 1