Choose your AI model
CDK Insights routes AI analysis through AWS Bedrock and lets you pick the model that fits each scan. More capable models cost more credits per resource. The default works well for most stacks - switch up only when you want deeper reasoning.
Quick reference
| Model | Alias | Credits / resource | Tier |
|---|---|---|---|
| GLM 4.7 Flash Z.AI | glm-4-7-flash | 0.5 | Default on every plan |
| Amazon Nova Lite Amazon | nova-lite | 0.5 | Economy option |
| Mistral 14B Mistral AI | mistral-14b | 1 | Pro / Team option |
| Claude Haiku 4.5 Anthropic | haiku-4-5 | 4 | Premium option |
| Claude Sonnet 4.6 Anthropic | sonnet-4-6 | 16 | Pro / Team |
When to pick which model
GLM 4.7 Flash
0.5 credits / resourceDefault on every planglm-4-7-flashPick when: Routine and security-focused scans that need detailed explanations and concrete fixes without premium-model cost.
Strengths
- Best measured quality/cost balance in the live model gate
- Detailed remediation and code examples
- Deterministic, reliable structured output
Avoid when
A particularly complex architecture needs a premium second opinion from Haiku or Sonnet.
Amazon Nova Lite
0.5 credits / resourceEconomy optionnova-litePick when: Fast, cost-conscious scans when concise recommendations are sufficient.
Strengths
- Lowest credit cost (2× more analyses per credit)
- Fast inference with reliable structured output
- AWS-native model
Avoid when
A high-stakes review specifically needs a second opinion from Haiku or Sonnet.
Mistral 14B
1 credits / resourcePro / Team optionmistral-14bPick when: An open-weight alternative when you want to compare findings with Nova Lite.
Strengths
- Anchor cost: 1 credit per resource
- Solid code understanding
- Useful as a second-model comparison
Avoid when
Deeply layered constructs or complex permission graphs - Haiku 4.5 will reason more thoroughly.
Claude Haiku 4.5
4 credits / resourcePremium optionhaiku-4-5Pick when: A premium second opinion for security-critical or unusually complex infrastructure.
Strengths
- Complete explanations and concrete fix examples
- Faster than Sonnet for similar quality on most CDK code
- Excellent at explaining nuanced findings
Avoid when
Quick iteration loops where speed/cost matter more than depth.
Claude Sonnet 4.6
16 credits / resourcePro / Teamsonnet-4-6Pick when: Maximum-depth reasoning for architecturally complex stacks where every nuance counts. Reserve for high-stakes audits.
Strengths
- Top-tier reasoning across the registry
- Best at multi-resource architectural patterns
- Catches subtle interactions Mistral and Haiku miss
Avoid when
Routine development scans - a 10,000-credit Pro plan covers 625 Sonnet analyses versus 20,000 on the GLM default.
How to switch models
Three ways to set the model, in order of precedence. The CLI walks them in the order shown - the first non-empty value wins.
1. Per-scan flag
Highest precedence. Use for one-off audits or when iterating on which model to settle on.
npx cdk-insights scan --model haiku-4-52. Project default in cdk.json context
Sets a default for the whole CDK project. Lives next to the rest of your CDK config - convenient when the team agrees on one model per project.
{
"context": {
"cdkInsights:aiModel": "mistral-14b"
}
}3. User default in .cdk-insights.json
Local user override - useful when you personally prefer a specific model across all your projects.
{
"ai": {
"model": "haiku-4-5"
}
}If none of the three is set, the resolver falls back to the tier-default model: GLM 4.7 Flash on every plan.
Tier gating
Free
GLM 4.7 Flash is the rich default; Nova Lite is also available as an economy option. Paid premium models remain tier-gated.
Pro
Full access to all 5 models. Default is GLM 4.7 Flash; pick any model per scan with --model.
Team
Same as Pro - full access to all 5 models. Each seat gets its own 20,000-credit allowance.
Credit math, worked examples
Each AI analysis on a resource spends credits at the model's rate. Cached results don't spend credits. Static scans are always free. Here's what each plan's monthly allowance buys at each model:
Free (500 credits/month)
Pro (10,000 credits/month)
Team (20,000 credits/seat/month)
What that means for a 500-resource estate
On the 0.5-credit GLM default, a fully fresh 500-resource scan costs at most 250 credits: about 2 first passes on Free, 40 on Pro, or 80 per Team seat. Repeat scans of unchanged resources use cached results and cost 0 credits, so day-to-day coverage is usually much higher than the fresh-scan minimum.
Counts assume one analysis per resource. With ai.batchSize enabled, multiple resources share a single Bedrock call - the credit cost stays the same per resource, but Bedrock-side prompt tokens are amortised across the batch.
Ready to pick a model?
Start with the default, switch up with --model when you need it.