Skip to main content

Overview

Providers are selected via the model field on each agent definition using a provider:model URI:
SirenSpec resolves the provider at runtime, instantiates the appropriate client, and calls the model’s chat completions API asynchronously.

OpenAI

Uses the official OpenAI Python SDK. URI format: openai:<model-name>
Authentication:
Examples: Any model name supported by the OpenAI chat completions API can be used.

Anthropic

Uses the official Anthropic Python SDK. URI format: anthropic:<model-name>
Authentication:
Examples:
The Anthropic provider extracts any system-role message and passes it as the top-level system parameter, as required by the Anthropic Messages API. max_tokens defaults to 4096 but is overridden per node by max_tokens_per_call.

Ollama

Uses Ollama’s OpenAI-compatible API via the OpenAI Python SDK. URI format: ollama:<model-name>
Configuration: Start Ollama locally:
Then run your workflow:
Ollama must be running and the model must be pulled locally before running a workflow that references it.

Mixing Providers

You can use different providers in a single workflow. Each agent independently resolves its own provider:
This workflow calls OpenAI for classification and Anthropic for the final response.

Error Handling

Provider URIs are validated when the workflow is executed. An invalid URI raises sirenspec.exceptions.ProviderError (a subclass of SirenSpecError):
Common reasons a ProviderError is raised:

Token Tracking

Each provider records prompt and completion token counts from every call. This usage data is surfaced in the execution trace under the usage field:
The tokens field is the sum of prompt and completion tokens; the usage field provides the detailed breakdown. estimated_usd is computed from a bundled LiteLLM pricing snapshot — it is null for models without a pricing entry (Ollama and other local backends), so the examples above show null. See Budget & Cost Control for details.