Temperature not passed in request body #1830

Closed
opened 2026-02-16 17:32:50 -05:00 by yindo · 8 comments
Owner

Originally created by @lucaorio on GitHub (Sep 25, 2025).

Originally assigned to: @thdxr on GitHub.

It appears that the temperature value is not being passed in the request body for this qwen3-coder agent. Am I getting anything wrong here? I was also wondering about "top_p": 1 appearing as a sensible default, but not present when using other models.

"build": {
  "mode": "primary",
  "model": "lmstudio/qwen3-coder-30b-a3b-instruct-mlx",
  "context": 8000,
  "output": 1000,
  "temperature": 0.1
}
 Received request: POST to /v1/chat/completions with body  {
  "model": "qwen3-coder-30b-a3b-instruct-mlx",
  "max_tokens": 32000,
  "top_p": 1,
  "context": 8000,
  "output": 1000,

BTW, the situation looks different for another agent running the gpt-oss model: temperature appears in the request, but not the top_p.

"plan": {
  "mode": "primary",
  "model": "lmstudio/openai/gpt-oss-20b",
  "context": 8000,
  "output": 1000,
  "temperature": 0.4,
  "prompt": "{file:./.prompts/prompt.md}"
}
Received request: POST to /v1/chat/completions with body  {
  "model": "openai/gpt-oss-20b",
  "max_tokens": 32000,
  "temperature": 0.4,
  "context": 8000,
  "output": 1000,
  ...
Originally created by @lucaorio on GitHub (Sep 25, 2025). Originally assigned to: @thdxr on GitHub. It appears that the `temperature` value is not being passed in the request body for this `qwen3-coder` agent. Am I getting anything wrong here? I was also wondering about `"top_p": 1` appearing as a sensible default, but not present when using other models. ```json "build": { "mode": "primary", "model": "lmstudio/qwen3-coder-30b-a3b-instruct-mlx", "context": 8000, "output": 1000, "temperature": 0.1 } ``` ``` Received request: POST to /v1/chat/completions with body { "model": "qwen3-coder-30b-a3b-instruct-mlx", "max_tokens": 32000, "top_p": 1, "context": 8000, "output": 1000, ``` --- BTW, the situation looks different for another agent running the `gpt-oss` model: `temperature` appears in the request, but not the `top_p`. ```json "plan": { "mode": "primary", "model": "lmstudio/openai/gpt-oss-20b", "context": 8000, "output": 1000, "temperature": 0.4, "prompt": "{file:./.prompts/prompt.md}" } ``` ``` Received request: POST to /v1/chat/completions with body { "model": "openai/gpt-oss-20b", "max_tokens": 32000, "temperature": 0.4, "context": 8000, "output": 1000, ... ```
yindo closed this issue 2026-02-16 17:32:50 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 25, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #174: [FEATURE] Update all models with temperature / top_p / max_tokens / other standard params - This addresses the exact same issue where temperature parameters are not being properly passed for different models
  • #2661: [Feature Request] plugin hook allowing modification of request body before it is sent - This discusses issues with request payload structure and missing parameters
  • #50: Feature: Model settings on an agent - This covers model-specific parameter configuration including temperature settings
  • #423: Context usage count is always 0 for some local openai-compatible providers - Similar issue with LM Studio and parameter handling

The core issue you're experiencing where temperature is missing from request bodies for certain models (like qwen3-coder) while appearing for others (like gpt-oss) appears to be a known limitation in how different model providers handle parameter mapping.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 25, 2025): This issue might be a duplicate of existing issues. Please check: - #174: [FEATURE] Update all models with temperature / top_p / max_tokens / other standard params - This addresses the exact same issue where temperature parameters are not being properly passed for different models - #2661: [Feature Request] plugin hook allowing modification of request body before it is sent - This discusses issues with request payload structure and missing parameters - #50: Feature: Model settings on an agent - This covers model-specific parameter configuration including temperature settings - #423: Context usage count is always 0 for some local openai-compatible providers - Similar issue with LM Studio and parameter handling The core issue you're experiencing where temperature is missing from request bodies for certain models (like qwen3-coder) while appearing for others (like gpt-oss) appears to be a known limitation in how different model providers handle parameter mapping. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Sep 25, 2025):

Can u share your opencode.json

and do you have any agent md definitions that could be causing conflicts

@rekram1-node commented on GitHub (Sep 25, 2025): Can u share your opencode.json and do you have any agent md definitions that could be causing conflicts
Author
Owner

@lucaorio commented on GitHub (Sep 25, 2025):

Thank you for getting back to me, @rekram1-node.

This is my entire opencode.json; it's quite empty, as you can see, since I just started setting things up last night!

{
  "$schema": "https://opencode.ai/config.json",
  "theme": "catppuccin",
  "provider": {
    "lmstudio": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Studio",
      "options": {
        "baseURL": "http://127.0.0.1:1234/v1"
      },
      "models": {
        "openai/gpt-oss-20b": {
          "name": "GPT-OSS-20b",
        },
        "qwen3-coder-30b-a3b-instruct-mlx": {
          "name": "Qwen3-Coder-30b",
        }
      }
    }
  },
  "agent": {
    "build": {
      "mode": "primary",
      "model": "lmstudio/qwen3-coder-30b-a3b-instruct-mlx",
      "context": 8000,
      "output": 1000,
      "temperature": 0.1
    },
    "plan": {
      "mode": "primary",
      "model": "lmstudio/openai/gpt-oss-20b",
      "context": 8000,
      "output": 1000,
      "temperature": 0.4,
    }
  }
}
@lucaorio commented on GitHub (Sep 25, 2025): Thank you for getting back to me, @rekram1-node. This is my entire `opencode.json`; it's quite empty, as you can see, since I just started setting things up last night! ```json { "$schema": "https://opencode.ai/config.json", "theme": "catppuccin", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio", "options": { "baseURL": "http://127.0.0.1:1234/v1" }, "models": { "openai/gpt-oss-20b": { "name": "GPT-OSS-20b", }, "qwen3-coder-30b-a3b-instruct-mlx": { "name": "Qwen3-Coder-30b", } } } }, "agent": { "build": { "mode": "primary", "model": "lmstudio/qwen3-coder-30b-a3b-instruct-mlx", "context": 8000, "output": 1000, "temperature": 0.1 }, "plan": { "mode": "primary", "model": "lmstudio/openai/gpt-oss-20b", "context": 8000, "output": 1000, "temperature": 0.4, } } } ```
Author
Owner

@rekram1-node commented on GitHub (Sep 25, 2025):

I'll check it out thx

@rekram1-node commented on GitHub (Sep 25, 2025): I'll check it out thx
Author
Owner

@lucaorio commented on GitHub (Sep 25, 2025):

Thanks! BTW, I just realized I haven't answered your second question: no agent md definitions outside of the config for now.

@lucaorio commented on GitHub (Sep 25, 2025): Thanks! BTW, I just realized I haven't answered your second question: no agent md definitions outside of the config for now.
Author
Owner

@fkukuck commented on GitHub (Oct 11, 2025):

@lucaorio have you tried adding temperature setting to your provided model?

{
  "$schema": "https://opencode.ai/config.json",
  "theme": "catppuccin",
  "provider": {
    "lmstudio": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LM Studio",
      "options": {
        "baseURL": "http://127.0.0.1:1234/v1"
      },
      "models": {
        "openai/gpt-oss-20b": {
          "name": "GPT-OSS-20b",
        },
        "qwen3-coder-30b-a3b-instruct-mlx": {
          "name": "Qwen3-Coder-30b",
          "temperature": true,
        }
      }
    }
  },
// ...
}
@fkukuck commented on GitHub (Oct 11, 2025): @lucaorio have you tried adding temperature setting to your provided model? ```jsonc { "$schema": "https://opencode.ai/config.json", "theme": "catppuccin", "provider": { "lmstudio": { "npm": "@ai-sdk/openai-compatible", "name": "LM Studio", "options": { "baseURL": "http://127.0.0.1:1234/v1" }, "models": { "openai/gpt-oss-20b": { "name": "GPT-OSS-20b", }, "qwen3-coder-30b-a3b-instruct-mlx": { "name": "Qwen3-Coder-30b", "temperature": true, } } } }, // ... } ```
Author
Owner

@rekram1-node commented on GitHub (Oct 11, 2025):

@lucaorio

I was also wondering about "top_p": 1 appearing as a sensible default, but not present when using other models.

This is because by default we set top_p to 1 for all qwen models, I forget exact reason but someone was showing how it was more effective rn qwen is the only one we do this for

As for why temperature works for openai/gpt-oss-20b but not qwen3-coder-30b-a3b-instruct-mlx this is because models.dev tracks the openai gpt 20b for lm studio currently and it properly defines "temperature": true

^^ I would actually recommend removing:

"openai/gpt-oss-20b": {
          "name": "GPT-OSS-20b",
        },

from your config since we track it on models.dev

As for temperature missing from qwen, @fkukuck nailed it, you need to set temperature: true for the model

@rekram1-node commented on GitHub (Oct 11, 2025): @lucaorio > I was also wondering about "top_p": 1 appearing as a sensible default, but not present when using other models. This is because by default we set top_p to 1 for all qwen models, I forget exact reason but someone was showing how it was more effective rn qwen is the only one we do this for As for why temperature works for `openai/gpt-oss-20b` but not `qwen3-coder-30b-a3b-instruct-mlx` this is because models.dev tracks the openai gpt 20b for lm studio currently and it properly defines "temperature": true ^^ I would actually recommend removing: ``` "openai/gpt-oss-20b": { "name": "GPT-OSS-20b", }, ``` from your config since we track it on models.dev As for temperature missing from qwen, @fkukuck nailed it, you need to set `temperature: true` for the model
Author
Owner

@rekram1-node commented on GitHub (Oct 11, 2025):

Lmk if u have more issues / questions, closing since this is expected as outlined above^

@rekram1-node commented on GitHub (Oct 11, 2025): Lmk if u have more issues / questions, closing since this is expected as outlined above^
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1830