Skip to main content

Overview

CrusoeLLMService provides chat completion capabilities using Crusoe Cloud’s Managed Inference API with OpenAI-compatible interface. It supports streaming responses and function calling.

Crusoe LLM API Reference

Pipecat’s API methods for Crusoe integration

Example Implementation

Function calling example with Crusoe

Crusoe Documentation

Official Crusoe documentation

Crusoe Cloud

Access models and manage API keys

Installation

To use Crusoe LLM services, install the required dependencies:

Prerequisites

Crusoe Account Setup

Before using Crusoe LLM services, you need:
  1. Crusoe Account: Sign up at Crusoe Cloud
  2. API Key: Generate an API key from your account dashboard
  3. Model Selection: Choose from available models (default: zai/GLM-5.2)

Required Environment Variables

  • CRUSOE_API_KEY: Your Crusoe API key for authentication

Configuration

str
required
The API key for accessing Crusoe’s Managed Inference API.
str
default:"https://api.inference.crusoecloud.com/v1/"
The base URL for the Crusoe API. Override if using a different endpoint.
CrusoeLLMService.Settings
default:"None"
Runtime-configurable model settings. See Settings below.

Settings

Runtime-configurable settings passed via the settings constructor argument using CrusoeLLMService.Settings(...). These can be updated mid-conversation with LLMUpdateSettingsFrame. See Service Settings for details.
NOT_GIVEN values are omitted from the API request entirely, letting the Crusoe API use its own defaults. This is different from None, which would be sent explicitly.

Usage

Basic Setup

With Custom Settings

Updating Settings at Runtime

Model settings can be changed mid-conversation using LLMUpdateSettingsFrame:

Notes

  • OpenAI Compatibility: Crusoe’s API is OpenAI-compatible, allowing use of familiar patterns and parameters.
  • Function Calling: Supports OpenAI-style tool/function calling format.
  • Streaming: Supports streaming responses for real-time interaction.
  • Developer Role: Crusoe does not support the developer message role. Messages with this role will be automatically converted to system messages.

Event Handlers

CrusoeLLMService supports the following event handlers, inherited from LLMService: