Skip to content

Fix: model selecton rule in get_model_config_by_type_and_name - #13569

Merged
yingfeng merged 2 commits into
infiniflow:mainfrom
Magicbook1108:vlm
Mar 13, 2026
Merged

yingfeng merged 2 commits into
infiniflow:mainfrom
Magicbook1108:vlm

Conversation

@Magicbook1108

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Fix: model selecton rule in get_model_config_by_type_and_name

Type of change

  • Bug Fix (non-breaking change which fixes an issue)

@Magicbook1108
Magicbook1108 marked this pull request as draft March 12, 2026 09:16
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 12, 2026
@Magicbook1108
Magicbook1108 marked this pull request as ready for review March 12, 2026 09:16
@Magicbook1108 Magicbook1108 added the ci Continue Integration label Mar 12, 2026
@dosubot dosubot Bot added the 🐞 bug Something isn't working, pull request that fix bug. label Mar 12, 2026
@yingfeng
yingfeng marked this pull request as draft March 12, 2026 09:49
@yingfeng
yingfeng marked this pull request as ready for review March 12, 2026 09:49
@codecov

codecov Bot commented Mar 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.72%. Comparing base (1815f59) to head (c263535).
⚠️ Report is 45 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #13569       +/-   ##
===========================================
+ Coverage   34.98%   46.72%   +11.74%     
===========================================
  Files          44       44               
  Lines        9934     9986       +52     
  Branches      110      111        +1     
===========================================
+ Hits         3475     4666     +1191     
+ Misses       6446     5303     -1143     
- Partials       13       17        +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yingfeng
yingfeng merged commit 161659b into infiniflow:main Mar 13, 2026
1 check passed
SyedShahmeerAli12 added a commit to SyedShahmeerAli12/ragflow that referenced this pull request Mar 25, 2026
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

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
SyedShahmeerAli12 added a commit to SyedShahmeerAli12/ragflow that referenced this pull request Apr 2, 2026
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
@Magicbook1108
Magicbook1108 deleted the vlm branch April 9, 2026 06:02
writinwaters pushed a commit to writinwaters/ragflow that referenced this pull request Apr 10, 2026
…flow#13569)

### What problem does this PR solve?

Fix: model selecton rule in get_model_config_by_type_and_name

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
SailedApple1991 pushed a commit to SailedApple1991/greenlaw-ragflow that referenced this pull request Apr 12, 2026
…flow#13569)

Fix: model selecton rule in get_model_config_by_type_and_name

- [x] Bug Fix (non-breaking change which fixes an issue)
yingfeng pushed a commit that referenced this pull request Apr 13, 2026
…ing 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
JasleenKaurSethi pushed a commit to stackhpc/ragflow that referenced this pull request Apr 28, 2026
…flow#13569)

### What problem does this PR solve?

Fix: model selecton rule in get_model_config_by_type_and_name

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants