-
-
Notifications
You must be signed in to change notification settings - Fork 468
Description
Problem
We need a new React component in the Jupyter AI settings page that allows a user to add arbitrary model parameters. Each model parameter will be a keyword argument passed to LiteLLM.
Proposed Solution
Build a <ModelParametersInput /> component, which will:
- Show just a "Add a custom model parameter" button initially.
- After clicking that button, there should a new input for the parameter name (e.g.
temperatureorapi_url), parameter type (e.g.floatorstring), and parameter value (e.g.0.7orhttps://localhost:8989). These should appear as 3 text fields on the same line. - After clicking that button, there should also be a new button that says "Save Model Parameters". For now, this button can just log the JSON object of its input state to the browser console.
- A validation error should be emitted if the user specifies a parameter value but does not specify its type or its name. If a user specifies an empty parameter value, it should be ignored entirely, regardless of the type or name inputs.
- The "Add a model parameter" button should still show after the user clicks it once, i.e. users should be able to add any number of model parameters.
Additional context
-
Stretch goal: There are some fields which are standard to all models. It would be nice to be able to define "static parameters" whose name & type are fixed. This would be useful for basic parameters like
temperature: floatandapi_url: string. Maybe these can be shown after a user clicks a different button like "Specify API URL" above/ under "Add a custom model parameter"? -
Feel free to change the UI to your liking. I do not know the best UI for this, and what I've suggested is just my best initial guess at what should exist long-term. If you can build a better / more usable UI, please feel free to include it in your PR.