fix(vision): pass auxiliary.vision provider/model/base_url/api_key to async_call_llm - #57286
fix(vision): pass auxiliary.vision provider/model/base_url/api_key to async_call_llm#57286HalfRui wants to merge 1 commit into
Conversation
… async_call_llm vision_analyze silently fell back to the chat default model when the user configured a different provider under auxiliary.vision. The call_kwargs dict only forwarded the model arg when explicitly passed by the caller; provider, base_url, and api_key were never read from config at all. async_call_llm then resolved the call via its internal main-chat fallback, which uses the chat default backend - so a user with e.g. a Chinese-vision provider under auxiliary.vision saw a 400 unknown model <chat default> from the vision endpoint. Read the full auxiliary.vision block and pass provider, model, base_url, and api_key into call_kwargs. The explicit caller-supplied model still wins to preserve existing programmatic-call behavior. The video_url path is left as-is to keep this PR minimal; happy to extend if maintainers want symmetry. Repro: configure auxiliary.vision to a non-chat provider, call vision_analyze with any image. Before: 400 unknown model <chat default>. After: correct vision result.
|
Closing — the premise doesn't reproduce on current main. Separately, duplicating the If you still hit the wrong-model failure on current main, please open a fresh issue with the exact config and the resolved endpoint logged — happy to dig in. Thanks! |
Summary
vision_analyzesilently ignores the user'sauxiliary.visionprovider/model/base_url/api_key configuration and falls back to the chat default model — so vision breaks for any user with a non-default vision backend (e.g. a domestic Chinese provider, a dedicated vision endpoint, or any model the chat default backend doesn't recognize).The visible symptom is a 400 error from the vision backend like:
…even though
auxiliary.vision.modelis set to something else inconfig.yaml.Root cause
In
tools/vision_tools.py, thecall_kwargsdict passed toasync_call_llm(task="vision", ...)only setsmodelwhen an explicitmodelparameter is supplied by the caller. It never readsprovider,base_url, orapi_keyfromauxiliary.visionconfig at all. Soasync_call_llmfalls through to its internal default resolution, which uses the main chat model on the main chat endpoint, instead of the user's configured vision backend.Fix
Read the full
auxiliary.visionconfig block and passprovider,model,base_url, andapi_keyintocall_kwargsexplicitly. The explicitmodelparameter (when called programmatically) still wins, matching existing behavior.Reproduction
Then call
vision_analyzewith any image. Before the fix:400 unknown model 'deepseek-v4-flash'(the chat default). After the fix: correct vision result.Test plan
auxiliary.visionto a non-chat providervision_analyzewith a public imagesuccess: trueand accurate descriptionmodelarg to_run_vision(when called programmatically) still overrides configNotes
video_urlpath (line 1614 in v0.18.0's installed copy) has the same shape but a different fallback chain — I left it alone to keep this PR minimal. Happy to extend if the maintainers want symmetry.auxiliary.visionis unset, behavior is unchanged.