From 335742a0233fab724028487a5a908ed62779368d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 4 Feb 2025 09:46:26 -0800 Subject: [PATCH] copy --- aider/website/docs/config/reasoning.md | 82 ++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 aider/website/docs/config/reasoning.md diff --git a/aider/website/docs/config/reasoning.md b/aider/website/docs/config/reasoning.md new file mode 100644 index 000000000..39ab40153 --- /dev/null +++ b/aider/website/docs/config/reasoning.md @@ -0,0 +1,82 @@ +--- +parent: Configuration +nav_order: 110 +description: How to configure a reasoning models +--- + +# Reasoning models + +Many +"reasoning" models have restrictions on streaming and setting the temperature parameter. +Aider is configured to work properly with these models +when served through major provider APIs. + +You may need to [configure model settings](/docs/config/adv-model-settings.html) +if you are using them through another provider +and see errors related to temperature or system prompt. + +Include settings for your new provider in `.aider.model.setting.yml` file +at the root of your project or in your home directory. + +## Temperature, streaming and system prompt + +You should find one of the existing model setting configuration entries +for the model you are interested in, say o3-mini: + +```yaml +- name: o3-mini + edit_format: diff + weak_model_name: gpt-4o-mini + use_repo_map: true + use_temperature: false # <--- + editor_model_name: gpt-4o + editor_edit_format: editor-diff +``` + +Pay attention to these settings, which must be set to `false` +for certain reasoning models: + +- `use_temperature` +- `streaming` +- `use_system_prompt` + +Here's an example of +the settings to use o3-mini via Azure. +Note that aider already has these settings pre-configured, but they +serve as a good example of how to adapt the main model +settings for a different provider. + +```yaml +- name: azure/o3-mini + edit_format: diff + weak_model_name: azure/gpt-4o-mini + use_repo_map: true + use_temperature: false # <--- + editor_model_name: azure/gpt-4o + editor_edit_format: editor-diff +``` + +## Thinking tokens + +There is also a `remove_reasoning` setting, which takes the name of a tag. +This is used to remove everything inside that XML tag pair. + +When using DeepSeek R1 from Fireworks, the reasoning comes back inside +`...` tags, so aider's settings +include `remove_reasoning: think` to remove that part of the response. + +Aider will still *display* think reasoning output, it just won't use it +to find file editing instructions, etc. + +```yaml +- name: fireworks_ai/accounts/fireworks/models/deepseek-r1 + edit_format: diff + weak_model_name: fireworks_ai/accounts/fireworks/models/deepseek-v3 + use_repo_map: true + extra_params: + max_tokens: 160000 + use_temperature: false + editor_model_name: fireworks_ai/accounts/fireworks/models/deepseek-v3 + editor_edit_format: editor-diff + remove_reasoning: think # <--- +```