Default Model
The default model isclaude-sonnet-4-5 (Anthropic Claude 4.5 Sonnet), which provides:
- Excellent reasoning for security analysis
- Tool use capability for pentest actions
- Large context window (200k tokens)
- Good balance of performance and cost
Selecting a Model
Via Command Line
Specify the model with the--model flag:
Via TUI
- Launch the TUI:
pensar - Navigate to Models screen
- Select from available models or enter a custom model name
- The selection persists in
~/.pensar/config.json
Programmatic API
Set the model in your code:Recommended Models by Provider
- Anthropic (Recommended)
- OpenAI
- AWS Bedrock
- OpenRouter
- Local (vLLM)
Claude 4.5 Sonnet (Default)
Context: 200k tokens
Strengths: Excellent reasoning, tool use, security analysis
Claude 4 Opus
Context: 200k tokens
Strengths: Maximum reasoning capability, handles complex chains
Claude 3.5 Sonnet
Context: 200k tokens
Strengths: Previous generation, still highly capable
Model Selection Guide
By Use Case
| Use Case | Recommended Model | Rationale |
|---|---|---|
| General pentesting | claude-sonnet-4-5 | Best balance of quality and cost |
| Complex exploitation | claude-opus-4 | Maximum reasoning for multi-step chains |
| Budget testing | claude-sonnet-3-5 | Good quality at lower cost |
| Enterprise AWS | anthropic.claude-sonnet-4-5 (Bedrock) | AWS compliance and security |
| Offline/air-gapped | meta-llama/Llama-3.1-70B-Instruct (vLLM) | No external API calls |
| Whitebox code analysis | deepseek-ai/deepseek-coder-33b-instruct (vLLM) | Code-specialized model |
By Performance Requirements
Best Quality
claude-opus-4Maximum reasoning capability. Use for complex targets or when quality is critical.
Best Balance
claude-sonnet-4-5Excellent quality with reasonable cost and speed. Recommended default.
Best Cost
claude-sonnet-3-5Lower cost while maintaining good quality. Suitable for large-scale testing.
Model Capabilities
All recommended models support:- Tool Use: Execute pentest tools (curl, nmap, etc.)
- Long Context: Handle large attack surface reports (100k+ tokens)
- Structured Output: Generate JSON findings and reports
- Multi-turn Reasoning: Adapt based on target responses
Pensar Apex automatically handles tool calling and structured output for all supported models.
Context Windows
Different models have different context limits:| Model | Context Window | Suitable For |
|---|---|---|
| Claude 4.5 Sonnet | 200k tokens | Large applications, extensive attack surfaces |
| Claude 4 Opus | 200k tokens | Complex multi-step exploitation |
| GPT-4 | 128k tokens | Medium-sized applications |
| Llama 3.1 70B | 128k tokens | Standard pentesting scenarios |
Cost Considerations
Model costs vary significantly:Anthropic Pricing (approximate)
- Claude 4.5 Sonnet: ~15 per 1M output tokens
- Claude 4 Opus: ~75 per 1M output tokens
- Claude 3.5 Sonnet: ~15 per 1M output tokens
Typical Pentest Costs
- Simple target (5-10 endpoints): 2.00
- Medium target (20-50 endpoints): 10.00
- Large target (100+ endpoints): 50.00
Actual costs depend on target complexity, number of endpoints, and exploitation depth.
Custom Models
You can use any model compatible with your provider:OpenRouter Custom Models
Any model on openrouter.ai/models:vLLM Custom Models
Any model supported by vLLM:Model Configuration Storage
Your selected model is saved in~/.pensar/config.json:
--model flag always overrides this setting.
Troubleshooting
Model not available
Model not available
Ensure the model is supported by your provider:Verify API key for the correct provider is set.
Poor pentesting results
Poor pentesting results
Try upgrading to a more capable model:
- Switch from GPT-4 to Claude:
--model claude-sonnet-4-5 - Switch from Sonnet to Opus:
--model claude-opus-4
Context length exceeded
Context length exceeded
Use a model with larger context window:
- Claude models: 200k tokens
- GPT-4: 128k tokens
Local model too slow
Local model too slow
For vLLM:
- Use GPU acceleration
- Enable quantization (8-bit, 4-bit)
- Use smaller models (7B or 13B instead of 70B)
Next Steps
AI Providers
Configure your AI provider API keys
Environment Variables
Complete configuration reference
vLLM Setup
Run models locally with vLLM
Run Pentest
Start testing with your selected model

