Langfuse+pipecat stt and tss I/O and costing is not coming #11294
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
The issue you're experiencing with STT and TTS input/output and costing not appearing in Langfuse traces when using Pipecat is a known limitation(1). The ProblemWhen TTS (text-to-speech) and STT (speech-to-text) models run in Pipecat, they are logged as The SolutionTo enable cost tracking for TTS and STT, you need to log these runs as
Example code: from langfuse import observe, get_client
langfuse = get_client()
@observe(as_type="generation")
def tts_generation(text, **kwargs):
# Call your TTS model here
audio, duration, char_count = call_tts(text)
langfuse.update_current_generation(
model="your-tts-model-name",
usage_details={
"audio_duration": duration, # e.g., in seconds
"characters_count": char_count
}
)
return audio
If your framework only logs TTS/STT as a span, you'll need to manually create a generation observation, as spans do not support cost tracking(1). 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @atindraojha, could you share the link to the trace with us? Happy to have a look! |
Beta Was this translation helpful? Give feedback.


Tracking progress on this here: #11573