Skip to content

Conversation

@sebsto
Copy link
Collaborator

@sebsto sebsto commented Nov 26, 2025

Overview

This PR introduces global cross-region inference capability for Claude v4.5 models, adds support for Claude Opus 4.5, and includes a new InvokeModel example.

Key Changes

1. Global Cross-Region Inference

  • New Protocol: Introduced `GlobalCrossRegionInferenceModality` protocol for models supporting global cross-region inference
  • Model Architecture: Created new wrapper structs for Claude v4.5 models to support global cross-region inference without duplicating `AnthropicText` class
    • New file: `AnthropicGlobalModels.swift` containing `Claude_Sonnet_v4_5` and `Claude_Opus_v4_5` structs
    • These structs delegate to `AnthropicText` while conforming to `GlobalCrossRegionInferenceModality`
  • Logic Enhancement: Updated `getModelIdWithCrossRegionInferencePrefix()` to prioritize global cross-region inference over regional inference
  • Model Support: Both Claude Sonnet 4.5 and Opus 4.5 now support global cross-region inference

2. Claude Opus 4.5 Support

  • Added Claude Opus 4.5 model definition (`anthropic.claude-opus-4-5-20251101-v1:0`)
  • Supports all advanced features: text generation, system prompts, document processing, vision, tool use, and reasoning
  • Max tokens: 32,000 (default: 8,192)
  • Max reasoning tokens: 8,191 (default: 4,096)

3. New InvokeModel Example

  • Added new example project demonstrating InvokeModel API usage
    • Located in `Examples/invoke-model/`
    • Includes both Swift and Python implementations
    • Shows how to use the InvokeModel API with Claude models

Files Changed

  • `Sources/BedrockService/BedrockRuntimeClient/Modalities/CrossRegionInference.swift` - Added global cross-region inference protocol
  • `Sources/BedrockService/Models/Anthropic/AnthropicGlobalModels.swift` - New file with v4.5 model wrappers
  • `Sources/BedrockService/Models/Anthropic/AnthropicBedrockModels.swift` - Added Opus 4.5 model definition
  • `Sources/BedrockService/Models/BedrockModel.swift` - Updated cross-region inference logic
  • `Examples/invoke-model/` - New example project

Breaking Changes

None - all changes are additive and maintain backward compatibility.

Documentation

  • Added AWS documentation reference for cross-region inference
  • Included inline documentation for new models and protocols

@sebsto sebsto self-assigned this Nov 26, 2025
@sebsto sebsto added the enhancement New feature or request label Nov 26, 2025
@sebsto sebsto merged commit cbb5e47 into main Nov 26, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant