llm
Crusoe Cloud LLM service implementation using OpenAI-compatible interface.
- class pipecat.services.crusoe.llm.CrusoeLLMSettings(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>, max_completion_tokens: int | None | _NotGiven | NotGiven = <factory>)[source]
Bases:
OpenAILLMSettingsSettings for CrusoeLLMService.
- class pipecat.services.crusoe.llm.CrusoeLLMService(*, api_key: str, base_url: str = 'https://api.inference.crusoecloud.com/v1/', settings: CrusoeLLMSettings | None = None, **kwargs)[source]
Bases:
OpenAILLMServiceA service for interacting with Crusoe Cloud’s Managed Inference API.
This service extends OpenAILLMService to connect to Crusoe’s OpenAI-compatible API endpoint while maintaining full compatibility with OpenAI’s interface and functionality.
- supports_developer_role = 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
CrusoeLLMSettings
- __init__(*, api_key: str, base_url: str = 'https://api.inference.crusoecloud.com/v1/', settings: CrusoeLLMSettings | None = None, **kwargs)[source]
Initialize the Crusoe LLM service.
- Parameters:
api_key – The API key for accessing Crusoe’s Managed Inference API.
base_url – The base URL for the Crusoe API. Defaults to
"https://api.inference.crusoecloud.com/v1/".settings – Runtime-updatable settings. When provided alongside deprecated parameters,
settingsvalues take precedence.**kwargs – Additional keyword arguments passed to OpenAILLMService.
- create_client(api_key=None, base_url=None, **kwargs)[source]
Create OpenAI-compatible client for Crusoe API endpoint.
- Parameters:
api_key – The API key for authentication. If None, uses instance default.
base_url – The base URL for the API. If None, uses instance default.
**kwargs – Additional keyword arguments for client configuration.
- Returns:
An OpenAI-compatible client configured for Crusoe’s API.