-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
Setting default model providers #421
Setting default model providers #421
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
@aws-khatria Thank you very much for circulating this pull request! Is this something that we should document in our user documentation? We already document some other options in the user docs. I can help with this if you need. |
Sure, I'll update the PR with doc details. Let me know if there are any other comments as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aws-khatria
Thanks for making this change. Can you rebase from main and fix the merge conflicts. Left some comments about using the model_parameters
for the fields and api_keys. Let me know if you have questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! There's a few changes that need to be done before this can be merged however.
8608b1e
to
b2e7c95
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looking OK; a couple of concerns about naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aws-khatria
Thanks for making all the updates, it looks like we are almost there. Left some naming suggestions, and a few questions.
I still have to test your changes locally, will be able to get to this by later this week; feel free to make the rest of the updates in the mean time.
@aws-khatria |
@aws-khatria
This is due to incorrect merge as pointed in my comments. Rather than doing a shallow merge, which overwrites the top level values directly, we should be using the merged_config = Merge.merge(default_config, existing_config) |
@3coins - I do agree with the deep merge. Somehow, it got messed up in merge conflict. Although, I think default's must be given priority over what's present in the config file. Consider this scenario:
Enterprise might have use-case where they want a default language model but user can change it via UI. In this case, if the server restarts then enterprise would expect user to have the default selected model. If this is not the case, then I would suggest adding |
@aws-khatria Changing the saved choice to the default on restart seems like an anti-pattern, a surprise for users that will need to be communicated appropriately to the user when the change happens. This also adds friction to users who will have to re-enter their choice of model on each restart, when they don't want default. My suggestion is to explore the |
@meeseeksdev please backport to 1.x |
Co-authored-by: aws-khatria <[email protected]>
* Setting default model providers * Setting default model providers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Setting default model providers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added default_ prefix to new attributes * Added default_ prefix to docs as well * Fix docs * Removed redundant code * Incorporated naming related comments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Removing unnecessary files * Corrected config names, simplified docs. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Piyush Jain <[email protected]>
* Setting default model providers * Setting default model providers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Setting default model providers * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added default_ prefix to new attributes * Added default_ prefix to docs as well * Fix docs * Removed redundant code * Incorporated naming related comments * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Removing unnecessary files * Corrected config names, simplified docs. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Piyush Jain <[email protected]>
* add failing test that asserts fields are included in lm_provider_params * fix lm_provider_params prop to include fields * fix bug that writes to `self.settings["model_parameters"]` * add test capturing bug introduced by #421 * pre-commit
This pull request introduces the setting of default model provider details in the Jupyter AI extension. The changes primarily involve extending the
ConfigManager
to initialize default values, andextension.py
to initialize the values from CLI. Fixes #218.The changes include:
api_keys
for corresponding model providerfields
in cases where model provider requires additional details to model provider.config.json
file exists. This is also tested using unit-test case.Testing:
The changes were tested manually by running the Jupyter AI extension and verifying that the default model provider is correctly.
In addition to manual testing, unit tests are also included in this commit. The tests cover the changes made to the
ConfigManager
class and ensure that the default model provider details are correctly set.These changes will improve the usability of the Jupyter AI extension by configuring the defaults for the model provider.
Command with which extension was tested:
Executed unit-test using
jlpm test
command.Next steps: