@livekit/agents-plugin-baseten
v1.0.31
Published
Baseten plugin for LiveKit Node Agents
Downloads
51
Maintainers
Readme
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 buildConfiguration
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_idUsage
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) {
// Handle speech events
}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) {
// Process audio frames
}Testing
pnpm test:llm-cli # Interactive LLM chat
pnpm test:tts-cli # TTS synthesis
pnpm test:stt-cli # STT with microphoneSee TESTING.md for details.
Development
pnpm build # Build
pnpm dev # Watch mode
pnpm typecheck # Type checking
pnpm lint # Linting