aider icon indicating copy to clipboard operation
aider copied to clipboard

Feature proposal: Add --profile for conditional config

Open jdanbrown opened this issue 2 months ago • 0 comments

I'd like to add a --profile cli flag to manage conditional configs.

  • Draft PR: https://github.com/Aider-AI/aider/pull/4601

One of the main reasons I use aider is to be able to easily switch between different models — because there are so many good ones! So my .aider.conf.yml ends up with bunch of multi-line blocks near the top that I have to manually go comment/uncomment to switch models, and I can't manage them with one --model flag because they often come with other releated settings (e.g. weak-model, thinking-tokens, edit-format):

# sonnet-4.5 (32k thinking)
model: openrouter/anthropic/claude-sonnet-4.5
weak-model: openrouter/anthropic/claude-haiku-4.5
edit-format: diff # Default: whole
thinking-tokens: 32k # Default: not set

# # gemini-2.5
# model: openrouter/google/gemini-2.5-pro
# weak-model: openrouter/google/gemini-2.5-flash

# # gpt-5 (openai)
# model: openai/gpt-5

# [Rest of config...]

So what I'd like to be able to do instead, to more easily switch between models and their related settings, is add a cli flag like aider --profile=sonnet that selects arbitrary config from a profiles section in the config file:

profiles:

  sonnet:
    # sonnet-4.5 (32k thinking)
    model: openrouter/anthropic/claude-sonnet-4.5
    weak-model: openrouter/anthropic/claude-haiku-4.5
    edit-format: diff # Default: whole
    thinking-tokens: 32k # Default: not set

  gemini:
    # gemini-2.5
    model: openrouter/google/gemini-2.5-pro
    weak-model: openrouter/google/gemini-2.5-flash

  gpt:
    # gpt-5 (openai)
    model: openai/gpt-5

# [Rest of config...]

Example usage:

$ aider
# Ignores profiles.* configs, behaves as usual

$ aider --profile=sonnet
# Adds all profiles.sonnet.* config to the rest of the config file, cli args, env, etc.

$ aider --profile=gemini
# Adds all profiles.gemini.* config to the rest of the config file, cli args, env, etc.

$ aider --profile=gpt
# Adds all profiles.gpt.* config to the rest of the config file, cli args, env, etc.

This way, switching between different model configs can be done with one user-defined cli flag instead of having to go comment/uncomment sections in the config file.

jdanbrown avatar Oct 21 '25 20:10 jdanbrown