-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support many:1 auth:provider mapping #929
base: main
Are you sure you want to change the base?
feat: support many:1 auth:provider mapping #929
Conversation
80e7639
to
a24b61d
Compare
@AlexsJones @bwplotka I've added initial code to facilitate *:1 auth:provider mapping. In this version, the AI backend configuration is stored in the following format: ai:
providers:
- backend: openai
configs:
- name: default
model: gpt-3.5-turbo
password: some-pass
temperature: 0.7
topp: 0.5
maxtokens: 2048
- name: New
model: gpt-3.5-turbo
password: pass
temperature: 0.7
topp: 0.5
maxtokens: 2048
defaultconfig: 0
- backend: localai
configs:
- name: New
model: gpt-3.5-turbo
temperature: 0.7
topp: 0.5
maxtokens: 2048
defaultconfig: 0
defaultprovider: ""
kubeconfig: ""
kubecontext: "" I plan to add another subcommand to the auth command to allow the user to set the default config name for each backend provider. Before I do that, I'd like to know if this is going in the right direction. |
a24b61d
to
59696a8
Compare
@AlexsJones I've updated the code to allow users to set the default config for an AI backend. However, I'm unsure how to proceed with the How about the following approach:
|
59696a8
to
1374995
Compare
@AlexsJones, this PR is ready for an initial review. Could you please take a look? Thanks in advance! |
@matthisholleville, could you please go through this PR whenever you have a moment? Thanks! |
1374995
to
241a712
Compare
@JuHyung-Son could you please take a look at this PR? Thanks! |
@AlexsJones ... |
Apologies, I missed this one @VaibhavMalik4187 Can you show me how you'd use a different configuration for a backend? |
3e12bbb
to
7c5ad16
Compare
No problem @AlexsJones. Sure, here we go:
I know that this is a very large change and hope these examples make things slightly easier to understand. |
Added the ability to add multiple configurations for the same backend provider. One to one auth:provider mapping had many bugs and users were requesting many to one auth:provider mapping functionality for more flexibility with backend provider configurations. This commit also includes the addition of an optional `--config-name` flag to allow users to specify the config-name while configuring backend AI providers. Changes exclusive to individual subcommands are: 1. default - `--config-name` flag has been added to allow users to update the default configuration for a backend AI provider. - Setting the `--config-name` flag will only update the default configuration for the specified backend, it will not update the `configAI.DefaultProvider`. - To update the `configAI.DefaultProvider`, user must leave the `--config-name` flag unset. 2. list - The list subcommand will now respect the value of `userInput` set when the user is asked to show password or not. - The command's output has been modified to display the backend providers list along with their configuration names. - Default configs for each backend AI provider are marked with the `(Default Config)` string in bright yellow color. 3. remove - Users can specify either single or multiple backends when removing the configurations. - If the `--config-name` flag is not set, the "default" configuration for the specified backend(s) will be removed(if it is present). - Setting the `--config-name` flag will specify the configuration name to delete for each of the specified backends. 4. Update - Now the user can only specify a single backend provider at a time. This has been done because updating multiple backend configs with same values of parameters doesn't make any sense. - Removal of the `Args` function because update subcommand can have multiple args to set different parameters for a backend config. - Users can also update the configuration name for an already existing config. Addresses: - k8sgpt-ai#936 - k8sgpt-ai#911 - k8sgpt-ai#905 - k8sgpt-ai#900 - k8sgpt-ai#843 Signed-off-by: VaibhavMalik4187 <[email protected]>
7c5ad16
to
088167a
Compare
I haven't tested it, but it looks good from the screenshots. �However I think we need to discuss if this change to enable multiple configs is really necessary. |
If we agree to move forward with this change, we'll also need to update the operator accordingly. |
Would we have to, or is this more about parity? |
I think it is necessary to include the |
Im not that sure we need to provide multiple auth keys. I think it's unnecessarily complicated and hinders the user experience a lot, and the user can just replace it with a different config via the |
Hmm, fair enough. In my opinion, these changes won'thinder the user experience but provide more flexible approach to setting the AI configurations. The worst part is this PR also fixes a bunch of issues other than many:1 auth provider mapping. |
📑 Description
Added the ability to add multiple configurations for the same backend
provider.
One to one auth:provider mapping had many bugs and users were requesting
many to one auth:provider mapping functionality for more flexibility
with backend provider configurations.
This commit also includes the addition of an optional
--config-name
flag to allow users to specify the config-name while configuring backend
AI providers.
Changes exclusive to individual subcommands are:
--config-name
flag has been added to allow users to update thedefault configuration for a backend AI provider.
--config-name
flag will only update the defaultconfiguration for the specified backend, it will not update the
configAI.DefaultProvider
.configAI.DefaultProvider
, user must leave the--config-name
flag unset.userInput
setwhen the user is asked to show password or not.
providers list along with their configuration names.
(Default Config)
string in bright yellow color.removing the configurations.
--config-name
flag is not set, the "default" configurationfor the specified backend(s) will be removed(if it is present).
--config-name
flag will specify the configuration nameto delete for each of the specified backends.
This has been done because updating multiple backend configs with
same values of parameters doesn't make any sense.
Args
function because update subcommand can havemultiple args to set different parameters for a backend config.
config.
Addresses:
✅ Checks