Skip to main content
The official Python SDK for Lokutor: text-to-speech, transcription and full-duplex voice agents over the same API as the JavaScript SDK, with the same class names.

What it covers

  • TTSClient: stream speech from text, play it locally or collect the PCM.
  • STTClient and SpeechToTextClient: transcribe a recorded clip, or a live microphone.
  • VoiceAgentClient: a conversation with an agent through your microphone and speakers, with tool calling.
  • Languages: speech in English, Spanish, Catalan, Galician, Basque, Portuguese, French, Italian and German; recognition in English, Spanish, Portuguese, French, Italian and German.
  • lokutor.audio_utils: PCM/float conversion, resampling (with anti-aliasing), streaming resampling and RMS helpers.

Installation

Python 3.8 or later.
That is enough to call the API: synthesize to bytes, transcribe files. To play or record audio on the local machine (play=True, start_conversation(), SpeechToTextClient.start()), add the audio extra. It needs the PortAudio library first:

Next