Skip to content

Commit 8218bd0

Browse files
authored
📒 docs: Add documentation for adding default params via custom params (#454)
1 parent 134aeca commit 8218bd0

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- Added `default` field to `customParams.paramDefinitions` for setting default parameter values
2+
- Allows specifying default values for parameters that are automatically applied when making API requests
3+
- Default values are only applied when the parameter is `undefined`
4+
- Follows priority order: `paramDefinitions.default` < `addParams` < `modelOptions` (user selections)
5+
- Example: Set `temperature: 0.7` as default, users can still override with their own values
6+
- Supports all parameter types including `web_search`, `temperature`, `topP`, `maxTokens`, etc.
7+
- Works with all `defaultParamsEndpoint` values (OpenAI, Anthropic, Google, etc.)
8+
- Useful for establishing baseline parameter values without requiring manual user configuration
9+
- See [Custom Parameters - Setting Default Parameter Values](/docs/configuration/librechat_yaml/object_structure/custom_params#setting-default-parameter-values) for details

‎pages/docs/configuration/librechat_yaml/object_structure/custom_params.mdx‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,40 @@ endpoints:
3838
```
3939
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.
4040

41+
### Setting Default Parameter Values
42+
43+
You can specify default values for parameters that will be automatically applied when making API requests. This is useful for setting baseline parameter values for your custom endpoint without requiring users to manually configure them each time.
44+
45+
The `default` field in `paramDefinitions` allows you to set default values that are applied when parameters are undefined. These defaults follow a priority order to ensure proper override behavior:
46+
47+
**Priority Order (lowest to highest):**
48+
1. **Default values from `paramDefinitions`** - Applied first when parameter is undefined
49+
2. **`addParams`** - Can override default values
50+
3. **User-configured `modelOptions`** - Highest priority, overrides everything
51+
52+
```yaml filename="excerpt of librechat.yaml"
53+
endpoints:
54+
custom:
55+
- name: 'My Custom LLM'
56+
apiKey: ...
57+
baseURL: ...
58+
customParams:
59+
defaultParamsEndpoint: 'openAI'
60+
paramDefinitions:
61+
- key: temperature
62+
default: 0.7
63+
- key: topP
64+
default: 0.9
65+
- key: maxTokens
66+
default: 2000
67+
```
68+
69+
In this example:
70+
- If a user doesn't specify `temperature`, it defaults to `0.7`
71+
- If a user explicitly sets `temperature` to `0.5`, their value (`0.5`) takes precedence
72+
- The `addParams` field (if configured) can override these defaults
73+
- User selections in the UI always have the highest priority
74+
4175
### Anthropic
4276

4377
When using `defaultParamsEndpoint: 'anthropic'`, the system provides special handling that goes beyond just displaying and using Anthropic parameter sets:

0 commit comments

Comments
 (0)