by russ on 10/4/24, 5:01 PM with 61 comments
The goal is to give everyone access to the same stack that underpins Advanced Voice in the ChatGPT app.
Under the hood it works like this: - A user's speech is captured by a LiveKit client SDK in the ChatGPT app - Their speech is streamed using WebRTC to OpenAI’s voice agent - The agent relays the speech prompt over websocket to GPT-4o - GPT-4o runs inference and streams speech packets (over websocket) back to the agent - The agent relays generated speech using WebRTC back to the user’s device
The Realtime API that OpenAI launched is the websocket interface to GPT-4o. This backend framework covers the voice agent portion. Besides having additional logic like function calling, the agent fundamentally proxies WebRTC to websocket.
The reason for this is because websocket isn’t the best choice for client-server communication. The vast majority of packet loss occurs between a server and client device and websocket doesn’t provide programmatic control or intervention in lossy network environments like WiFi or cellular. Packet loss leads to higher latency and choppy or garbled audio.
by racecar789 on 10/5/24, 12:48 PM
Or, have the app call a pharmacy every month to refill prescriptions. For some drugs, the pharmacy requires a manual phone call to refill which gets very annoying.
So many use cases for this.
by throw14082020 on 10/5/24, 11:22 AM
OpenAI hired the ex fractional CTO of LiveKit, who created Pion, a popular WebRTC library/tool.
I'd expect OpenAI to migrate off of LiveKit within 6 months. LiveKit is too expensive. Also, WebRTC is hard, and OpenAI now being a less open company will want to keep improvements to itself.
Not affiliated with any competitors, but I did work at a PaaS company similar to LiveKit but used Websockets instead.
by pj_mukh on 10/4/24, 10:21 PM
Does the pricing breakdown to be the same as having a OpenAI Advanced Voice socket open the whole time? It's like $9/hr!
It would be theoretically cheaper to use this without keeping the advanced voice socket open the whole time and just use the GPT4o streaming service [1] for whenever inference is needed (pay per token) and use livekits other components to do the rest (TTS, VAD etc.).
What's the trade off here?
[1]: https://platform.openai.com/docs/api-reference/streaming
by solarkraft on 10/5/24, 12:59 AM
By the way: The cerebras voice demo also uses LiveKit for this: https://cerebras.vercel.app/
by FanaHOVA on 10/4/24, 9:27 PM
by spuz on 10/5/24, 8:46 AM
by mycall on 10/4/24, 9:10 PM
by 0x1ceb00da on 10/5/24, 11:50 AM
But when I asked advanced voice mode it said the exact opposite. That it receives input as audio and generates text as output.
by gastonmorixe on 10/4/24, 9:10 PM
There is a common consensus that the new Realtime API is not actually using the same Advanced Voice model / engine - or however it works - since at least the TTS part doesn’t seem to be as capable as the one shipped with the official OpenAI app.
Any idea on this?
Source: https://github.com/openai/openai-realtime-api-beta/issues/2
by lolpanda on 10/5/24, 6:47 AM
by willsmith72 on 10/4/24, 10:44 PM