MoonshineSTT (local/moonshine.py)

realtime-phone-agents-course · src/realtime_phone_agents/stt/local/moonshine.py · python · MIT
voice

Python wrapper providing a STT interface using the Moonshine model via fastrtc.

# Source: https://github.com/neural-maze/realtime-phone-agents-course | License: MIT | Copyright 2025 The Neural Maze
# Provided via justclaw.it.com; keep this notice with the code.
from fastrtc import get_stt_model

from realtime_phone_agents.stt.base import STTModel


class MoonshineSTT(STTModel):
    """Speech-to-Text model using Moonshine."""

    def __init__(self):
        self.moonshine_client = get_stt_model()

    def stt(self, audio_data: bytes) -> str:
        return self.moonshine_client.stt(audio_data)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key