feat: add multi-model support and environment variable API keys #106
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds support for using different LLM models for planning vs code implementation phases, along with environment variable support for API keys. It also refactors duplicated code into shared utility functions.
Related Issues
Changes Made
Features
planning_modelandimplementation_modelconfig options for all providers (Google, Anthropic, OpenAI)GOOGLE_API_KEY,ANTHROPIC_API_KEY,OPENAI_API_KEYenvironment variablesmcp_agent.secrets.yamlvalues.env.exampletemplate for easy setupRefactoring
get_api_keys()andload_api_config()functions inutils/llm_utils.pyanthropicandopenaipackages to make them optional dependenciesbravesearch server references, use config-basedsearch_server_namesConfig Changes
planning_modelandimplementation_modeloptions for google, anthropic, and openai sectionsmcp_agent.secrets.yamlto.gitignore(users should use.envinstead)Checklist
Additional Notes
Breaking Changes: None. All changes are backward compatible - existing configurations continue to work.
Migration: Users can optionally:
.env.exampleto.envand add their API keys thereplanning_modelandimplementation_modelto their config if they want different models for each phaseExample config:
google:
default_model: "gemini-3-pro-preview"
planning_model: "gemini-3-pro-preview" # Used for analysis
implementation_model: "gemini-2.5-flash" # Used for code generation