> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Smallest AI LLM

> SmallestLLMService accesses Smallest AI's Electron model for chat completion via an OpenAI-compatible interface with streaming.

## Overview

`SmallestLLMService` provides access to Smallest AI's Electron model through the OpenAI-compatible chat completions endpoint of the Waves API. It inherits from `OpenAILLMService` and supports streaming responses, function calling, and context management.

> **[Smallest AI LLM API Reference](https://reference-server.pipecat.ai/en/latest/api/pipecat.services.smallest.llm.html)**
>
> Pipecat's API methods for Smallest AI LLM integration

> **[Example Implementation](https://github.com/pipecat-ai/pipecat/blob/main/examples/function-calling/function-calling-smallest.py)**
>
> Complete example with function calling

> **[Smallest AI Documentation](https://docs.smallest.ai/)**
>
> Official Smallest AI documentation

## Installation

```bash theme={null}
uv add "pipecat-ai[smallest]"
```

## Prerequisites

1. **Smallest AI Account**: Sign up at [Smallest AI](https://www.smallest.ai/)
2. **API Key**: Generate an API key from your account dashboard

### Required Environment Variables

* `SMALLEST_API_KEY`: Your Smallest AI API key for authentication

## Configuration

**api\_key** `str` *required*

Smallest AI API key for authentication.

**base\_url** `str` (default: [https://api.smallest.ai/waves/v1](https://api.smallest.ai/waves/v1))

Base URL for the Smallest AI API endpoint.

**settings** `SmallestLLMService.Settings` (default: None)

Runtime-configurable settings. See [Settings](#settings) below.

**default\_headers** `Mapping[str, str] | None` (default: None)

Additional HTTP headers to include in requests.

### Settings

Runtime-configurable settings passed via the `settings` constructor argument using `SmallestLLMService.Settings(...)`. These can be updated mid-conversation with `LLMUpdateSettingsFrame`. See [Service Settings](https://docs.pipecat.ai/pipecat/fundamentals/service-settings.md) for details.

This service uses the same settings as `OpenAILLMService`. See [OpenAI LLM Settings](https://docs.pipecat.ai/api-reference/server/services/llm/openai.md#settings) for the full parameter reference. The default `model` is `"electron"`.

## Usage

### Basic Setup

```python theme={null}
import os
from pipecat.services.smallest.llm import SmallestLLMService

llm = SmallestLLMService(
    api_key=os.getenv("SMALLEST_API_KEY"),
    settings=SmallestLLMService.Settings(model="electron"),
)
```

### With Custom Settings

```python theme={null}
from pipecat.services.smallest.llm import SmallestLLMService

llm = SmallestLLMService(
    api_key=os.getenv("SMALLEST_API_KEY"),
    settings=SmallestLLMService.Settings(
        model="electron",
        temperature=0.7,
        max_completion_tokens=1024,
    ),
)
```

## Notes

* **Developer messages**: Electron doesn't support the `developer` role, so the service sends `developer`-role messages as `user` messages.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.