Add Hakim plugin (STT + TTS)#6397
Open
malekZain-Hakim wants to merge 1 commit into
Open
Conversation
Adds livekit-plugins-hakim: STT and TTS support for Hakim (https://tryhakim.ai), an Arabic-first realtime speech platform. - STT: streaming transcription over WSS /v1/audio/transcriptions/stream, plus a batch recognize() over the HTTP endpoint. - TTS: persistent-socket streaming synthesis over WSS /v1/audio/speech/stream, plus one-shot synthesize() over HTTP. Both talk to Hakim's public REST/WebSocket API directly (no separate Hakim SDK dependency). Verified with ruff check, ruff format, and mypy --strict against a real livekit-agents install.
tryhakim
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
livekit-plugins-hakim: STT and TTS support for Hakim, an Arabic-first realtime speech platform (TTS, STT, voice cloning).WSS /v1/audio/transcriptions/stream(interim + final transcripts, word/segment timestamps, diarization), plus a batchrecognize()over the HTTP endpoint.WSS /v1/audio/speech/stream(one WS connection reused across utterances within a session), plus one-shotsynthesize()over the HTTP endpoint.Both talk to Hakim's public REST/WebSocket API directly — no separate Hakim SDK dependency, matching the pattern used by AssemblyAI/AWS/Azure and other plugins that don't wrap a vendor SDK.
Structure
Followed the conventions in
CONTRIBUTING.mdand the existing plugins (modeled closely onlivekit-plugins-assemblyaifor STT andlivekit-plugins-cartesiafor TTS):STT/SpeechStreamsubclassstt.STT/stt.SpeechStreamTTS/ChunkedStream/SynthesizeStreamsubclasstts.TTS/tts.ChunkedStream/tts.SynthesizeStreamAPIStatusError/APIConnectionError/APITimeoutErrorso the base class retry/metrics logic works as expectedpy.typedmarker,pyproject.tomlmatching the hatchling +livekit-agents>=1.6.5pattern used by other pluginspyproject.tomlTest plan
ruff check— cleanruff format --check— cleanmypy --strict(via the repo's ownpyproject.tomlconfig) — clean, 0 errorslivekit-agents>=1.6.5install in a clean venv: imported the plugin, instantiatedhakim.STT()/hakim.TTS(voice=...), called.stream()/.synthesize()on both, and closed everything cleanly with no errorsI understand this needs a CLA signature — happy to sign whatever the CLA Assistant bot requests.