Overview

AnthropicLLMService provides integration with Anthropic’s Claude models, supporting streaming responses, function calling, and prompt caching with specialized context handling for Anthropic’s message format and advanced reasoning capabilities.

Installation

To use Anthropic services, install the required dependency:
pip install "pipecat-ai[anthropic]"

Prerequisites

Anthropic Account Setup

Before using Anthropic LLM services, you need:
  1. Anthropic Account: Sign up at Anthropic Console
  2. API Key: Generate an API key from your console dashboard
  3. Model Selection: Choose from available Claude models (Claude 3.5 Sonnet, Claude 3 Opus, etc.)

Required Environment Variables

  • ANTHROPIC_API_KEY: Your Anthropic API key for authentication