MyCoder supports Grok models from xAI as an alternative to Anthropic's Claude models. This integration is experimental and may require additional configuration based on your access to the Grok API.
To use Grok models, you need to:
- Set your XAI API key
- Configure MyCoder to use the xai provider
- Specify a Grok model
mycoder config set XAI_API_KEY your-xai-api-key
Alternatively, you can set the XAI_API_KEY
environment variable:
export XAI_API_KEY=your-xai-api-key
To use Grok as your default provider:
mycoder config set provider xai
MyCoder supports various Grok models:
# For Grok 2
mycoder config set model grok-2-1212
# For Grok 2 with vision capabilities
mycoder config set model grok-2-vision-1212
# For other available models
mycoder config set model grok-beta
mycoder config set model grok-vision-beta
You can also use Grok for a single command without changing your default configuration:
mycoder --provider xai --model grok-2-1212 "Your prompt here"
The Grok integration supports all MyCoder features, including:
- Tool usage for complex operations
- Sub-agent spawning for parallel tasks
- GitHub mode for working with issues and PRs
- All file and shell operations
If you encounter issues with the Grok integration, check the following:
- Ensure your API key is correct and has sufficient permissions
- Verify that you're using a valid model name
- Check that your account has access to the specified model
- Ensure your API key has not expired or been revoked
- Verify that your Grok API access is fully set up
Note: The Grok API is still evolving, and the integration uses the Anthropic-compatible API format. If you encounter 404 errors, it may indicate that your API access needs to be configured differently or that the API endpoints have changed.
For more detailed logs, run MyCoder with increased verbosity:
mycoder --logLevel debug "Your prompt here"
Different models have different strengths:
- grok-2-1212: General-purpose model with strong coding capabilities
- grok-2-vision-1212: Supports image processing in addition to text
- grok-beta: Earlier version of Grok, may be more suitable for simpler tasks
- grok-vision-beta: Earlier vision-capable model
Experiment with different models to find the one that works best for your specific use case.