Fix: model_type not passed in ensure_tenant_model_id_for_params causing wrong tenant model lookup (#13782)

Summary

When setting a default model for an OpenAI-API-Compatible provider,
ensure_tenant_model_id_for_params called get_api_key
without a model_type filter. If the same model name was registered under
multiple types (e.g., both chat and embedding),
it could return the wrong tenant_llm_id, leading to Model(@None) not
authorized errors during chat.

This applies the same type-scoped fix that PR #13569 introduced in
get_model_config_by_type_and_name — now consistently
  in tenant_utils.py as well.

  Changes

  - Added _KEY_TO_MODEL_TYPE mapping in tenant_utils.py
- Each model key (llm_id, embd_id, etc.) now passes its correct LLMType
to get_api_key

  Fixes #13775
This commit is contained in:
Syed Shahmeer Ali
2026-04-13 17:57:28 +05:00
committed by GitHub
parent 356d45fda1
commit c7ce062ea8

Diff Content Not Available