LiveKit Agents Baseten Plugin
Node.js/TypeScript plugin for LiveKit Agents with Baseten-hosted models (LLM, STT, TTS).
Installation
cd packages/livekit-plugin-baseten
pnpm install
pnpm build
Configuration
Create .env file:
BASETEN_API_KEY=your_api_key_here
BASETEN_MODEL_ID=your_llm_model_id
BASETEN_TTS_MODEL_ID=your_tts_model_id
BASETEN_STT_MODEL_ID=your_stt_model_id
Usage
LLM
import { LLM } from 'livekit-plugin-baseten'
const llm = new LLM({
model: 'openai/gpt-4o-mini',
apiKey: process.env.BASETEN_API_KEY
})
STT
import { STT } from 'livekit-plugin-baseten'
const stt = new STT({
apiKey: process.env.BASETEN_API_KEY,
modelId: process.env.BASETEN_STT_MODEL_ID
})
const stream = stt.stream()
for await (const event of stream) {
}
TTS
import { TTS } from 'livekit-plugin-baseten'
const tts = new TTS({
apiKey: process.env.BASETEN_API_KEY,
modelEndpoint: 'your-model-endpoint-url'
})
const stream = tts.synthesize('Hello world')
for await (const frame of stream) {
}
Testing
pnpm test:llm-cli
pnpm test:tts-cli
pnpm test:stt-cli
See TESTING.md for details.
Development
pnpm build
pnpm dev
pnpm typecheck
pnpm lint