Together AI
TogetherLLMService streams chat completions from Together AI through its OpenAI-compatible API.
Overview
Together AI serves open models through an OpenAI-compatible API.
TogetherLLMService: anOpenAILLMServicesubclass with Together AI's base URL and default model.
Upstream page
Pipecat's documentation for the same service.
Source
packages/together/src/llm.ts.
Together AI docs
The chat completions API reference.
Installation
bun add @pipedog/togetherIt depends on @pipedog/openai, which is installed with it.
import { TogetherLLMService } from "@pipedog/together/llm";Prerequisites
- A Together AI account and an API key from Together AI.
- Pass the key as
apiKey. It is required, and the service never falls back toOPENAI_API_KEY. The examples read it fromTOGETHER_API_KEY.
TogetherLLMService
Configuration
Prop
Type
The other options (organization, project, defaultHeaders, serviceTier,
retryOnTimeout, retryTimeoutSecs, function calling) are OpenAILLMService's. See
OpenAI.
| Base URL | https://api.together.xyz/v1 |
| Default model | zai-org/GLM-5.2 |
| Models to try | zai-org/GLM-5.2. See the provider's catalog for the rest. |
Settings
Runtime-updatable settings, passed as settings: new TogetherLLMService.Settings({...})
(TogetherLLMSettings). They are OpenAI's settings, with these
defaults:
| Setting | Type | Default | Description |
|---|---|---|---|
model | string | "zai-org/GLM-5.2" | Model name. |
reasoning | Record<string, unknown> | null | null | Together's reasoning toggle, e.g. { enabled: false }, sent as reasoning in the request body. null leaves it to the model. |
reasoningEffort | "low" | "medium" | "high" | "max" | string | null | null | How much the model reasons, sent as reasoning_effort when set, unless extra already has one. Values vary by model ("max" on zai-org/GLM-5.3). It reaches models that ignore reasoning, such as GLM-5.3. null leaves Together's per-model default. |
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";
import { TogetherLLMService } from "@pipedog/together/llm";
const llm = new TogetherLLMService({
apiKey: process.env.TOGETHER_API_KEY ?? "",
settings: new TogetherLLMService.Settings({
model: "zai-org/GLM-5.2",
systemInstruction: "You are a helpful assistant in a voice conversation.",
temperature: 0.7,
}),
});Turn off a reasoning model's thinking pass, which otherwise delays the first spoken token:
const noThinking = new TogetherLLMService({
apiKey: process.env.TOGETHER_API_KEY ?? "",
settings: new TogetherLLMService.Settings({ reasoning: { enabled: false } }),
});Models that ignore the toggle, such as zai-org/GLM-5.3, still take a reasoning effort:
const lowEffort = new TogetherLLMService({
apiKey: process.env.TOGETHER_API_KEY ?? "",
settings: new TogetherLLMService.Settings({
model: "zai-org/GLM-5.3",
reasoningEffort: "low",
}),
});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 TogetherLLMService.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). - The same package has Together's speech-to-text and text-to-speech services.
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/together/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 Together AI 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).