[Enhancement]: Customize Parameters for Custom Endpoints #7185
Replies: 12 comments 12 replies
-
@danny-avila is this meant to be suggested default settings or overrides? The linked PR changes the way model specs work and don't seem to be related? |
Beta Was this translation helpful? Give feedback.
-
I'd like to take a crack at this. |
Beta Was this translation helpful? Give feedback.
-
@nhtruong thanks! @mawburn there's a long discussion in the linked PR and this is the relevant comment: #6503 (review) This is not related to default settings or overrides, this would change what parameters appear and the user can choose from for custom endpoints: |
Beta Was this translation helpful? Give feedback.
-
Ok, but I don't think those are the same thing that @nhtruong created in his tickets, we are on the same team and were discussing this on Slack. We are looking for default parameters to be set per model or just globally for the project. Mostly things like Temp, because 1.0 temp is not a good setting to be default. I can see if this is rolled into what parameters are seen too, but they seem like separate concerns to me because default parameters should also apply to OpenAI endpoints. |
Beta Was this translation helpful? Give feedback.
-
For clarification, my original issue attempts to add something like this in the - name: 'Cohere'
...
addParams:
temperature:
- min_range: 0.2
- max_range: 0.7
- default: 0.6
- step: 0.1
top_p: 0.5 That setting will enforce the range for temperature when the user updates this parameter for Cohere or Cohere agents. The goal is allowing the admin to limit the range of this value but still give the user some wiggle room instead of a single overriden value. |
Beta Was this translation helpful? Give feedback.
-
I moved this to discussions since some clarification is needed. I think we're saying the same thing more or less, since customization of the parameters can limit the parameters and set defaults. I understand this as "parameter customization" or "dynamic parameters." All the mentioned refs fall into this one way or another: #6503, #7179, #7180 I guess we can make some distinctions though: I think the thing you want to tackle is A and then I can move on to B, C, since they would involve similar changes. I have a branch where I started on all 3, including something very similar to what @nhtruong is suggesting, but not via I will update that branch and push it up soon. |
Beta Was this translation helpful? Give feedback.
-
Thanks @danny-avila |
Beta Was this translation helpful? Give feedback.
-
No worries @nhtruong, I just realized I had already merged most of the changes I made. Please feel free to take over. I'm going to share some code that is hopefully valuable to get you started. Basically we can customize any of the parameters, both the UI and the backend, by making use of LibreChat/packages/data-provider/src/generate.ts Lines 52 to 82 in 5efad8f This structure is already being used for what we see in the UI now: LibreChat/client/src/components/SidePanel/Parameters/settings.ts Lines 10 to 13 in 5efad8f Our custom config would have to be transmitted to the client to make use of it in: There are 2 helper functions I already made, feel free to improve/adjust as needed. For validating the "SettingDefinition": For dynamic zod schema generation: The zod schemas are used to parse model parameters throughout the app. I tried to centralize this through the following functions: There may be a few places where the "endpoint schemas" are used individually, but it would just be a matter of cross-referencing the following: LibreChat/packages/data-provider/src/parsers.ts Lines 24 to 46 in 5efad8f |
Beta Was this translation helpful? Give feedback.
-
Thanks Danny and @nhtruong for tackling this! Really looking forward to this, especially B and C |
Beta Was this translation helpful? Give feedback.
-
I've just stumbled upon this discussion while trying to add configuration for the following use case:
As I understand it, with the existing configuration options, and even with the approach currently being discussed here, we'd need to create individual duplicated endpoint entries for each model default parameters that I wanted to configure right? That's probably not optimal but I guess it'd work, with several hiccups, e.g. we'd get menu entries for each duplicate endpoint, perhaps request tracking, api keys are not correctly tracked/duplicated in request tracking, etc. Thanks for any feedback! |
Beta Was this translation helpful? Give feedback.
-
Here's the progress update: If you add the following entry to - name: 'Google my Google'
apiKey: ...
baseURL: ...
models:
default:
[
'googlevertexai-us-central1:gemini-2.5-pro-preview-03-25',
'googlevertexai-us-central1:gemini-2.5-pro-exp-03-25',
'googlevertexai-us-central1:gemini-2.5-flash-preview-04-17',
]
fetch: false
titleConvo: true
titleModel: 'gpt-3.5-turbo'
summarize: false
modelDisplayLabel: 'Gemini'
customParams:
includeDefaultParams: [temperature]
paramDefinitions:
- key: atmospheric_pressure
type: number
component: slider
range:
min: 0
max: 0.7
step: 0.1
optionType: custom
default: 0.5
columnSpan: 4
- key: agent_name
type: string
component: input
default: ''
optionType: custom
columnSpan: 2
- key: agent_code
type: string
component: input
default: ''
optionType: custom
columnSpan: 2 the following parameters will be populated when editing an agent: There's still a lot of work left:
Here's the WIP Draft: #7225 |
Beta Was this translation helpful? Give feedback.
-
I'm almost done with part A, which is Customize/set-defaults for existing parameters. I just need to add more tests and tidy up my code. While working on this, I also added a small feature that lets user of custom endpoints pick the appropriate set of params for their endpoints. As of right now if you the following custom endpoints defined: # librechat.yaml
endpoints:
custom:
- name: 'Αnthropic'
# ...
- name: 'Google Gemini'
# ... The set of parameters available to both of these endpoints are identical. It inherits from OpenAI params, which doesn't make sense for neither Anthropic nor Google:With this new feature you can update the
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
What features would you like to see added?
Custom parameters for custom endpoints via librechat.yaml configuration, using existing parameters from other providers or brand new, dynamic ones
More details
See #6503, #7179, #7180
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions