Skip to content
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

[Feature]: All model_group_alias should show up in /models,/model/info,/model_group/info #5524

Closed
taralika opened this issue Sep 5, 2024 · 8 comments · Fixed by #5539 or #5658
Closed
Assignees
Labels
enhancement New feature or request

Comments

@taralika
Copy link
Contributor

taralika commented Sep 5, 2024

The Feature

When the proxy-config.yaml has:

router_settings:
  model_group_alias: {"alias-1": "model-group-1"}
model_list:
  - model_name: model-group-1
    litellm_params:
      model: azure/gpt-1
      api_base: https://xyz1.openai.azure.com/
      api_key: os.environ/AOAI_KEY
  - model_name: model-group-1
    litellm_params:
      model: azure/gpt-2
      api_base: https://xyz2.openai.azure.com/
      api_key: os.environ/AOAI_KEY

Response for GET /models should look like this:

{
      "id": "model-group-1",
      "object": "model",
      "created": 1677610602,
      "owned_by": "openai"
},
{
      "id": "alias-1",
      "object": "model",
      "created": 1677610602,
      "owned_by": "openai"
}

Response for GET /model/info should look like this:

{
      "model_name": "model-group-1",
      "litellm_params": {
        "api_base": "https://xyz1.openai.azure.com/",
        "model": "azure/gpt-1"
      },
      "model_info": {
        "id": "8eefdf61e375ace21356414a23782159e703c6afe66eb7b46a3a17a2095f53b1",
        "db_model": false,
        "key": "azure/gpt-1",
        ...
      }
},
{
      "model_name": "model-group-1",
      "litellm_params": {
        "api_base": "https://xyz2.openai.azure.com/",
        "model": "azure/gpt-2"
      },
      "model_info": {
        "id": "8eefdf61e375ace21356414a23782159e703c6afe66eb7b46a3a17a2095f53b1",
        "db_model": false,
        "key": "azure/gpt-2",
        ...
      }
},
{
      "model_name": "alias-1",
      "litellm_params": {
        "api_base": "https://xyz1.openai.azure.com/",
        "model": "azure/gpt-1"
      },
      "model_info": {
        "id": "8eefdf61e375ace21356414a23782159e703c6afe66eb7b46a3a17a2095f53b1",
        "db_model": false,
        "key": "azure/gpt-1",
        ...
      }
},
{
      "model_name": "alias-1",
      "litellm_params": {
        "api_base": "https://xyz2.openai.azure.com/",
        "model": "azure/gpt-2"
      },
      "model_info": {
        "id": "8eefdf61e375ace21356414a23782159e703c6afe66eb7b46a3a17a2095f53b1",
        "db_model": false,
        "key": "azure/gpt-2",
        ...
      }
}

Response for GET /model_group/info should look like:

{
  "model_group": "model-group-1",
      "providers": [
        "azure"
      ],
      ...
},
{
  "model_group": "alias-1",
      "providers": [
        "azure"
      ],
      ...
}

Motivation, pitch

Users of litellm proxy have no idea what aliases are available, they can only see the model group names. Please expose the aliases at same level as model group names so users of the litellm proxy can take advantage of the aliases as well.

Twitter / LinkedIn details

No response

@taralika taralika added the enhancement New feature or request label Sep 5, 2024
@krrishdholakia krrishdholakia self-assigned this Sep 5, 2024
@krrishdholakia
Copy link
Contributor

Hey @taralika curious - why do you use model_group_alias?

Context - trying to understand our users better

@taralika
Copy link
Contributor Author

taralika commented Sep 5, 2024

why do you use model_group_alias?

for various reasons:

  1. to align model names between usage from within litellm proxy and outside of proxy (directly to provider)
  2. to provide open-ai style model names that always point to current model version (and litellm proxy admin controls/updates this to point to new version when it comes out)

@krrishdholakia
Copy link
Contributor

This is now live on v1.44.21

@taralika
Copy link
Contributor Author

taralika commented Sep 7, 2024

@krrishdholakia after upgrading to v1.44.21 our health checks have started failing. The issue I think is you're treating "model-group-1" itself as a model and including "model-group-1"in list of models with empty model_info and also performing health check on "model-group-1". Instead, you should look up all models underneath "model-group-1" and add them as models under model group "alias-1" and just perform health check once on these models.

You may want to revert this first and hotfix 1.44.21 as others who have aliases will also start seeing health checks fail.

@krrishdholakia
Copy link
Contributor

@taralika when you say health checks do you mean calling /health?

@taralika
Copy link
Contributor Author

taralika commented Sep 7, 2024

@taralika when you say health checks do you mean calling /health?

yes

@krrishdholakia
Copy link
Contributor

Got it - i'll push a fix + add a test for this to our ci/cd flow @taralika

krrishdholakia added a commit that referenced this issue Sep 10, 2024
* fix(litellm_logging.py): set completion_start_time_float to end_time_float if none

Fixes #5500

* feat(_init_.py): add new 'openai_text_completion_compatible_providers' list

Fixes #5558

Handles correctly routing fireworks ai calls when done via text completions

* fix: fix linting errors

* fix: fix linting errors

* fix(openai.py): fix exception raised

* fix(openai.py): fix error handling

* fix(_redis.py): allow all supported arguments for redis cluster (#5554)

* Revert "fix(_redis.py): allow all supported arguments for redis cluster (#5554)" (#5583)

This reverts commit f2191ef.

* fix(router.py): return model alias w/ underlying deployment on router.get_model_list()

Fixes #5524 (comment)

* test: handle flaky tests

---------

Co-authored-by: Jonas Dittrich <58814480+Kakadus@users.noreply.github.com>
@taralika
Copy link
Contributor Author

hi @krrishdholakia is this fixed now? I tried v1.44.24 and I can see the "alias-1" in GET /models call, and I also see this alias doesn't show up in GET /health call - so that's great. But what's still missing is that GET /model/info has no mention of "alias-1" - as mentioned in description of this ticket, we'll need this so clients know what models are under this alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants