nic-6443 opened a new pull request, #13269:
URL: https://github.com/apache/apisix/pull/13269
## Description
This PR brings back the per-protocol `override.request_body` deep-merge
capability (from the predecessor of #13251) while keeping the provider-aware
`max_tokens` mapping — renamed to `override.llm_options`.
### Why
Users want both override mechanisms:
- **`llm_options`**: Simple, provider-aware `max_tokens` mapping (set one
value, APISIX maps it to the right field per provider). Always force-overwrites.
- **`request_body`**: Fine-grained, per-protocol deep-merge for arbitrary
fields like `temperature`, `stop_sequences`, `stream_options`, etc.
### Changes
- Rename `override.request_body` → `override.llm_options` (always
force-overwrites, no force flag)
- Restore `override.request_body` as per-protocol deep-merge keyed by target
protocol (`openai-chat`, `openai-responses`, etc.)
- Add `override.request_body_force_override` (boolean, controls request_body
deep-merge only)
- Precedence: `model_options` → `llm_options` → `request_body`
- Recreate `merge.lua` with force-aware `deep_merge`
- Restore `protocols.names()` for dynamic schema enum
### Config example
```json
{
"override": {
"llm_options": { "max_tokens": 500 },
"request_body": {
"openai-chat": { "temperature": 0.2, "stop": ["Human:"] },
"anthropic-messages": { "max_tokens": 500 }
},
"request_body_force_override": false
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]