Bedrock Chat - VS Code Extension
AI-powered chat assistant for VS Code using AWS Bedrock models.
Features
- 🤖 Multiple AI Models: Support for Claude 4.5 Opus, Claude 4.5 Sonnet, Claude 3.7 Sonnet, and Claude 4.5 Haiku
- 💬 Interactive Chat: Clean, modern chat interface integrated into VS Code
- 🔄 Streaming Responses: Real-time streaming of AI responses
- ⚙️ Configurable: Easy AWS profile and region configuration
- 🎨 Theme Integration: Automatically matches your VS Code theme
Prerequisites
- VS Code 1.85.0 or higher
- AWS account with Bedrock access
- AWS credentials configured locally
Installation
From Source
- Clone this repository
- Run
npm install
- Press F5 to open Extension Development Host
- The extension will be loaded in the new window
From VSIX (after packaging)
- Run
npm run package to create a .vsix file
- In VS Code, go to Extensions view
- Click "..." menu → "Install from VSIX..."
- Select the generated
.vsix file
Setup
The extension supports three authentication methods. Choose the one that best fits your needs:
Option A: Profile-Based Authentication (Recommended)
Use AWS CLI profiles for secure credential management.
Configure AWS CLI:
aws configure --profile your-profile-name
In VS Code Settings, set:
- Auth Method:
profile
- AWS Profile: Your profile name (e.g.,
default)
Option B: Role-Based Authentication (AssumeRole)
Assume an IAM role for cross-account access or enhanced security.
Configure a base AWS profile (see Option A)
In VS Code Settings, set:
- Auth Method:
role
- AWS Profile: Base profile to use for assuming the role
- AWS Role ARN: ARN of the role to assume (e.g.,
arn:aws:iam::123456789012:role/BedrockRole)
- AWS Role Session Name: Optional session name (default:
bedrock-chat-session)
Option C: Direct Credentials
Use access keys directly (not recommended for production).
⚠️ Security Warning: Storing credentials in VS Code settings is less secure than using profiles or roles. Use this only for testing or temporary access.
In VS Code Settings, set:
- Auth Method:
credentials
- AWS Access Key ID: Your access key
- AWS Secret Access Key: Your secret key
- AWS Session Token: Optional, for temporary credentials
2. Enable Bedrock Models
- Log in to AWS Console
- Navigate to Amazon Bedrock
- Go to "Model access" in the left sidebar
- Request access to the models you want to use:
- Anthropic Claude models
- Amazon Titan models
- Meta Llama models
Open VS Code Settings (Cmd/Ctrl + ,) and search for "Bedrock Chat":
- Auth Method: Choose authentication method (
profile, role, or credentials)
- AWS Profile: Set your AWS profile name (default: "default")
- AWS Region: Select the region where Bedrock is available (e.g., us-east-1)
- Default Model: Choose your preferred model
- Max Tokens: Maximum response length (default: 4096)
- Temperature: Response creativity 0-1 (default: 0.7)
Usage
Opening the Chat
- Click the chat icon in the Activity Bar (left sidebar)
- Or use Command Palette (Cmd/Ctrl + Shift + P) → "Bedrock Chat: Open Chat"
Sending Messages
- Type your message in the input field
- Press Enter or click "Send"
- The AI will respond with streaming output
Changing Models
- Use the dropdown at the top of the chat panel
- Or use Command Palette → "Bedrock Chat: Change Model"
Clearing History
- Use Command Palette → "Bedrock Chat: Clear History"
Supported Models
| Model |
ID |
Best For |
| Claude 4.5 Opus |
us.anthropic.claude-opus-4-5-20251101-v1:0 |
Most powerful, complex tasks |
| Claude 4.5 Sonnet |
us.anthropic.claude-sonnet-4-5-20250929-v1:0 |
Balanced intelligence and speed |
| Claude 3.7 Sonnet |
us.anthropic.claude-3-7-sonnet-20250219-v1:0 |
High capability, lower latency |
| Claude 4.5 Haiku |
us.anthropic.claude-haiku-4-5-20251001-v1:0 |
Fastest, cost-effective |
Troubleshooting
"Access Denied" Error
- Verify your AWS credentials are configured correctly
- Ensure your IAM user/role has Bedrock permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": "*"
}
]
}
"Model Not Found" Error
- Check if the model is available in your selected region
- Verify you have requested access to the model in Bedrock console
"Invalid Profile" Error
- Verify the profile name in settings matches your AWS credentials file
- Check that
~/.aws/credentials exists and contains the profile
Development
Building
npm run compile
Watching for Changes
npm run watch
Packaging
npm run package
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and feature requests, please use the GitHub issue tracker.