Add Multi-Provider Support for Claude Code Security Reviews #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces comprehensive multi-provider support for Claude Code, enabling users to access Claude models through multiple cloud providers while maintaining full backward compatibility.
✨ Features Added
🔧 Multi-Provider Architecture
🏗️ Clean Architecture
ClaudeClientBase) defining common interfaceClaudeClientFactory) for automatic provider selection🔄 Backward Compatibility
ClaudeAPIClientrefactored but API-compatible📁 Files Added/Modified
Core Architecture
claudecode/claude_client_base.py- Abstract base class for all providersclaudecode/claude_client_factory.py- Factory for provider selectionclaudecode/claude_api_client.py- Refactored to inherit from base classclaudecode/claude_bedrock_client.py- AWS Bedrock implementationclaudecode/claude_vertex_client.py- Google Vertex AI implementationclaudecode/env_validation.py- Environment validation utilitiesDocumentation & Examples
docs/multi-provider-setup.md- Comprehensive setup guideexamples/multi-provider-example.py- Working example demonstrating all providersDependencies
claudecode/requirements.txt- Addedboto3for Bedrock,anthropic[vertex]for Vertex AITesting Suite
test_multi_provider.py- Unit tests for all componentstest_integration_multi_provider.py- Integration tests with real providerstest_providers_manually.py- Manual testing script for quick validationtest_provider_performance.py- Performance testing and benchmarking🛠️ Configuration
Anthropic API (Default)
AWS Bedrock
Google Vertex AI
🧪 Testing
Unit Tests
Integration Tests (requires credentials)
Manual Testing
💡 Usage Examples
Automatic Provider Selection (recommended)
Direct Provider Usage
🔄 Migration Guide
No changes required - existing code continues to work. To use new providers:
pip install boto3for Bedrock orpip install 'anthropic[vertex]'for Vertex AI🎯 Benefits
🧪 Test Coverage
🔍 Technical Details
Provider-Specific Features:
Quality Assurance:
📈 Performance Impact
🚨 Breaking Changes
None - This is a fully backward-compatible change.