From a3fc639727a8a32b56ad46d730e2c7bb8d91d7f7 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Wed, 24 Sep 2025 07:52:58 -0400 Subject: [PATCH] feat: enhance custom params docs with Anthropic API compatibility with detailed parameter handling and implementation status --- .../object_structure/custom_params.mdx | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/pages/docs/configuration/librechat_yaml/object_structure/custom_params.mdx b/pages/docs/configuration/librechat_yaml/object_structure/custom_params.mdx index 1434e84..f64ecb2 100644 --- a/pages/docs/configuration/librechat_yaml/object_structure/custom_params.mdx +++ b/pages/docs/configuration/librechat_yaml/object_structure/custom_params.mdx @@ -36,4 +36,43 @@ endpoints: step: 0.1 default: 0.5 ``` -As a result, the `Temperature` slider will be limited to the range of `0.0` and `0.7` with step of `0.1`, and a default of `0.5`. The rest of the parameters will be set to their default values. \ No newline at end of file +As a result, the `Temperature` slider will be limited to the range of `0.0` and `0.7` with step of `0.1`, and a default of `0.5`. The rest of the parameters will be set to their default values. + +### Anthropic + +When using `defaultParamsEndpoint: 'anthropic'`, the system provides special handling that goes beyond just displaying and using Anthropic parameter sets: + + +**Anthropic API Compatibility** + +Setting `defaultParamsEndpoint: 'anthropic'` enables full Anthropic API compatibility for parameters, headers, and payload formatting: +- Parameters are sent to your custom endpoint exactly as the Anthropic API expects +- This is essential for proxy services like LiteLLM that pass non-OpenAI-spec parameters directly to the underlying provider +- Anthropic-specific parameters like `thinking` are properly formatted +- The `messages` payload is formatted according to Anthropic's requirements (thinking blocks and prompt caching) +- Appropriate beta headers are automatically added based on the model as when using Anthropic directly + + +This is mainly necessary to properly format the `thinking` parameter, which is not OpenAI-compatible: + +```json +{ + "thinking": { + "type": "enabled", + "budget_tokens": 10000 + } +} +``` + +Additionally, the system automatically adds model-specific Anthropic beta headers such as: +- `anthropic-beta: prompt-caching-2024-07-31` for prompt caching support +- `anthropic-beta: context-1m-2025-08-07` for extended context models +- Model-specific feature flags based on the Claude model being used + +This ensures full compatibility when routing through proxy services or directly to Anthropic-compatible endpoints. + + +**Implementation Status** + +Currently, this automatic parameter and header handling is fully implemented for Anthropic endpoints. Similar behavior for other `defaultParamsEndpoint` values (e.g., `google`, `bedrock`) is planned for future updates. + \ No newline at end of file