Baseten
BasetenLLMService streams chat completions from Baseten through its OpenAI-compatible API.
Overview
Baseten's Model APIs serve open-weights models (GLM, Kimi, DeepSeek, Nemotron, gpt-oss) over an OpenAI-compatible API, and dedicated deployments run your own model on your own GPUs.
BasetenLLMService: anOpenAILLMServicesubclass with Baseten's base URL and default model.
Upstream page
Pipecat's documentation for the same service.
Source
packages/baseten/src/llm.ts.
Baseten docs
Model APIs and deployments.
Installation
bun add @pipedog/basetenIt depends on @pipedog/openai, which is installed with it.
import { BasetenLLMService } from "@pipedog/baseten/llm";Prerequisites
- A Baseten account and an API key from the Baseten console.
- Pass the key as
apiKey. It is required, and the service never falls back toOPENAI_API_KEY. The examples read it fromBASETEN_API_KEY.
BasetenLLMService
Configuration
Prop
Type
The other options (organization, project, defaultHeaders, serviceTier,
retryOnTimeout, retryTimeoutSecs, function calling) are OpenAILLMService's. See
OpenAI.
| Base URL | https://inference.baseten.co/v1 |
| Default model | zai-org/GLM-5.3 |
| Models to try | zai-org/GLM-5.3. See the provider's catalog for the rest. |
Settings
Runtime-updatable settings, passed as settings: new BasetenLLMService.Settings({...})
(BasetenLLMSettings). They are OpenAI's settings, with these
defaults:
| Setting | Type | Default | Description |
|---|---|---|---|
model | string | "zai-org/GLM-5.3" | Model name. |
Every other setting keeps OpenAI's default. Unset sampling settings are left out of the request, so
the provider's own defaults apply. extra carries provider-specific request fields.
Usage
import { LLMUpdateSettingsFrame } from "@pipedog/core/frames/frames";
const llm = new BasetenLLMService({
apiKey: process.env.BASETEN_API_KEY ?? "",
settings: new BasetenLLMService.Settings({
model: "zai-org/GLM-5.3",
systemInstruction: "You are a helpful assistant in a voice conversation.",
temperature: 0.7,
}),
});A dedicated deployment: point baseUrl at its /sync/v1 URL and set model to the model it serves.
// Replace {model_id} with your deployment's ID.
const dedicated = new BasetenLLMService({
apiKey: process.env.BASETEN_API_KEY ?? "",
baseUrl: "https://model-{model_id}.api.baseten.co/environments/production/sync/v1",
settings: new BasetenLLMService.Settings({ model: "Qwen/Qwen2.5-3B-Instruct" }),
});Change settings mid-call with an LLMUpdateSettingsFrame. The next completion uses them:
// Queue it on the worker, or push it from a processor upstream of the service.
const update = new LLMUpdateSettingsFrame({
delta: new BasetenLLMService.Settings({ temperature: 0.2, maxTokens: 300 }),
});Notes
- Runs a completion for each
LLMContextFrame, between anLLMFullResponseStartFrameand anLLMFullResponseEndFrame, and streams the reply asLLMTextFrames, asOpenAILLMServicedoes. Function calls, token usage metrics andrunInferencework the same way. - "developer" messages are sent as "user" messages, since the API doesn't support that role (
supportsDeveloperRoleisfalse). - Baseten's message roles are system, user, assistant and tool, so "developer" messages are sent as "user" messages.
Runtime notes
| Runtime | Works | What it needs |
|---|---|---|
| Bun | ✅ yes | Nothing. |
| Node.js | ✅ yes | Nothing. |
| Deno | ✅ yes | Nothing. |
| Cloudflare Workers | ✅ yes | Nothing. |
Generated from pipecat.runtimes and pipecat.compat in packages/baseten/package.json: ✅ means the compat smoke test passes on that runtime.
- The client is the official
openaiJS SDK (through@pipedog/openai), which talks throughfetch. It works on Bun, Node, Deno and Cloudflare Workers. - The deprecated
modelconstructor option is not ported. Usesettings. - Tested against a local OpenAI-compatible mock server, not against Baseten itself.
pipedog is an unofficial community TypeScript port of Pipecat. It is not affiliated with or endorsed by Daily or the Pipecat project.
Portions adapted from the Pipecat documentation, Copyright (c) 2024–2025 Daily, BSD-2-Clause (see apps/docs/LICENSE-pipecat-docs).