How do i implement my own personally deployed TTS ...
# ask-ai
m
How do i implement my own personally deployed TTS and STT model?
t
Thanks for reaching out, Anigilaje. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you're interested in implementing your own personally deployed TTS (Text-to-Speech) and STT (Speech-to-Text) models in LiveKit! To help you get started, you can set up custom endpoints for these services. Here’s a friendly overview to guide you: • STT Configuration: You’ll want to use WebSocket-based endpoints for your STT model. Be sure to configure important parameters like
base_url
,
api_key
,
encoding
, and
sample_rate
. Your endpoint should be ready to handle specific message types for session creation, audio input, and session finalization. • TTS Configuration: For your TTS model, OpenAI-compatible endpoints work well. Set parameters such as
base_url
,
model
, and
response_format
. If you'd like, you can also create a custom TTS class to implement your own unique TTS logic. • Authentication: Don’t forget to set up your API keys and secrets properly to keep everything secure. • Audio Format: It’s important to specify the correct encoding (for example,
pcm_s16le
) and sample rate (like 16000 Hz) to ensure smooth audio processing. If you’d like, I’m here to help with more detailed guidance or even code examples tailored to your setup—just let me know! Sources: Baseten STT plugin guide | LiveKit Docs | Pipeline nodes and hooks | LiveKit Docs | Text-to-speech (TTS) models | LiveKit Docs | agents/src/inference/stt.ts | livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/models.py
m
i nned code examples . my tts and stt model is areayd depoy heere : https://inference.net/transcribe this is my agent code : import logging import json import asyncio from dotenv import load_dotenv import os from livekit import rtc from livekit.agents import ( Agent, AgentSession, JobContext, JobProcess, RoomInputOptions, RoomOutputOptions, WorkerOptions, cli, metrics, get_job_context ) from livekit.agents.llm import ChatContext, ChatMessage from livekit.agents.voice import MetricsCollectedEvent from livekit.plugins import openai, silero from livekit import api from livekit.plugins import openai from pymongo import MongoClient from pymongo.server_api import ServerApi from datetime import datetime from openai import AsyncOpenAI logger = logging.getLogger("waec_exam_agent") logger.setLevel(logging.INFO) import aiohttp load_dotenv() # MongoDB Memory Setup def get_mongodb_client(): connection_string = os.getenv("MONGO_URI") if not connection_string: logger.warning("MONGO_URI is not set - memory features will be disabled") return None try: client = MongoClient(connection_string, server_api=ServerApi('1')) client.admin.command('ping') logger.info("Connected to MongoDB Atlas!") return client except Exception as e: logger.error(f"Failed to connect to MongoDB: {e}") return None # Initialize MongoDB client mongo_client = get_mongodb_client() if mongo_client is not None: db = mongo_client.get_database('Voice_agent_db') conversations_collection = db.get_collection("learning_progress") else: conversations_collection = None # Initialize OpenAI client for summarization openai_async_client = AsyncOpenAI(api_key=os.getenv("OPENAI_API_KEY")) class WAECExamAgent(Agent): def __init__(self, user_id: str = None, chat_ctx: ChatContext = None) -> None: # Build instructions base_instructions = """You are an exam tutor helping students understand answers and imporve their learnng with memory of past interactions. Your mode of interaction with the student is voice. """ # Pass the chat_ctx to the parent Agent class super().__init__(instructions=base_instructions, chat_ctx=chat_ctx or ChatContext.empty()) self._session = None self.user_id = user_id or "default_student" logger.info(f"Initialized WAEC agent for user: {self.user_id}") @property def session(self): return self._session @session.setter def session(self, value): self._session = value async def summarize_conversation(self, chat_ctx: ChatContext) -> str: """Generate a summary of the conversation using OpenAI""" try: # Extract conversation content conversation_lines = [] for item in chat_ctx.items: if isinstance(item, ChatMessage): if item.role == "user": content = item.text_content or '' if content.strip(): conversation_lines.append(f"Student: {content}") elif item.role == "assistant": content = item.text_content or '' if content.strip(): conversation_lines.append(f"Tutor: {content}") if not conversation_lines: return "" conversation_text = "\n".join(conversation_lines) # Create summary using OpenAI response = await openai_async_client.chat.completions.create( model="gpt-4.1-mini", messages=[ { "role": "system", "content": """You are a helpful assistant that summarizes educational conversations between an Exam tutor and students. Create a concise summary that captures: 1. Topics discussed and questions asked """ }, { "role": "user", "content": f"Please summarize this tutoring conversation:\n\n{conversation_text}" } ], max_tokens=500, temperature=0.1 ) summary = response.choices[0].message.content.strip() logger.info(f"Generated conversation summary for user {self.user_id}") return summary except Exception as e: logger.error(f"Error generating conversation summary: {str(e)}") return f"Conversation summary unavailable due to error: {str(e)}" async def load_chat_history(self) -> ChatContext: """Load previous conversation summary and convert to context""" if conversations_collection is None: logger.warning("MongoDB not available - cannot load chat history") return ChatContext.empty() try: logger.info(f"Loading conversation summary for student: {self.user_id}") # Get the conversation document for this user conversation = conversations_collection.find_one({"user_id": self.user_id}) if conversation and "conversation_summary" in conversation: logger.info(f"Found previous conversation summary for user {self.user_id}") # Create ChatContext with the summary as system context chat_ctx = ChatContext.empty() # Add the summary as a system message to provide context summary = conversation['conversation_summary'] if summary.strip(): # Add system context about previous learning context_message = f"Previous learning session summary: {summary}\n\nUse this context to provide personalized feedback and track the student's progress." chat_ctx.add_message(role="system", content=context_message) logger.info(f"Loaded conversation summary for user {self.user_id}") return chat_ctx else: logger.info(f"No previous conversation found for student {self.user_id}") return ChatContext.empty() except Exception as e: logger.error(f"Error loading chat history for student {self.user_id}: {str(e)}") return ChatContext.empty() async def save_chat_history(self, chat_ctx: ChatContext): """Generate summary of current conversation and save to MongoDB""" if conversations_collection is None: logger.warning("MongoDB not available - cannot save chat history") return try: # Check if there's meaningful conversation content message_count = len([item for item in chat_ctx.items if isinstance(item, ChatMessage) and item.text_content and item.text_content.strip()]) if message_count < 2: # Need at least some back-and-forth logger.info("Not enough conversation content to summarize") return # Generate summary of the current conversation current_summary = await self.summarize_conversation(chat_ctx) if not current_summary.strip(): logger.warning("Generated summary is empty") return # Get existing summary existing_doc = conversations_collection.find_one({"user_id": self.user_id}) if existing_doc and "conversation_summary" in existing_doc and existing_doc["conversation_summary"].strip(): # Combine existing summary with new summary existing_summary = existing_doc["conversation_summary"] # Create a combined summary using LLM combined_summary = await self.combine_summaries(existing_summary, current_summary) else: # No existing summary, use current summary combined_summary = current_summary # Update the conversation document conversations_collection.update_one( {"user_id": self.user_id}, { "$set": { "user_id": self.user_id, "conversation_summary": combined_summary, "updated_at": datetime.utcnow(), "session_count": existing_doc.get("session_count", 0) + 1 if existing_doc else 1 }, "$setOnInsert": { "created_at": datetime.utcnow() } }, upsert=True ) logger.info(f"Saved conversation summary for user {self.user_id}") except Exception as e: logger.error(f"Error saving chat history for user {self.user_id}: {str(e)}") async def combine_summaries(self, existing_summary: str, new_summary: str) -> str: """Combine existing and new summaries into a comprehensive one""" try: response = await openai_async_client.chat.completions.create( model="gpt-4.1-mini", messages=[ { "role": "system", "content": """""" }, { "role": "user", "content": f"""Please combine these two conversation summaries into one comprehensive summary: PREVIOUS SESSIONS: {existing_summary} LATEST SESSION: {new_summary} Create a unified summary that shows the student's learning journey and progress.""" } ], max_tokens=600, temperature=0.1 ) combined = response.choices[0].message.content.strip() logger.info("Successfully combined conversation summaries") return combined except Exception as e: logger.error(f"Error combining summaries: {str(e)}") # Fallback: simple concatenation return f"{existing_summary}\n\nLatest session: {new_summary}" def prewarm(proc: JobProcess): proc.userdata["vad"] = silero.VAD.load() async def entrypoint(ctx: JobContext): ctx.log_context_fields = { "room": ctx.room.name, "user_id": "waec_student", } await ctx.connect() logger.info("Connected to room") participant = await ctx.wait_for_participant() user_id = participant.identity logger.info(f"Participant joined with identity: {user_id}") # Load chat history FIRST, before creating the agent temp_agent = WAECExamAgent(user_id=user_id) chat_ctx = await temp_agent.load_chat_history() # Create the actual agent with the loaded chat history agent = WAECExamAgent(user_id=user_id, chat_ctx=chat_ctx) logger.info(f"Created agent with loaded conversation context") session = AgentSession( vad=ctx.proc.userdata["vad"], llm=openai.LLM(model="gpt-4.1-mini"), stt= openai.STT(model="whisper-1"), tts=openai.TTS(), # stt=deepgram.STT(model="nova-2", language="en-US"), # tts=deepgram.TTS(), allow_interruptions=True ) logger.info("Agent session components initialized") # Set the session reference agent.session = session arm))
t
I'm glad you're looking to integrate your custom TTS and STT models deployed at
<BASE_API_URL>
! You can easily configure LiveKit to use your endpoint. Here are some code examples crafted just for your setup to help you get started: Custom STT Integration If your endpoint supports WebSocket connections, here’s a simple way to set it up:
Copy code
from livekit.plugins import openai

stt = openai.STT(
    model="your-custom-model",
    base_url=f"wss://{os.getenv('BASE_API_URL')}/transcribe",  # WebSocket URL
    api_key="your-api-key",  # Replace with your key if required
    encoding="pcm_s16le",  # Make sure this matches your endpoint's expected format
    sample_rate=16000,       # Standard sample rate for audio
    extra_kwargs={
        "interim_results": True,  # Enable interim transcription results
        "punctuate": True         # Add punctuation if supported
    }
)
Custom TTS Integration If your TTS endpoint is OpenAI-compatible, you can configure it like this:
Copy code
from livekit.plugins import openai

tts = openai.TTS(
    model="your-custom-model",
    base_url=f"https://{os.getenv('BASE_API_URL')}/transcribe",  # HTTP endpoint for TTS
    response_format="wav",  # Ensure this matches your endpoint's output format
    api_key="your-api-key"   # Replace with your key if required
)
Agent Session Example And here’s a friendly example showing how to bring these configurations into your agent session:
Copy code
from livekit.agents import AgentSession

session = AgentSession(
    stt=stt,  # Use the custom STT configuration
    tts=tts,  # Use the custom TTS configuration
    llm=openai.LLM(model="gpt-4.1-mini"),
    allow_interruptions=True
)
Just a quick reminder to double-check that your endpoint supports the required audio format (
pcm_s16le
, 16kHz) and any authentication needed. If you have any questions or want me to walk you through any part, please feel free to ask—I’m here to help! Sources: Baseten STT plugin guide | LiveKit Docs | Models | LiveKit Docs | livekit-plugins/livekit-plugins-cartesia/livekit/plugins/cartesia/stt.py
m
How do I make them open AI-compatible? this is how i m tesing my stt : import os import tempfile import requests from typing import Optional from dotenv import load_dotenv load_dotenv() class SpeechToTextError(Exception): """Custom exception for speech-to-text errors.""" pass class SpeechToText: """A class to handle speech-to-text conversion using deployed Whisper model.""" # Required environment variables REQUIRED_ENV_VARS = [] def __init__(self): """Initialize the SpeechToText class and validate environment variables.""" self._validate_env_vars() def _validate_env_vars(self) -> None: """Validate that all required environment variables are set.""" missing_vars = [var for var in self.REQUIRED_ENV_VARS if not os.getenv(var)] if missing_vars: raise ValueError(f"Missing required environment variables: {', '.join(missing_vars)}") async def transcribe(self, audio_data: bytes) -> str: """Convert speech to text using deployed Whisper model. Args: audio_data: Binary audio data Returns: str: Transcribed text Raises: ValueError: If the audio file is empty or invalid RuntimeError: If the transcription fails """ if not audio_data: raise ValueError("Audio data cannot be empty") url = "https://inference.linguacenter.net/transcribe" try: # Create a temporary file with .wav extension with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as temp_file: temp_file.write(audio_data) temp_file_path = temp_file.name try: # Open the temporary file for the API request with open(temp_file_path, "rb") as audio_file: files = {"audio": audio_file} data = {"language": "english"} # Optional response = requests.post(url, files=files, data=data) if response.status_code == 200: result = response.json() if "text" not in result: raise SpeechToTextError("Transcription result does not contain 'text' key") transcription = result["text"] else: raise SpeechToTextError(f"Transcription request failed: {response.status_code} - {response.text}") if not transcription: raise SpeechToTextError("Transcription result is empty") return transcription finally: # Clean up the temporary file os.unlink(temp_file_path) except Exception as e: raise SpeechToTextError(f"Speech-to-text conversion failed: {str(e)}") from e will this work wth he oepan ai plugin you usd above ?
t
To help you make your custom STT endpoint OpenAI-compatible for LiveKit integration, let's walk through the key steps together. I want to make sure this process feels clear and manageable for you! 1. Endpoint Requirements • HTTP POST Endpoint: Your endpoint should be ready to accept POST requests at a path like
/audio/transcriptions
. • Multipart Form Data: The request will include: ◦ `file`: The audio file (WAV format). ◦ `model`: The model name (for example,
whisper-1
). ◦ `language`: (Optional) ISO-639-1 language code. ◦ `response_format`: It should support
json
. • Response Format: Your endpoint should return JSON like this:
{ "text": "This is a transcription." }
2. Example Integration with LiveKit Once your endpoint is set up to be OpenAI-compatible, you can easily configure it in LiveKit like this:
Copy code
from livekit.plugins import openai

stt = openai.STT(
    base_url="https://your-custom-stt-service.com/v1",  # Replace with your endpoint
    api_key="your-api-key",  # Optional, if your endpoint requires authentication
    model="whisper-1",
    language="en"
)
3. Key Considerations • Audio Format: Be sure your endpoint accepts 16-bit PCM WAV audio at 16kHz or 24kHz. • Authentication: If your endpoint needs it, validate the
Authorization: Bearer <api_key>
header properly. • Timeouts: Try to ensure your endpoint responds within 30 seconds to avoid any timeouts. 4. Testing Feel free to use your current test script to check how the endpoint behaves. Just make sure it returns the expected JSON response with a
text
field. If you have any questions or run into any issues while implementing or debugging, please don’t hesitate to reach out — I’m here to help you every step of the way! Sources: examples/frontdesk/frontdesk_agent.py | examples/src/anam_realtime_agent.ts | OpenAI STT plugin guide | LiveKit Docs
m
this is how my tts was deployed on aws : import os import torch import numpy as np from typing import Optional from pydantic import BaseModel, Field from snac import SNAC from contextlib import asynccontextmanager from fastapi import FastAPI from transformers import AutoTokenizer, AutoModelForCausalLM from peft import PeftModel from dotenv import load_dotenv import time load_dotenv() repo_id = os.getenv("MODEL_REPO_ID") HF_TOKEN = os.getenv("HF_TOKEN") BASE_MODEL = os.getenv("BASE_MODEL") SAMPLE_RATE = 24000 START_OF_HUMAN = 128259 END_OF_TEXT = 128009 END_OF_HUMAN = 128260 START_OF_AI = 128006 START_OF_SPEECH = 128257 END_OF_SPEECH = 128258 SNAC_BASE_OFFSET = 128266 model = None tokenizer = None snac_model = None device = None @asynccontextmanager async def lifespan(app: FastAPI): global model, tokenizer, snac_model, device print("Initializing device...") device = "cuda" if torch.cuda.is_available() else "cpu" print(f"Using device: {device}") # Set longer timeout for downloads os.environ['HF_HUB_DOWNLOAD_TIMEOUT'] = '600' # 10 minutes try: print("Loading tokenizer...") start_time = time.time() tokenizer = AutoTokenizer.from_pretrained( BASE_MODEL, token=HF_TOKEN, resume_download=True, local_files_only=False ) print(f"Tokenizer loaded in {time.time() - start_time:.2f}s") print("Loading base model...") start_time = time.time() base_model = AutoModelForCausalLM.from_pretrained( BASE_MODEL, dtype=torch.float16 if device == "cuda" else torch.float32, token=HF_TOKEN, device_map="auto", resume_download=True, local_files_only=False ) print(f"Base model loaded in {time.time() - start_time:.2f}s") print("Loading adapter...") start_time = time.time() model = PeftModel.from_pretrained( base_model, repo_id, token=HF_TOKEN, resume_download=True ) model.eval() print(f"Adapter loaded in {time.time() - start_time:.2f}s") print("Loading SNAC model...") start_time = time.time() snac_model = SNAC.from_pretrained("hubertsiuzdak/snac_24khz").to(device) snac_model.eval() print(f"SNAC model loaded in {time.time() - start_time:.2f}s") print("All models loaded successfully!") except Exception as e: print(f"Error during model loading: {str(e)}") raise yield print("Shutting down...") del model, tokenizer, snac_model if device == "cuda": torch.cuda.empty_cache() class TTSRequest(BaseModel): text: str = Field(..., description="Text to synthesize", min_length=1, max_length=5000) max_tokens: Optional[int] = Field(12000, description="Maximum tokens to generate", ge=512, le=16384) temperature: Optional[float] = Field(0.6, description="Sampling temperature", ge=0.1, le=1.0) top_p: Optional[float] = Field(0.95, description="Top-p sampling", ge=0.1, le=1.0) def decode_snac_codes(codes_list: list, snac_model: SNAC, device: str) -> np.ndarray: if len(codes_list) == 0: return np.array([]) codes_list = [c - SNAC_BASE_OFFSET for c in codes_list] new_length = (len(codes_list) // 7) * 7 if new_length == 0: return np.array([]) codes_list = codes_list[:new_length] layer_0, layer_1, layer_2 = [], [], [] try: for i in range(len(codes_list) // 7): layer_0.append(codes_list[7*i]) layer_1.extend([ codes_list[7*i+1] - 4096, codes_list[7*i+2] - 8192 ]) layer_2.extend([ codes_list[7*i+3] - 12288, codes_list[7*i+4] - 16384, codes_list[7*i+5] - 20480, codes_list[7*i+6] - 24576 ]) codes = [ torch.tensor(layer_0).unsqueeze(0).to(device), torch.tensor(layer_1).unsqueeze(0).to(device), torch.tensor(layer_2).unsqueeze(0).to(device) ] with torch.no_grad(): audio_hat = snac_model.decode(codes) audio = audio_hat.detach().squeeze().cpu().numpy() return audio except Exception: return np.array([]) def generate_speech( text: str, speaker_id: str, max_tokens: int = 12000, temperature: float = 0.6, top_p: float = 0.95 ) -> np.ndarray: global model, tokenizer, snac_model, device prompt_text = f"{speaker_id}: {text}" text_ids = tokenizer.encode(prompt_text, add_special_tokens=False) input_ids = [ START_OF_HUMAN, *text_ids, END_OF_TEXT, END_OF_HUMAN, START_OF_AI, START_OF_SPEECH ] input_tensor = torch.tensor([input_ids]).to(device) with torch.no_grad(): outputs = model.generate( input_tensor, max_new_tokens=max_tokens, temperature=temperature, top_p=top_p, do_sample=True, pad_token_id=tokenizer.pad_token_id, eos_token_id=END_OF_SPEECH ) generated_ids = outputs[0].cpu().tolist() start_idx = len(input_ids) if END_OF_SPEECH in generated_ids[start_idx] end_idx = generated_ids.index(END_OF_SPEECH, start_idx) audio_codes = generated_ids[start_idx:end_idx] else: audio_codes = generated_ids[start_idx:] if not audio_codes: raise ValueError("No audio codes generated") audio = decode_snac_codes(audio_codes, snac_model, device) if len(audio) == 0: raise ValueError("Audio decoding failed") return audio def get_device(): return device can this work with opean ai compatible endpoint ?
t
To help you make your custom TTS endpoint OpenAI-compatible for LiveKit integration, let's walk through the key steps together. This way, you can smoothly adapt your deployment and get everything working just right: 1. Endpoint Requirements • HTTP POST Endpoint: Your endpoint should be set up to accept POST requests at a path like
/v1/audio/speech
. • Request Format: The request needs to include JSON parameters: ◦ `input`: The text you'd like to synthesize. ◦ `model`: The TTS model identifier you're using. ◦ `voice`: The voice profile identifier. ◦ `response_format`: The audio format you want back (like
wav
or
mp3
). ◦ `speed`: (Optional) The speech rate, for example 1.0. ◦ `instructions`: (Optional) Any voice style instructions you'd like to apply. • Response Format: Your endpoint should return raw audio data in the requested format, along with the appropriate headers:
Content-Type: audio/[format]
2. Example Integration with LiveKit Once your endpoint is ready and OpenAI-compatible, you can set it up in LiveKit like this:
Copy code
from livekit.plugins import openai

tts = openai.TTS(
    model="your-custom-model",
    voice="your-voice-id",
    api_key="your-api-key-or-placeholder",  # Use "not-needed" if no auth required
    base_url="http://your-endpoint:port/v1",  # Replace with your endpoint
    response_format="wav"  # or your preferred format
)
3. Key Considerations • Audio Format: Make sure your endpoint outputs audio at 24kHz mono (or a format that LiveKit can decode). • Authentication: If your endpoint requires it, validate the
Authorization: Bearer <api_key>
header. • Error Handling: It's important to return appropriate HTTP status codes, like 200 for success and 400 for bad requests. 4. Testing Before going live, test your deployment to confirm the endpoint behaves as expected and returns the audio in the requested format. If you have any questions or need a hand with implementation or debugging, please don’t hesitate to reach out. I’m here to help! Sources: livekit-plugins/livekit-plugins-baseten/livekit/plugins/baseten/tts.py
m
i already shredcyou he code i sed to deploy, check if that wil work , or how do i use tht for my livekit agnct. i alreadys shared the code i use to deploy.
t
Thank you for sharing your TTS deployment code! You can definitely adapt it to work smoothly with LiveKit as an OpenAI-compatible endpoint. Let me walk you through how to do that: 1. Endpoint Requirements • HTTP POST Endpoint: Your deployment should expose a POST endpoint at a path like
/v1/audio/speech
. • Request Format: The endpoint needs to accept JSON parameters: ◦ `input`: The text you'd like to synthesize. ◦ `model`: The identifier for your TTS model. ◦ `voice`: The voice profile you'd like to use. ◦ `response_format`: The audio format you want back (for example,
wav
or
mp3
). ◦ `speed`: (Optional) Controls the speech rate, like 1.0 for normal speed. ◦ `instructions`: (Optional) Any voice style instructions you want to add. • Response Format: Your endpoint should return the raw audio data in the requested format, with the right headers, like:
Content-Type: audio/[format]
2. Adapting Your Deployment It’s great that your deployment already initializes the model and synthesizes speech! To align it with OpenAI compatibility, here’s what you can do: • Create an HTTP POST endpoint using FastAPI at
/v1/audio/speech
. • Parse the incoming JSON request to extract parameters such as
input
,
model
, and
voice
. • Use your existing
generate_speech
function to synthesize the audio based on the text input. • Return the audio data as a binary response, making sure to set the
Content-Type
header properly (e.g.,
audio/wav
). 3. Example FastAPI Endpoint
Copy code
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
from fastapi.responses import Response

app = FastAPI()

class TTSRequest(BaseModel):
    input: str
    model: str
    voice: str
    response_format: str = "wav"
    speed: float = 1.0

@app.post("/v1/audio/speech")
async def synthesize_speech(request: TTSRequest):
    try:
        audio = generate_speech(
            text=request.input,
            speaker_id=request.voice,
            max_tokens=12000,
            temperature=0.6,
            top_p=0.95
        )
        return Response(content=audio.tobytes(), media_type=f"audio/{request.response_format}")
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e))
4. LiveKit Integration Once your endpoint is ready and OpenAI-compatible, you can configure it in LiveKit like this:
Copy code
from livekit.plugins import openai

tts = openai.TTS(
    model="your-model",
    voice="your-voice",
    base_url=f"https://{os.getenv('BASE_API_URL')}/v1",  # Replace with your endpoint
    response_format="wav"
)
If you have any questions or run into any bumps along the way, please don’t hesitate to reach out. I’m here to help you get this working perfectly! Sources: livekit-plugins/livekit-plugins-upliftai/livekit/plugins/upliftai/tts.py | chain-of-thought-tts/README.mdoc | plugins/openai/src/tts.ts | OpenAI TTS plugin guide | LiveKit Docs