aws-samples / aws-samples/sample-multi-agent-orchestration-chat-on-agentcore
Add xAI Grok 4.6 model support
- Dominant language
- TypeScript
- Stars
- 128
- Forks
- 12
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 4
Description
## Background
xAI Grok 4.6 became generally available on Amazon Bedrock on **August 19, 2026**, with cross-region inference support across 30+ regions. It is a frontier model purpose-built for coding, agentic tasks, and knowledge work, and matches GPT-5.6 Sol on the Artificial Analysis Intelligence Index — making it a compelling addition to Moca's model lineup.
## Model Details
| Property | Value |
|---|---|
| **Model ID** | `xai.grok-4.6` |
| **US Geo Inference Profile** | `us.xai.grok-4-6-v1:0` |
| **Global Inference Profile** | `global.xai.grok-4-6-v1:0` |
| **Context window** | 500K tokens |
| **Reasoning levels** | `low`, `medium`, `high`, `xhigh` |
| **Pricing** | $2 / M input tokens · $6 / M output tokens |
| **APIs supported** | Responses API, Chat Completions API, Converse API |
| **Endpoint** | Standard `bedrock-runtime` (Converse API path) |
| **Cross-region inference** | US Geo + Global, 30+ regions |
| **GA date** | August 19, 2026 |
## Implementation Plan
The codebase has a clear **Single Source of Truth** for model definitions at:
`packages/libs/core/src/bedrock-models.ts` — `BEDROCK_MODEL_DEFINITIONS`
### 1. Add a new provider type
The `BedrockModelDefinition.provider` union currently covers `'Anthropic' | 'Amazon' | 'Qwen' | 'OpenAI'`. Extend it to include `'xAI'`.
### 2. Add the model entry to `BEDROCK_MODEL_DEFINITIONS`
```ts
{
// xAI Grok 4.6 on Bedrock. GA 2026-08-19. 500K context window.
// Standard bedrock-runtime Converse/ConverseStream path.
// Cross-region inference: global.* (Global) or us.* (US Geo).
// Configurable reasoning levels: low, medium, high, xhigh.
// Source: AWS Bedrock model card, 2026-08-19.
id: 'global.xai.grok-4-6-v1:0',
name: 'Grok 4.6',
provider: 'xAI',
maxOutputTokens: 16384, // confirm from AWS Bedrock model card; update when known
reasoningCapable: true,
// Grok 4.6 uses xhigh as its highest reasoning level — map to 'max' cap
// or introduce a Grok-specific handling if Bedrock's reasoning field shape
// differs from Anthropic's adaptive-thinking + effort model.
},
```
> ⚠️ **Note on reasoning shape:** Grok 4.6's configurable reasoning levels (`low`, `medium`, `high`, `xhigh`) may not map directly to Bedrock's current `output_config.effort` shape used for Anthropic models. Verify via the Bedrock API and update `getReasoningConfig()` / `REASONING_DEPTHS` / `ReasoningDepth` as needed.
### 3. Mirror the entry in CDK config
Per the file's own instructions, also update `DEFAULT_CONFIG.bedrockModels` in:
`packages/cdk/config/environment-utils.ts`
### 4. Update the models reference doc
`packages/agent/skills/moca-guide/references/models.md` lists available models for the skill guide — add Grok 4.6 there as well.
### 5. Verify IAM / inference-profile ARN
The `global.xai.grok-4-6-v1:0` cross-region profile requires a scoped inference-profile ARN in addition to the foundation-model ARN. Confirm that `deriveBedrockIamResources()` in the CDK package handles the `xai.*` prefix correctly.
## Priority
**Medium** — Grok 4.6 is a competitive frontier model that matches GPT-5.6 Sol on the Artificial Analysis Intelligence Index at a lower price point ($2/$6 per M tokens vs GPT-5.6 pricing), and its 500K context window and configurable reasoning make it highly relevant for the agentic use cases Moca is designed for.
Contributor guide
Research direction
Start with packages/libs/core/src/bedrock-models.ts and inspect BEDROCK_MODEL_DEFINITIONS, the provider union, getReasoningConfig(), and REASONING_DEPTHS. Then review packages/cdk/config/environment-utils.ts, deriveBedrockIamResources(), and packages/agent/skills/moca-guide/references/models.md. Done means the model is represented consistently in all named locations, its Bedrock reasoning and inference-profile behavior are verified, and the reference documentation is updated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- ai, backend, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100