Skip to main content

Overview

FireworksLLMService provides access to Fireworks AI’s language models through an OpenAI-compatible interface. It inherits from OpenAILLMService and supports streaming responses, function calling, and context management with optimized inference infrastructure.

Installation

To use Fireworks AI services, install the required dependency:
pip install "pipecat-ai[fireworks]"

Prerequisites

Fireworks AI Account Setup

Before using Fireworks AI LLM services, you need:
  1. Fireworks Account: Sign up at Fireworks AI
  2. API Key: Generate an API key from your account dashboard
  3. Model Selection: Choose from available open-source and proprietary models

Required Environment Variables

  • FIREWORKS_API_KEY: Your Fireworks AI API key for authentication

Configuration

api_key
str
required
Fireworks AI API key for authentication.
model
str
default:"None"
deprecated
Model identifier to use.Deprecated in v0.0.105. Use settings=FireworksLLMService.Settings(model=...) instead.
settings
FireworksLLMService.Settings
default:"None"
Runtime-configurable settings. See Settings below.
base_url
str
default:"https://api.fireworks.ai/inference/v1"
Base URL for Fireworks API endpoint.

Settings

Runtime-configurable settings passed via the settings constructor argument using FireworksLLMService.Settings(...). These can be updated mid-conversation with LLMUpdateSettingsFrame. See Service Settings for details. This service uses the same settings as OpenAILLMService. See OpenAI LLM Settings for the full parameter reference.

Usage

Basic Setup

import os
from pipecat.services.fireworks import FireworksLLMService

llm = FireworksLLMService(
    api_key=os.getenv("FIREWORKS_API_KEY"),
    model="accounts/fireworks/models/firefunction-v2",
)

With Custom Settings

from pipecat.services.fireworks import FireworksLLMService

llm = FireworksLLMService(
    api_key=os.getenv("FIREWORKS_API_KEY"),
    settings=FireworksLLMService.Settings(
        model="accounts/fireworks/models/firefunction-v2",
        temperature=0.7,
        top_p=0.9,
        max_tokens=1024,
    ),
)

Notes

  • Fireworks does not support the seed, max_completion_tokens, or stream_options parameters. Use max_tokens instead.
  • Model identifiers use the accounts/fireworks/models/ prefix format.
The InputParams / params= pattern is deprecated as of v0.0.105. Use Settings / settings= instead. See the Service Settings guide for migration details.