From c65e7aff86504a3386ed7ca137b8bc097439e2ce Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Fri, 25 Jul 2025 13:45:04 -0400 Subject: [PATCH] docs: mode temperature --- packages/web/src/content/docs/docs/modes.mdx | 45 ++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/packages/web/src/content/docs/docs/modes.mdx b/packages/web/src/content/docs/docs/modes.mdx index 97e9248e..d5c5c047 100644 --- a/packages/web/src/content/docs/docs/modes.mdx +++ b/packages/web/src/content/docs/docs/modes.mdx @@ -97,6 +97,51 @@ Use the `model` config to override the default model for this mode. Useful for u --- +### Temperature + +Control the randomness and creativity of the AI's responses with the `temperature` config. Lower values make responses more focused and deterministic, while higher values increase creativity and variability. + +```json title="opencode.json" +{ + "mode": { + "plan": { + "temperature": 0.1 + }, + "creative": { + "temperature": 0.8 + } + } +} +``` + +Temperature values typically range from 0.0 to 1.0: + +- **0.0-0.2**: Very focused and deterministic responses, ideal for code analysis and planning +- **0.3-0.5**: Balanced responses with some creativity, good for general development tasks +- **0.6-1.0**: More creative and varied responses, useful for brainstorming and exploration + +```json title="opencode.json" +{ + "mode": { + "analyze": { + "temperature": 0.1, + "prompt": "{file:./prompts/analysis.txt}" + }, + "build": { + "temperature": 0.3 + }, + "brainstorm": { + "temperature": 0.7, + "prompt": "{file:./prompts/creative.txt}" + } + } +} +``` + +If no temperature is specified, opencode uses model-specific defaults (typically 0 for most models, 0.55 for Qwen models). + +--- + ### Prompt Specify a custom system prompt file for this mode with the `prompt` config. The prompt file should contain instructions specific to the mode's purpose.