> ## 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.

# Together AI LLM

> TogetherLLMService accesses Together AI's model catalog, including Meta Llama 3.1 and 3.2, via an OpenAI-compatible interface.

## Overview

`TogetherLLMService` provides access to Together AI's language models, including Meta's Llama 3.1 and 3.2 models, through an OpenAI-compatible interface. It inherits from `OpenAILLMService` and supports streaming responses, function calling, and context management with optimized open-source model hosting.

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

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

> [card] [Together AI Documentation](https://docs.together.ai/reference/chat-completions-1)
>
> Official Together AI API documentation and features

> [card] [Together AI Platform](https://together.ai/)
>
> Access open-source models and manage API keys

## Installation

To use Together AI services, install the required dependencies:

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

## Prerequisites

### Together AI Account Setup

Before using Together AI LLM services, you need:

1. **Together AI Account**: Sign up at [Together AI](https://together.ai/)
2. **API Key**: Generate an API key from your account dashboard
3. **Model Selection**: Choose from available open-source models (Llama, Mistral, etc.)

### Required Environment Variables

* `TOGETHER_API_KEY`: Your Together AI API key for authentication

## Configuration

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

Together AI API key for authentication. Raises `ValueError` when empty.

**base\_url** `str` (default: [https://api.together.xyz/v1](https://api.together.xyz/v1))

Base URL for Together AI API endpoint.

**model** `str` *deprecated* (default: None)

*Deprecated since 0.0.105, removed in 2.0.0.* Use
`settings=TogetherLLMService.Settings(model=...)` instead.

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

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

### Settings

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

**reasoning** `dict[str, Any] | None` (default: None)

Together's reasoning toggle, for the models that support one, e.g. `{"enabled": False}`. A reasoning model such as GLM runs a reasoning pass before every answer, which delays the first spoken token. `None` leaves the choice to the model's own default.

**reasoning\_effort** `str | None` (default: None)

How much the model reasons before answering. Values vary by model: `"low"`,
`"medium"` and `"high"` are common, `zai-org/GLM-5.3` also takes `"max"`, and
some models map an unsupported value onto one they support. Other strings are
passed through as-is. `zai-org/GLM-5.3` ignores `reasoning`, but `"low"` still
shortens its reasoning pass. `None` leaves the choice to Together's per-model
default.

This service also inherits settings from `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 `"zai-org/GLM-5.2"`.

## Usage

### Basic Setup

```python theme={null}
import os
from pipecat.services.together.llm import TogetherLLMService

llm = TogetherLLMService(
    api_key=os.getenv("TOGETHER_API_KEY"),
    settings=TogetherLLMService.Settings(model="zai-org/GLM-5.2"),
)
```

### With Custom Settings

```python theme={null}
from pipecat.services.together.llm import TogetherLLMService

llm = TogetherLLMService(
    api_key=os.getenv("TOGETHER_API_KEY"),
    settings=TogetherLLMService.Settings(
        model="zai-org/GLM-5.2",
        temperature=0.7,
        top_p=0.9,
        max_completion_tokens=1024,
    ),
)
```

### With Reasoning Disabled

For reasoning models like GLM, disable the reasoning pass to reduce latency in real-time voice applications:

```python theme={null}
from pipecat.services.together.llm import TogetherLLMService

llm = TogetherLLMService(
    api_key=os.getenv("TOGETHER_API_KEY"),
    settings=TogetherLLMService.Settings(
        model="zai-org/GLM-5.2",
        reasoning={"enabled": False},
    ),
)
```

## Notes

* Together AI hosts a wide variety of open-source models. Model identifiers use the `organization/model-name` format.
* Together AI fully supports the OpenAI-compatible parameter set inherited from `OpenAILLMService`.


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