llm

Smallest AI LLM service implementation using OpenAI-compatible interface.

This module provides an integration with Electron, Smallest AI’s LLM, served through the Waves API’s OpenAI-compatible chat completions endpoint.

class pipecat.services.smallest.llm.SmallestLLMSettings(model: str | None | NotGiven = <factory>, extra: dict[str, Any]=<factory>, system_instruction: str | None | NotGiven = <factory>, temperature: float | None | NotGiven | NotGiven = <factory>, max_tokens: int | None | NotGiven | NotGiven = <factory>, top_p: float | None | NotGiven | NotGiven = <factory>, top_k: int | None | NotGiven = <factory>, frequency_penalty: float | None | NotGiven | NotGiven = <factory>, presence_penalty: float | None | NotGiven | NotGiven = <factory>, seed: int | None | NotGiven | NotGiven = <factory>, filter_incomplete_user_turns: bool | None | NotGiven = <factory>, user_turn_completion_config: UserTurnCompletionConfig | None | NotGiven = <factory>, use_provider_thinking_default: bool | NotGiven = <factory>, max_completion_tokens: int | None | NotGiven | NotGiven = <factory>)[source]

Bases: OpenAILLMSettings

Settings for SmallestLLMService.

class pipecat.services.smallest.llm.SmallestLLMService(*, api_key: str, base_url: str = 'https://api.smallest.ai/waves/v1', settings: SmallestLLMSettings | None = None, default_headers: Mapping[str, str] | None = None, **kwargs)[source]

Bases: OpenAILLMService

A service for interacting with Smallest AI’s Electron model using the OpenAI-compatible interface.

This service extends OpenAILLMService to connect to Smallest AI’s Waves API endpoint while maintaining full compatibility with OpenAI’s interface and functionality.

supports_developer_role: bool = False

Whether this service’s API supports the “developer” message role.

OpenAI’s native API supports it, but some OpenAI-compatible services (e.g. Cerebras) do not. Subclasses that don’t support it should set this to False, which causes the adapter to convert “developer” messages to “user” messages before sending them to the API.

Settings

alias of SmallestLLMSettings

__init__(*, api_key: str, base_url: str = 'https://api.smallest.ai/waves/v1', settings: SmallestLLMSettings | None = None, default_headers: Mapping[str, str] | None = None, **kwargs)[source]

Initialize Smallest AI LLM service.

Parameters:
  • api_key – The API key for accessing Smallest AI’s API.

  • base_url – The base URL for Smallest AI’s API. Defaults to “https://api.smallest.ai/waves/v1”.

  • settings – Runtime-updatable settings. Defaults to Electron, Smallest AI’s LLM, via settings=SmallestLLMService.Settings(model="electron").

  • default_headers – Additional HTTP headers to include in requests.

  • **kwargs – Additional keyword arguments passed to OpenAILLMService.

create_client(api_key=None, base_url=None, default_headers=None, **kwargs)[source]

Create OpenAI-compatible client for Smallest AI’s API endpoint.

Parameters:
  • api_key – The API key to use for the client. If None, uses instance api_key.

  • base_url – The base URL for the API. If None, uses instance base_url.

  • default_headers – Additional HTTP headers. Smallest’s own source and version identification headers are always included.

  • **kwargs – Additional keyword arguments passed to the parent create_client method.

Returns:

An OpenAI-compatible client configured for Smallest AI’s API.