litellm - 💡(How to fix) Fix [Bug]: Team-scoped model edit can overwrite public model name with internal model name

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

  1. PATCH the model using the shape sent by the dashboard edit form. The important part is that top-level model_name is the internal generated DB name:
curl -X PATCH \
  "$PROXY_BASE_URL/model/model-id-123/update" \
  -H "Authorization: Bearer $MASTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "model_name_test-team_abc123",
    "litellm_params": {
      "model": "azure/gpt-5.2-low-rpm-testing",
      "custom_llm_provider": "azure"
    },
    "model_info": {
      "id": "model-id-123",
      "team_id": "test-team",
      "team_public_model_name": "gpt-5.2-low-rpm-testing"
    }
  }'

_get_public_model_name() currently prefers patch_data.model_name:

Code Example

{
  "model_name": "model_name_test-team_abc123",
  "litellm_params": {
    "model": "azure/gpt-5.2-low-rpm-testing",
    "custom_llm_provider": "azure"
  },
  "model_info": {
    "id": "model-id-123",
    "db_model": true,
    "team_id": "test-team",
    "team_public_model_name": "gpt-5.2-low-rpm-testing"
  }
}

---

curl "$PROXY_BASE_URL/team/info?team_id=test-team" \
  -H "Authorization: Bearer $MASTER_KEY"

---

{
  "models": ["gpt-5.2-low-rpm-testing"]
}

---

curl -X PATCH \
  "$PROXY_BASE_URL/model/model-id-123/update" \
  -H "Authorization: Bearer $MASTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "model_name_test-team_abc123",
    "litellm_params": {
      "model": "azure/gpt-5.2-low-rpm-testing",
      "custom_llm_provider": "azure"
    },
    "model_info": {
      "id": "model-id-123",
      "team_id": "test-team",
      "team_public_model_name": "gpt-5.2-low-rpm-testing"
    }
  }'

---

curl "$PROXY_BASE_URL/v2/model/info?teamId=test-team" \
  -H "Authorization: Bearer $MASTER_KEY"

---

{
  "model_name": "model_name_test-team_abc123",
  "model_info": {
    "id": "model-id-123",
    "team_id": "test-team",
    "team_public_model_name": "model_name_test-team_abc123"
  }
}

---

curl "$PROXY_BASE_URL/team/info?team_id=test-team" \
  -H "Authorization: Bearer $MASTER_KEY"

---

{
  "models": ["model_name_test-team_abc123"]
}

---

def _get_public_model_name(patch_data, db_model) -> str:
    if patch_data.model_name:
        return patch_data.model_name

    if db_model.model_info and db_model.model_info.team_public_model_name:
        return db_model.model_info.team_public_model_name

    return db_model.model_name

---

{
  "model_name": "model_name_test-team_abc123",
  "model_info": {
    "id": "model-id-123",
    "team_id": "test-team",
    "team_public_model_name": "model_name_test-team_abc123"
  }
}

---

["model_name_test-team_abc123"]

---

["gpt-5.2-low-rpm-testing"]
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

When editing a team-scoped DB model through the LiteLLM dashboard model settings page, saving the form can silently reset model_info.team_public_model_name from the intended public model alias to the internal DB model name.

For team-scoped models, LiteLLM stores:

  • top-level model_name: an internal generated name like model_name_<team_id>_<uuid>
  • model_info.team_public_model_name: the public name users call, e.g. gpt-5.2-low-rpm-testing
  • team.models: includes the public name so team keys can call it

After saving a model edit, team_public_model_name was changed to the internal generated model_name_<team_id>_<uuid> value. The team ACL was also updated to remove the public name and add the internal name.

Actual result:

  • Calls using the intended public model name fail with team_model_access_denied
  • /v2/model/info?teamId=... shows model_info.team_public_model_name == model_name_<team_id>_<uuid>
  • /team/info?team_id=... shows models contains the internal UUID-suffix name instead of the public name

Expected result:

  • Editing LiteLLM params for a team-scoped model should preserve the existing model_info.team_public_model_name
  • The team ACL should continue to contain the public model name
  • The internal top-level model_name should not be treated as the team's public callable model name

Steps to Reproduce

  1. Create a team-scoped DB model with a public model name.

Example initial state:

{
  "model_name": "model_name_test-team_abc123",
  "litellm_params": {
    "model": "azure/gpt-5.2-low-rpm-testing",
    "custom_llm_provider": "azure"
  },
  "model_info": {
    "id": "model-id-123",
    "db_model": true,
    "team_id": "test-team",
    "team_public_model_name": "gpt-5.2-low-rpm-testing"
  }
}
  1. Confirm the team ACL includes the public model name:
curl "$PROXY_BASE_URL/team/info?team_id=test-team" \
  -H "Authorization: Bearer $MASTER_KEY"

Expected:

{
  "models": ["gpt-5.2-low-rpm-testing"]
}
  1. PATCH the model using the shape sent by the dashboard edit form. The important part is that top-level model_name is the internal generated DB name:
curl -X PATCH \
  "$PROXY_BASE_URL/model/model-id-123/update" \
  -H "Authorization: Bearer $MASTER_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "model_name_test-team_abc123",
    "litellm_params": {
      "model": "azure/gpt-5.2-low-rpm-testing",
      "custom_llm_provider": "azure"
    },
    "model_info": {
      "id": "model-id-123",
      "team_id": "test-team",
      "team_public_model_name": "gpt-5.2-low-rpm-testing"
    }
  }'
  1. Re-read model info:
curl "$PROXY_BASE_URL/v2/model/info?teamId=test-team" \
  -H "Authorization: Bearer $MASTER_KEY"

Actual result:

{
  "model_name": "model_name_test-team_abc123",
  "model_info": {
    "id": "model-id-123",
    "team_id": "test-team",
    "team_public_model_name": "model_name_test-team_abc123"
  }
}
  1. Re-read team info:
curl "$PROXY_BASE_URL/team/info?team_id=test-team" \
  -H "Authorization: Bearer $MASTER_KEY"

Actual result:

{
  "models": ["model_name_test-team_abc123"]
}
  1. A team key call using gpt-5.2-low-rpm-testing now fails with team_model_access_denied.

Suspected Cause

The issue appears to be in the team model update path.

_get_public_model_name() currently prefers patch_data.model_name:

def _get_public_model_name(patch_data, db_model) -> str:
    if patch_data.model_name:
        return patch_data.model_name

    if db_model.model_info and db_model.model_info.team_public_model_name:
        return db_model.model_info.team_public_model_name

    return db_model.model_name

For team-scoped DB models, patch_data.model_name can be the internal generated DB model name from the dashboard form. That value is then written to patch_data.model_info.team_public_model_name, and _update_existing_team_model_assignment() updates the team ACL from the old public name to the internal generated name.

The update path should not treat the internal generated top-level model_name as the public team model name.

Possible fixes:

  • If patch_data.model_name == db_model.model_name, preserve db_model.model_info.team_public_model_name
  • Or prefer explicit patch_data.model_info.team_public_model_name when present
  • Or prevent the dashboard from sending/editing the internal DB model name as the public name

Relevant log output

No proxy stack trace. The bug is a silent state mutation.

Observable state after the bad save:

{
  "model_name": "model_name_test-team_abc123",
  "model_info": {
    "id": "model-id-123",
    "team_id": "test-team",
    "team_public_model_name": "model_name_test-team_abc123"
  }
}

Team ACL after the bad save:

["model_name_test-team_abc123"]

Expected team ACL:

["gpt-5.2-low-rpm-testing"]

What part of LiteLLM is this about?

Proxy and UI Dashboard

What LiteLLM version are you on?

1.83.10

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - 💡(How to fix) Fix [Bug]: Team-scoped model edit can overwrite public model name with internal model name