Smallest AI
SmallestLLMService streams chat completions from Smallest AI through its OpenAI-compatible API.
Overview
Smallest AI serves Electron, its own LLM, through the Waves API's OpenAI-compatible chat completions endpoint.
SmallestLLMService: anOpenAILLMServicesubclass with Smallest AI's base URL and default model.
Upstream page
Pipecat's documentation for the same service.
Source
packages/smallest/src/llm.ts.
Smallest AI docs
Models and the Waves API.
Installation
bun add @pipedog/smallestIt depends on @pipedog/openai, which is installed with it.
import { SmallestLLMService } from "@pipedog/smallest/llm";Prerequisites
- A Smallest AI account and an API key from Smallest AI.
- Pass the key as
apiKey. It is required, and the service never falls back toOPENAI_API_KEY. The examples read it fromSMALLEST_API_KEY.
SmallestLLMService
Configuration
Prop
Type
The other options (organization, project, defaultHeaders, serviceTier,
retryOnTimeout, retryTimeoutSecs, function calling) are OpenAILLMService's. See
OpenAI.
| Base URL | https://api.smallest.ai/waves/v1 |
| Default model | electron |
| Models to try | electron. See the provider's catalog for the rest. |
Settings
Runtime-updatable settings, passed as settings: new SmallestLLMService.Settings({...})
(SmallestLLMSettings). They are OpenAI's settings, with these
defaults:
| Setting | Type | Default | Description |
|---|---|---|---|
model | string | "electron" | 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";
import { SmallestLLMService } from "@pipedog/smallest/llm";
const llm = new SmallestLLMService({
apiKey: process.env.SMALLEST_API_KEY ?? "",
settings: new SmallestLLMService.Settings({
model: "electron",
systemInstruction: "You are a helpful assistant in a voice conversation.",
temperature: 0.7,
}),
});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 SmallestLLMService.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). - Every request carries
X-Source: pipecatandX-Pipecat-Versionheaders (the version is pipedog's), merged over anydefaultHeadersyou pass. - The same package has Smallest AI'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/smallest/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 Smallest 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).