Sesame like turn handling

Dear Livekit community,

I have been developing self-hosted voice agents using our tts and stt, and we are looking for a way to make turn handling similar to the way that Sesame handles user and agent turns flawlessly and human like.

Currently we are using Smart-Turn for a semantic turn detection while using Silero VAD for voice activity.
What are your recommendations?.

LiveKit offers many options for turn detection. I believe the guide linked below should get you going in the correct direction.

Worth separating two things here, because “human-like” usually hides a tradeoff rather than a setting you can turn on.

I benchmarked this over 265 labelled calls, scoring two numbers on the same files:

  • final delay: how long after the caller actually stopped before a turn gets declared
  • premature cuts: decisions landing inside a pause the caller was going to speak through, bucketed by how long that pause was
                       final delay   premature in <0.5s gaps   never declared a turn
Silero baseline             0.93 s                        1%              1 of 265
semantic, raw audio         0.37 s                       20%             57 of 265
semantic, cleaned audio     0.25 s                       21%             71 of 265

The semantic model is 0.68 s faster, which is the part you feel in the first minute of a demo. It also cuts in during short pauses twenty times more often, and on roughly a quarter of calls it never declares a turn at all, so something else has to end them.

That last column is what I’d check before chasing Sesame’s feel. A model that is quick on the turns it catches and silent on the rest demos as flawless and shows up in production as a hang.

On your setup specifically, I’d measure before changing anything. Label the primary speech spans in a few dozen of your own calls, then score the gaps between them: final delay is the first decision after the last span ends, premature is any decision landing inside a gap. That tells you whether Smart-Turn is costing you latency or costing you interruptions, which need opposite fixes. Method and the scoring code: GitHub - Rehansanjay/vad-turn-end-latency: Measures what a voice-isolation filter does to VAD turn-end latency - the pause a caller actually hears - using LiveKit's own silero VAD at its own defaults, with an attenuator control. · GitHub

For what it’s worth the rows above are Silero against alkove, in its raw and cleaned-audio modes. I ran it because alkove’s maintainer asked for the unflattering parts too, which is why the last column is in the table at all.

Correcting the table in my post above. Two of the three numbers in it were wrong and the conclusion I drew from the third does not survive. alkove’s maintainer found two of them by reading my scoring code; the third was my own bug. Re-run on the same 265 files:

                     final    <0.5s   0.5-1s   unexplained
                     delay     gaps     gaps        misses
Silero               0.49s      13%      69%      0 of 265
semantic, raw        0.32s      20%      56%      4 of 265
semantic, cleaned    0.18s      21%      62%      0 of 265

The Silero baseline was a double count. I had added min_silence and min_delay together. In audio_recognition.py:

extra_sleep = min_delay + last_speaking_time - now

min_delay runs from the backdated end of speech, and by the time Silero reports end of speech min_silence has already elapsed, so extra_sleep comes out negative and the agent waits no longer. The decision lands at end + max(min_silence, min_delay), which on LiveKit’s defaults is 0.55s, not 1.05s. So 0.93s became 0.49s, and the speed difference is 0.3s rather than 0.68s.

The cleaned-audio column moved for a different reason, 0.25s to 0.18s. My scorer only counted a decision landing strictly after the last labelled span. These labels run about 0.2s past the voice in the median, so the fastest decisions were landing just inside the span and being thrown away.

The column I told you to check does not exist. I said the cleaned-audio condition never declares a turn on 71 of 265 files, and built the “demos as flawless, shows up in production as a hang” warning on it. That was the same scoring artefact. Counting the last decision from 1.5s before the labelled end onwards, it is 10 files, and all ten end on the caller’s last word: the labels stop within 0.45s of it, so there was nowhere in the file to put a decision and no detector could have made one. Zero unexplained misses. The maintainer said this himself rather than accept a number that damned his own model, which is why I trusted it enough to go and check.

The one real failure the 71 was pointing at belongs to the raw-audio condition: 4 files with one to two seconds of tail it declared nothing in.

And the tradeoff reverses in one band. With Silero deciding 0.5s earlier, its decisions land inside shorter pauses. Under half a second, 1% became 13%. In the half-second-to-one-second band it is 69%, worse than either semantic condition. That is not an artefact: a detector that fires 0.55s into any silence will fire inside almost every pause longer than 0.55s, and that band is made of exactly those. So VAD-only endpointing interrupts sub-second pauses more often than the semantic head does, and my earlier claim that the semantic model buys its speed by taking the floor mid-sentence was mostly the phantom 0.5s talking.

What survives, for your question. Under half a second, which is a breath rather than a pause, Silero is still the more cautious of the three: 13% against 20-21%. That is the band to measure if your complaint about Smart-Turn is that it cuts in mid-sentence, and the lever there is the pause threshold rather than a different model.

The advice in my last paragraph stands, and this is the argument for it. Label your own spans and score your own gaps before changing anything, because I got two numbers wrong on a dataset I had labels for.

Full corrections and the code: GitHub - Rehansanjay/vad-turn-end-latency: Measures what a voice-isolation filter does to VAD turn-end latency - the pause a caller actually hears - using LiveKit's own silero VAD at its own defaults, with an attenuator control. · GitHub