Repository navigation
Fix: model_type not passed in ensure_tenant_model_id_for_params causing wrong tenant model lookup - #13782
Merged
yingfeng merged 1 commit intoApr 13, 2026
Conversation
yingfeng
marked this pull request as draft
March 26, 2026 13:15
yingfeng
marked this pull request as ready for review
March 26, 2026 13:15
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13782 +/- ##
===========================================
+ Coverage 49.52% 96.52% +46.99%
===========================================
Files 45 10 -35
Lines 9657 690 -8967
Branches 112 108 -4
===========================================
- Hits 4783 666 -4117
+ Misses 4864 8 -4856
- Partials 10 16 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
When the same model name exists for multiple types (common with
OpenAI-API-Compatible providers), calling get_api_key without a
model_type filter could return the wrong tenant_llm_id, causing the
tenant_{key} columns to reference an incorrect model type.
This is the same class of bug fixed in PR infiniflow#13569 for
get_model_config_by_type_and_name, now applied consistently to
ensure_tenant_model_id_for_params in tenant_utils.py.
Fixes infiniflow#13775
SyedShahmeerAli12
force-pushed
the
fix/ensure-tenant-model-type-filter
branch
from
April 2, 2026 14:52
3bde268 to
f937f68
Compare
JasleenKaurSethi
pushed a commit
to stackhpc/ragflow
that referenced
this pull request
Apr 28, 2026
…ing wrong tenant model lookup (infiniflow#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 infiniflow#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 infiniflow#13775
tmimmanuel
pushed a commit
to tmimmanuel/ragflow
that referenced
this pull request
May 14, 2026
…ing wrong tenant model lookup (infiniflow#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 infiniflow#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 infiniflow#13775
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Fixes #13775