DeepSeek
DeepSeek offers highly cost-effective AI models with strong reasoning capabilities, making it an excellent choice for budget-conscious usage.
Setup
-
Get an API Key
Visit platform.deepseek.com to create an account and generate an API key.
-
Set Environment Variable
Terminal window export DEEPSEEK_API_KEY=sk-...Or add to your
.envfile:DEEPSEEK_API_KEY=sk-... -
Configure Codemetry
config/codemetry.php 'ai' => ['enabled' => true,'engine' => 'deepseek','model' => null, // Uses deepseek-chat by default], -
Run Analysis
Terminal window php artisan codemetry:analyze --days=7 --ai=1 --ai-engine=deepseek
Available Models
| Model | Default | Cost | Quality | Speed |
|---|---|---|---|---|
deepseek-chat | ✓ | Very Low | Good | Fast |
deepseek-reasoner | Low | Better | Medium |
Choosing a Model
For routine analysis: Use deepseek-chat (default)
- Extremely cost-effective
- Good quality for metric explanations
- Fast response times
For deeper analysis: Use deepseek-reasoner
- Enhanced reasoning capabilities
- Better at complex pattern analysis
- Still very affordable
# Override model for single runphp artisan codemetry:analyze --days=7 --ai=1 --ai-engine=deepseek --ai-model=deepseek-reasonerOr in configuration:
'ai' => [ 'engine' => 'deepseek', 'model' => 'deepseek-reasoner',],API Key Options
Codemetry checks for API keys in this order:
CODEMETRY_AI_API_KEY— Unified key for any engineDEEPSEEK_API_KEY— DeepSeek-specific key
# Option 1: Unifiedexport CODEMETRY_AI_API_KEY=sk-...
# Option 2: Engine-specificexport DEEPSEEK_API_KEY=sk-...Cost Management
DeepSeek offers some of the lowest API pricing available:
Estimated costs per 30-day analysis:
| Model | Input | Output | Total |
|---|---|---|---|
| deepseek-chat | ~$0.001 | ~$0.002 | ~$0.003 |
| deepseek-reasoner | ~$0.002 | ~$0.004 | ~$0.006 |
This makes DeepSeek approximately 5-10x cheaper than comparable models from other providers.
Why Choose DeepSeek?
Advantages:
- Extremely low cost
- Good quality for structured tasks
- Fast response times
- OpenAI-compatible API format
Considerations:
- Newer provider, less established
- May have occasional availability issues
- Quality can vary compared to premium models
For Codemetry’s use case (explaining structured metrics), DeepSeek performs very well at a fraction of the cost.
Troubleshooting
”Invalid API key”
Cause: API key is incorrect or expired.
Solution:
- Verify key at platform.deepseek.com
- Check for typos
- Regenerate key if needed
”Connection timeout”
Cause: Network issues or API availability.
Solution:
- Check your network connectivity
- Retry after a few seconds
- Check DeepSeek status page
”Insufficient balance”
Cause: API credit balance exhausted.
Solution:
- Add credits to your DeepSeek account
- Check usage in dashboard
Lower Quality Responses
Symptom: AI summaries seem less detailed or insightful.
Solution:
- Try
deepseek-reasonerfor better quality - Consider using a different engine for critical analyses
- DeepSeek works well for routine use; use premium models for investigations