Skip to main content

A modular voice agent with swappable STT/TTS/LLM backends

Project description

fastrtc-voice-agent

A modular voice agent built on FastRTC

Installation

pip install fastrtc-voice-agent

Please install your desired STT and LLM with (for example) :

pip install "fastrtc-voice-agent[ollama]"

or for all optional dependancies :

pip install "fastrtc-voice-agent[all]"

CLI Usage Example

For default config :

fastrtc-voice-agent --run

Please refere to the help for custom config :

fastrtc-voice-agent --help

Python Usage Example

from fastrtc import ReplyOnPause, Stream
from voice_agent import create_agent, AgentConfig, STTConfig, TTSConfig, LLMConfig

config = AgentConfig(
    system_prompt="You are a helpful voice assistant.",
    stt=STTConfig(backend="faster_whisper", model_size="small"),
    tts=TTSConfig(backend="edge", voice="en-US-AvaMultilingualNeural"),
    llm=LLMConfig(backend="ollama", model="llama3.2:3b"),
)

agent = create_agent(config)

stream = Stream(
    ReplyOnPause(agent.create_fastrtc_handler()),
    modality="audio",
    mode="send-receive",
)

stream.ui.launch()

Note

To use Anthropic API (may be OpenAI or else later) please copy .env.example as .env file and fill it with your API KEY and the desired model

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastrtc_voice_agent-0.1.3.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastrtc_voice_agent-0.1.3-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file fastrtc_voice_agent-0.1.3.tar.gz.

File metadata

  • Download URL: fastrtc_voice_agent-0.1.3.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for fastrtc_voice_agent-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5c163aac20fd24147f60e2ef516143428d56f289cb4d31da587ab52312a5ef9c
MD5 b78ca09f1f0e7c46c0f448df00d6aaa5
BLAKE2b-256 bee5ecf15acf8f4efe862b30cfcf4622b3b6980020e86629f4e85b8c6464ceb1

See more details on using hashes here.

File details

Details for the file fastrtc_voice_agent-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for fastrtc_voice_agent-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 574efcd1873024c18b0942b8049cc404d19c0abd9a05e4c139569562df8409a3
MD5 e4074bde93d2a08a01aa6f8f4e01ca77
BLAKE2b-256 00638ce64f6f89a282e0a346efb7f7856fce0d4e1147fa410ee28390386a5a71

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page