-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add models import
command
#10581
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
Add models import
command
#10581
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
757cc6b
to
1dc0ceb
Compare
1dc0ceb
to
dd67030
Compare
Hmmm did unit tests not run? Because I just noticed they're failing for me locally 😄 |
Oh maybe because |
3e74b82
to
6a0ee95
Compare
OK I merged from |
Just pushed an empty commit to see if the CI reruns and is happier... |
to `models import` which only processes models where `litelllm_params.model` matches the regex
to `models import` which only processes models where at least one item in `model_info.access_groups` matches the regex. Add a unit test.
604dba0
to
2c85fef
Compare
Did some refactoring and rebased and removed the empty commit |
for better understandability and Intellisense
Cc: @ishaan-jaff |
@@ -109,6 +109,52 @@ Options: | |||
- `--param`, `-p`: Model parameters in key=value format (can be specified multiple times) | |||
- `--info`, `-i`: Model info in key=value format (can be specified multiple times) | |||
|
|||
#### Import Models | |||
|
|||
Import models from a YAML file: |
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.
Hey when would you want to import from a yaml?
I don't understand what the user is trying to achieve with this
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.
The use case is one I think I mentioned to you. We have a bunch of models in the YAML config for our self-hosted instance and this would help us bring them over to the cloud instance. The filtering options let us do it gradually.
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.
Hey @msabramo where does this porting from yaml to db happen in the code? from what i can see it gets appended to a model list, but i didn't see a /model/new call in this PR
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.
client.models.new
call
litellm/litellm/proxy/client/cli/commands/models.py
Lines 424 to 428 in ae367da
client.models.new( | |
model_name=model_info_obj.model_name, | |
model_params=model_info_obj.model_params, | |
model_info=model_info_obj.model_info, | |
) |
Add a
models import
command that can import models from a LiteLLM proxy YAML config file.This doesn't handle shared LLM credentials yet, which I'd like to eventually support.
Examples of usage
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🆕 New Feature
Changes