Hello everyone, I tried to implement inference ser...
# inference
b
Hello everyone, I tried to implement inference service in my project, but it was not working. Please help me.
Copy code
session = AgentSession[UserData](
  userdata=userdata,
  vad=ctx.proc.userdata["vad"],
  stt="assemblyai/universal-streaming",
  llm="openai/gpt-4.1-mini",
  tts="cartesia/sonic-2:6f84f4b8-58a2-430c-8c79-688dad597532",
  turn_detection=MultilingualModel()
)
r
I'm having trouble reproducing the error. Would you mind sharing your entire agent script with me? Feel free to send it in a DM, if you prefer.
m
Hello i am facing a problem with inference too Here is how it looks on my end:
Copy code
session = AgentSession[UserData](
        userdata=userdata,
        stt="deepgram/nova-3",
        llm="openai/gpt-5",  
        tts="inworld/tts-1",
        vad=silero.VAD.load(),
        turn_detection=EnglishModel(),
        max_tool_steps=5,
    )
im getting the following error
Copy code
INFO:server:[LiveKit-Worker] 2025-10-08 22:28:43,114 - ERROR livekit.agents - Error in _tts_inference_task
I tried all different TTS providers and all of them lead to the same error here is the list that i have tried
Copy code
❌ cartesia/sonic
❌ elevenlabs/eleven-flash-v2
❌ elevenlabs/eleven-turbo-v2
❌ cartesia/sonic
❌ inworld/tts-1
I think the Inference is a really good feature and want to use it, if you could help me with this one would highly appreciate it.
🙌 1
r
the inworld call should be
inworld/inworld-tts-1
. But this isn't the cause of the issue because your call for cartesia, for example, is correct. I'm still having trouble reproducing this error. I've asked my team for help and will report back. what version of livekit-agents are you running? any other details about how you're running your agent that you could share, like where you're hosting it.
g
have you tried specifying a voice as well? i wonder if maybe that param is actually required every time
🙌 1
m
Thank you for your help. tts="cartesia/sonic-2:6f84f4b8-58a2-430c-8c79-688dad597532", i have used this instead and the error stopped happening, what i concluded is that we have to specify the voice_id along with the model name in order for it to work. the AI agent is working but somehow the rest of the flow isn't I haven't giving it enough time to know if its from the inference or not. but wanted to share what happened so far.
r
I notice you're using gpt-5, Nabil. It's very slow to respond. Would you try gpt-4.1-mini instead? also, feel free to DM me your agent code and I'll take a look.
m
Tom, we provided our code earlier in the week seeking help getting inference to work. @busy-restaurant-25888 shared our code. We haven't received suggestions to get inference to work and are anxious to improve latency especially when using avatars. Appreciate your help.
r
Thanks for the ping, David. I responded in the DM with Dragon
m
Thank you, Tom!