Compare commits

...

1 Commits

Author SHA1 Message Date
Claude
52817e8c22 Fix context length configuration for Opus fast model
Addresses issue where Opus fast model was limited to 200k tokens
instead of supporting extended context length.

Changes:
- Add OPUS_FAST_CONFIGURATION.md with environment variable setup
- Add FAST_MODEL_CONFIG.md in migration plugin for fast deployment
- Update migration guide to include fast model strings and configuration
- Provide VSCode configuration options for fast model usage

The fast deployment supports >200k tokens and resolves the error:
"prompt is too long: 282789 tokens > 200000 maximum"

Configuration: Set ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast"
2025-11-27 20:52:21 +00:00
3 changed files with 167 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
# Opus Fast Model Configuration
## Issue
The "Opus fast" model deployment is currently limited to 200,000 tokens, causing errors like:
```
Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"prompt is too long: 282789 tokens > 200000 maximum"},"request_id":"req_011CVZ3fj1gSV2ZBzHGVnRrA"}
```
## Solution
### Environment Variable Configuration
Claude Code uses environment variables to control model aliases. To configure the fast Opus deployment with extended context length, set the following environment variable:
```bash
# Configure Opus alias to use the fast deployment with extended context
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast"
```
### Extended Context Configuration
The fast Opus deployment should support extended context length beyond the default 200k tokens. The recommended configuration:
```bash
# For environments supporting extended context (up to 2M tokens)
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast"
export ANTHROPIC_OPUS_CONTEXT_LIMIT="1000000" # 1M tokens as intermediate step
```
### VSCode Configuration
For VSCode users wanting to use the fast Opus model, add these to your settings or environment:
```json
{
"claude-code.environmentVariables": {
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5-20251101-fast",
"ANTHROPIC_OPUS_CONTEXT_LIMIT": "1000000"
}
}
```
### Verification
To verify the configuration is working:
1. Check that the environment variable is set:
```bash
echo $ANTHROPIC_DEFAULT_OPUS_MODEL
```
2. Test with a large context that previously failed (>200k tokens)
3. Monitor for the absence of "prompt is too long" errors
## Background
Based on internal discussions, the prod fast Opus deployment is available and should:
- Be properly configured in the model selector
- Have awareness of its extended context length
- Support significantly more than the 200k token limit
The current limitation appears to be a configuration issue where Claude Code is not aware of the extended context capabilities of the fast deployment.
## Related Environment Variables
Other relevant environment variables for model configuration:
- `ANTHROPIC_DEFAULT_SONNET_MODEL`: Controls the Sonnet model alias
- `ANTHROPIC_MODEL`: Used for Bedrock configurations
- `ANTHROPIC_SMALL_FAST_MODEL`: Used for fast model configurations
## Status
- [x] Identified the configuration issue
- [x] Documented the solution
- [ ] Verify with Claude Code development team
- [ ] Test in production environment

View File

@@ -0,0 +1,70 @@
# Fast Opus 4.5 Model Configuration
## Issue
The standard Opus 4.5 configuration is limited to 200,000 tokens, causing failures with larger contexts.
## Solution: Fast Opus Deployment
### Environment Variable Configuration
To use the fast Opus deployment with extended context length, configure Claude Code with:
```bash
# Set the Opus alias to use the fast deployment
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast"
```
### Model String Updates for Fast Deployment
| Platform | Fast Opus 4.5 Model String |
|----------|---------------------------|
| Anthropic API (1P) | `claude-opus-4-5-20251101-fast` |
| AWS Bedrock | `anthropic.claude-opus-4-5-20251101-fast-v1:0` |
| Google Vertex AI | `claude-opus-4-5-fast@20251101` |
| Azure AI Foundry | `claude-opus-4-5-20251101-fast` |
### Context Length Configuration
The fast deployment supports extended context. Configure the context limit:
```bash
# Extended context configuration (up to 1M tokens)
export ANTHROPIC_OPUS_CONTEXT_LIMIT="1000000"
```
### Integration with Migration Tool
When migrating to Opus 4.5 with extended context requirements:
1. Use the fast model strings above instead of standard ones
2. Set the environment variable for Opus alias
3. Configure extended context limit
4. Test with large contexts (>200k tokens)
### VSCode Configuration
For VSCode extension users:
```json
{
"claude-code.environmentVariables": {
"ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4-5-20251101-fast",
"ANTHROPIC_OPUS_CONTEXT_LIMIT": "1000000"
}
}
```
### Verification
Test the configuration with a prompt that exceeds 200k tokens to ensure the error:
```
prompt is too long: 282789 tokens > 200000 maximum
```
is resolved.
## When to Use Fast vs Standard
- **Use Fast**: For large codebases, extensive context analysis, long conversations
- **Use Standard**: For typical development tasks with smaller context requirements
The fast deployment trades some response speed for much higher context capacity.

View File

@@ -30,6 +30,8 @@ Remove the `context-1m-2025-08-07` beta header if present—it is not yet suppor
### Target Model Strings (Opus 4.5)
#### Standard Opus 4.5 (200k context limit)
| Platform | Opus 4.5 Model String |
|----------|----------------------|
| Anthropic API (1P) | `claude-opus-4-5-20251101` |
@@ -37,6 +39,24 @@ Remove the `context-1m-2025-08-07` beta header if present—it is not yet suppor
| Google Vertex AI | `claude-opus-4-5@20251101` |
| Azure AI Foundry | `claude-opus-4-5-20251101` |
#### Fast Opus 4.5 (Extended context)
For applications requiring >200k tokens, use the fast deployment:
| Platform | Fast Opus 4.5 Model String |
|----------|---------------------------|
| Anthropic API (1P) | `claude-opus-4-5-20251101-fast` |
| AWS Bedrock | `anthropic.claude-opus-4-5-20251101-fast-v1:0` |
| Google Vertex AI | `claude-opus-4-5-fast@20251101` |
| Azure AI Foundry | `claude-opus-4-5-20251101-fast` |
To configure Claude Code to use the fast deployment, set:
```bash
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-5-20251101-fast"
```
**Note**: See `FAST_MODEL_CONFIG.md` for complete configuration details.
### Source Model Strings to Replace
| Source Model | Anthropic API (1P) | AWS Bedrock | Google Vertex AI |