Skip to content

Models Reference

kicode supports any model available through OpenRouter. This page covers recommended models and how to choose the right one.

Default Model

The default model is:

x-ai/grok-code-fast-1

This was chosen for its balance of speed, cost, and coding capability.

For Coding Tasks

ModelIDStrengths
Claude 3.5 Sonnetanthropic/claude-3.5-sonnetBest overall coding, great reasoning
GPT-4 Turboopenai/gpt-4-turboBroad knowledge, long context
Grok Code Fastx-ai/grok-code-fast-1Fast, cost-effective
DeepSeek Coderdeepseek/deepseek-coderSpecialized for code

For Complex Reasoning

ModelIDStrengths
Claude 3 Opusanthropic/claude-3-opusMost capable, best reasoning
GPT-4openai/gpt-4Strong general reasoning

For Speed/Cost

ModelIDStrengths
Claude 3 Haikuanthropic/claude-3-haikuVery fast, low cost
GPT-3.5 Turboopenai/gpt-3.5-turboFast, cheap

Selecting a Model

Via CLI Flag

Terminal window
kicode --model anthropic/claude-3.5-sonnet

Via Environment Variable

Terminal window
export KICODE_MODEL="anthropic/claude-3.5-sonnet"
kicode

Via Config File

~/.config/kicode/config.toml
model = "anthropic/claude-3.5-sonnet"

Model ID Format

OpenRouter model IDs follow the format:

provider/model-name

Examples:

  • anthropic/claude-3.5-sonnet
  • openai/gpt-4-turbo
  • google/gemini-pro
  • meta-llama/llama-3-70b-instruct

Finding Available Models

Browse all available models at openrouter.ai/models.

Filter by:

  • Modality: Text (required for kicode)
  • Context Length: Longer is better for large codebases
  • Pricing: Cost per token

Model Comparison

Capability Tiers

TierExamplesBest For
FlagshipClaude 3 Opus, GPT-4Complex architecture, subtle bugs
BalancedClaude 3.5 Sonnet, GPT-4 TurboDay-to-day coding
FastClaude 3 Haiku, GPT-3.5Quick tasks, simple edits

Context Windows

ModelContext Length
GPT-4 Turbo128k tokens
Claude 3.5 Sonnet200k tokens
Claude 3 Opus200k tokens

Longer context = can handle more code at once.

Pricing Considerations

Costs vary significantly. Check current pricing at openrouter.ai/models.

General guidance:

  • Opus/GPT-4: Higher cost, use for complex tasks
  • Sonnet/Turbo: Moderate cost, good default
  • Haiku/3.5: Low cost, good for simple tasks

Choosing the Right Model

Use Claude 3.5 Sonnet When:

  • Writing new features
  • Debugging complex issues
  • Refactoring code
  • Understanding unfamiliar codebases

Use Claude 3 Opus When:

  • Designing system architecture
  • Solving subtle logic bugs
  • Need highest accuracy

Use Grok Code Fast When:

  • Quick edits and fixes
  • Simple code generation
  • Cost-conscious usage

Use Claude 3 Haiku When:

  • Very simple tasks
  • High-volume operations
  • Maximum speed needed

Switching Models Mid-Session

You cannot switch models during a session. To use a different model:

  1. Exit the current session
  2. Start a new session with the desired model
Terminal window
# Exit current session
you: exit
# Start with new model
kicode --model anthropic/claude-3-opus

Troubleshooting

”Unknown model” Error

The model ID is not recognized by OpenRouter.

Fix: Verify the model ID at openrouter.ai/models.

”Rate limited” Error

You’ve exceeded the model’s rate limit.

Fix: Wait a few seconds or try a different model.

”Insufficient credits” Error

Your OpenRouter account needs more credits.

Fix: Add credits at openrouter.ai/credits.