fix(chat_completions): propagate temperature and parallel_tool_calls for custom providers#18483
Open
liuhao1024 wants to merge 1 commit into
Open
Conversation
…for custom providers - Set default temperature (0.2) for custom OpenAI-compatible providers to avoid llama.cpp's default of 1.0 - Enable parallel_tool_calls by default for custom providers to allow multi-tool queries in single turn - Add regression tests for both behaviors Fixes NousResearch#18470
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
parallel_tool_callsby default for custom providers to allow multi-tool queries in a single turn instead of serializing into N sequential turnsRoot Cause
Custom OpenAI-compatible providers (configured via
custom_providers) usechat_completionstransport. Two important request fields were not being propagated:temperature: The transport only sets temperature when
fixed_temperatureis provided (from_fixed_temperature_for_model()for specific cloud models). For custom providers,fixed_temperatureisNone, so no temperature field is sent. Backends like llama.cpp fall back to their default (often 1.0), causing factual drift on grounded tasks.parallel_tool_calls: The transport never sets this field for
chat_completionsmode (onlycodex.pyhardcodes it). Many local backends (llama.cpp, vLLM) require this field explicitly to enable batching tool calls; without it, multi-tool queries serialize into separate turns, incurring ~4× latency.Related Issue
N/A
Type of Change
Changes Made
How to Test
pytest tests/ -q— all tests should passChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture and workflows — or N/A