Skip to content

Add Hakim plugin (STT + TTS)#6397

Open
malekZain-Hakim wants to merge 1 commit into
livekit:mainfrom
malekZain-Hakim:add-hakim-plugin
Open

Add Hakim plugin (STT + TTS)#6397
malekZain-Hakim wants to merge 1 commit into
livekit:mainfrom
malekZain-Hakim:add-hakim-plugin

Conversation

@malekZain-Hakim

Copy link
Copy Markdown

Summary

Adds livekit-plugins-hakim: STT and TTS support for Hakim, an Arabic-first realtime speech platform (TTS, STT, voice cloning).

  • STT: streaming transcription over WSS /v1/audio/transcriptions/stream (interim + final transcripts, word/segment timestamps, diarization), plus a batch recognize() over the HTTP endpoint.
  • TTS: persistent-socket streaming synthesis over WSS /v1/audio/speech/stream (one WS connection reused across utterances within a session), plus one-shot synthesize() 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.md and the existing plugins (modeled closely on livekit-plugins-assemblyai for STT and livekit-plugins-cartesia for TTS):

  • STT/SpeechStream subclass stt.STT/stt.SpeechStream
  • TTS/ChunkedStream/SynthesizeStream subclass tts.TTS/tts.ChunkedStream/tts.SynthesizeStream
  • Errors raised as APIStatusError / APIConnectionError / APITimeoutError so the base class retry/metrics logic works as expected
  • py.typed marker, pyproject.toml matching the hatchling + livekit-agents>=1.6.5 pattern used by other plugins
  • Registered as a workspace member in the root pyproject.toml

Test plan

  • ruff check — clean
  • ruff format --check — clean
  • mypy --strict (via the repo's own pyproject.toml config) — clean, 0 errors
  • Smoke-tested against a real livekit-agents>=1.6.5 install in a clean venv: imported the plugin, instantiated hakim.STT() / hakim.TTS(voice=...), called .stream() / .synthesize() on both, and closed everything cleanly with no errors

I understand this needs a CLA signature — happy to sign whatever the CLA Assistant bot requests.

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.
@malekZain-Hakim malekZain-Hakim requested a review from a team as a code owner July 13, 2026 07:11
@CLAassistant

CLAassistant commented Jul 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants