Skip to content

Commit edab1e7

Browse files
committed
feat: Add AWS Bedrock foundation models support
- Add BedrockProvider class with support for multiple model families - Support for Claude, Titan, Llama, Mistral, and Cohere models on Bedrock - Add AWS profile and region configuration options - Implement proper message formatting for each model type - Add comprehensive error handling and retry logic - Update CLI to support --aws-profile and --aws-region options - Add Bedrock to provider registry and type definitions - Update README with Bedrock setup instructions and examples - Add Bedrock to provider comparison and use cases tables Usage: - cursorifier --provider bedrock - cursorifier --provider bedrock --aws-profile myprofile --aws-region us-west-2 - cursorifier --provider bedrock --model anthropic.claude-3-sonnet-20240229-v1:0 AWS credentials are automatically picked up from: - AWS CLI configuration (aws configure) - Environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) - IAM roles (if running on EC2) - AWS SSO - AWS profile (via AWS_PROFILE env var)
1 parent 9a9fe1c commit edab1e7

22 files changed

Lines changed: 2583 additions & 395 deletions

README.md

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ cursorifier --output-format roo --description "TypeScript development with AI in
257257
# Generate Roo Custom Modes using OpenAI
258258
cursorifier --output-format roo --provider openai --model gpt-4o
259259

260+
# Generate using AWS Bedrock
261+
cursorifier --provider bedrock --model anthropic.claude-3-sonnet-20240229-v1:0
262+
263+
# Generate using AWS Bedrock with specific profile and region
264+
cursorifier --provider bedrock --aws-profile myprofile --aws-region us-west-2
265+
260266
# List available providers and models
261267
cursorifier --list-providers
262268

@@ -315,30 +321,71 @@ Options:
315321
- **API Key**: Optional (`LOCAL_API_KEY`)
316322
- **Best for**: Privacy, offline usage, and custom models
317323

324+
### AWS Bedrock
325+
- **Models**: Claude 3 (Haiku, Sonnet, Opus), Titan, Llama 2, Mistral, Cohere
326+
- **API Key**: AWS credentials (via profile, environment, or IAM role)
327+
- **Best for**: Enterprise AWS environments, cost-effective access to multiple model providers
328+
318329
## 📊 Provider Comparison
319330

320-
| Feature | Anthropic Claude | OpenAI | Local Models |
321-
|---------|------------------|--------|--------------|
322-
| **Quality** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ |
323-
| **Speed** | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
324-
| **Cost** | ⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
325-
| **Privacy** | ⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐⭐ |
326-
| **Offline** ||||
327-
| **Custom Models** ||||
331+
| Feature | Anthropic Claude | OpenAI | Local Models | AWS Bedrock |
332+
|---------|------------------|--------|--------------|-------------|
333+
| **Quality** | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ |
334+
| **Speed** | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
335+
| **Cost** | ⭐⭐ | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
336+
| **Privacy** | ⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
337+
| **Offline** |||||
338+
| **Custom Models** |||||
339+
| **Enterprise** | ⭐⭐⭐ | ⭐⭐⭐ | ⭐⭐ | ⭐⭐⭐⭐⭐ |
328340

329341
## 🎯 Use Cases
330342

331343
<div align="center">
332344

333345
| **Use Case** | **Recommended Provider** | **Why** |
334346
|--------------|-------------------------|---------|
335-
| 🏢 **Enterprise Projects** | Anthropic Claude | Best code understanding and analysis |
347+
| 🏢 **Enterprise Projects** | AWS Bedrock | Enterprise-grade security and compliance |
348+
| 🧠 **Complex Analysis** | Anthropic Claude | Best code understanding and analysis |
336349
| 🚀 **Rapid Prototyping** | OpenAI | Fast and cost-effective |
337350
| 🔒 **Sensitive Codebases** | Local Models | Complete privacy and control |
338351
| 🎓 **Learning Projects** | Local Models | Free and educational |
352+
| ☁️ **AWS Environments** | AWS Bedrock | Native AWS integration and billing |
339353

340354
</div>
341355

356+
### Setting up AWS Bedrock
357+
358+
#### Prerequisites
359+
1. **AWS Account**: You need an active AWS account
360+
2. **Bedrock Access**: Request access to Bedrock foundation models in your AWS console
361+
3. **AWS Credentials**: Configure your AWS credentials
362+
363+
#### AWS Credentials Setup
364+
```bash
365+
# Option 1: AWS CLI configuration
366+
aws configure
367+
368+
# Option 2: Environment variables
369+
export AWS_ACCESS_KEY_ID=your_access_key
370+
export AWS_SECRET_ACCESS_KEY=your_secret_key
371+
export AWS_DEFAULT_REGION=us-east-1
372+
373+
# Option 3: AWS Profile
374+
export AWS_PROFILE=your_profile_name
375+
```
376+
377+
#### Usage Examples
378+
```bash
379+
# Use default AWS credentials and region
380+
cursorifier . --provider bedrock
381+
382+
# Specify AWS profile and region
383+
cursorifier . --provider bedrock --aws-profile myprofile --aws-region us-west-2
384+
385+
# Use specific Bedrock model
386+
cursorifier . --provider bedrock --model anthropic.claude-3-sonnet-20240229-v1:0
387+
```
388+
342389
### Setting up Local Models
343390

344391
#### Ollama

lib/index.js

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/llm-generator-v2.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface LLMGeneratorOptions {
55
baseURL?: string;
66
maxTokens?: number;
77
temperature?: number;
8+
region?: string;
89
chunkSize?: number;
910
chunkDelay?: number;
1011
}

0 commit comments

Comments
 (0)