Model selection
CodeSpeak uses Anthropic's models for code generation and other tasks.
By default, it uses the sonnet model, which is optimized for cost/effectiveness.
However, you can configure which model(s) CodeSpeak uses through environment variables, for example:
CODESPEAK_ANTHROPIC_STANDARD_MODEL=claude-opus-4-6 codespeak buildThe following variables control model selection for different roles:
| Environment variable | Use case | Default |
|---|---|---|
CODESPEAK_ANTHROPIC_STANDARD_MODEL | Code generation (build, impl, change) | latest Sonnet |
CODESPEAK_ANTHROPIC_FAST_MODEL | Fast tasks (Claude Code mode, LLM judge) | latest Haiku |
CODESPEAK_ANTHROPIC_GENERAL_CONVERSATION_MODEL | Interactive conversation | Same as standard model |
CODESPEAK_ANTHROPIC_LLM_JUDGE_MODEL | LLM-as-judge evaluations | Same as fast model |
If only CODESPEAK_ANTHROPIC_STANDARD_MODEL is set, it applies to all use cases that default to it. The fast and judge models fall back independently.
Alternative model providers
⚠️ Support for alternative model providers is experimental. Please use at your own risk and report any issues to our Discord. Thank you!
CodeSpeak lets you configure Anthropic-compatible model providers. Set the ANTHROPIC_BASE_URL environment variable:
export ANTHROPIC_BASE_URL="https://api.z.ai/api/anthropic"
export ANTHROPIC_API_KEY="your-zai-api-key"Make sure your API key configuration is not interfering — alternative providers use their own keys.
Set ANTHROPIC_API_KEY to the alternative provider's key. Make sure that your .env.local or other config files don't have conflicting keys.
The following providers are currently supported (in experimental mode):
| Provider | Base URL |
|---|---|
| Z.ai | https://api.z.ai/api/anthropic |
| Moonshot AI | https://api.moonshot.ai/anthropic |
| MiniMax | https://api.minimax.io/anthropic |
| DeepSeek | https://api.deepseek.com/anthropic |
| Alibaba Cloud (DashScope) | https://dashscope-intl.aliyuncs.com/apps/anthropic |
| OpenRouter | https://openrouter.ai/api |
If your preferred provider is not listed, feel free to contact us on Discord.