fix: use provider-specific default base_url in BaseLLMReranker (Ollama gets localhost:11434, not OpenAI endpoint)#12405
Conversation
…lama (mindsdb#11952) When the Ollama reranker provider is used without an explicit base_url, the fallback was DEFAULT_LLM_ENDPOINT (https://api.openai.com/v1) — the OpenAI URL — which causes all Ollama reranker calls to fail with 404. Fix: use http://localhost:11434/v1 as the Ollama default, while keeping DEFAULT_LLM_ENDPOINT as the fallback for the standard OpenAI provider.
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
EntelligenceAI PR SummaryFixes gh-11952 by ensuring
Confidence Score: 4/5 - Mostly SafeSafe to merge — this PR correctly addresses the provider-specific default base URL bug in Key Findings:
Files requiring special attention
|
|
thank you!! can you please create a pull request in github.com/mindsdb/engine |
|
Sounds good! I'll port this over to the engine repo right now and link the new PR here once it's up. |
|
The PR is up on the engine repo here: mindsdb/engine#2 Closing this one out. Thanks again! |
Summary
Fixes #11952 —
BaseLLMRerankerusesDEFAULT_LLM_ENDPOINT(https://api.openai.com/v1) as the fallbackbase_urlfor all OpenAI-compatible providers, including Ollama. This means any user who configures an Ollama reranker without explicitly settingbase_urlgets their requests silently routed to the OpenAI endpoint, which fails with 404.Root Cause
In
BaseLLMReranker._init_client()the branch that handlesopenaiandollamaproviders always fell back to the same default:Fix
Use a provider-specific default so Ollama falls back to
http://localhost:11434/v1(the standard local Ollama endpoint), while theopenaiprovider retains its existingDEFAULT_LLM_ENDPOINTdefault:An explicit
base_urlis still respected in all cases.Tests Added
tests/unit/interfaces/knowledge_base/test_reranker_base_url.py— 5 parametrized cases covering:DEFAULT_LLM_ENDPOINT✓cc @MinuraPunchihewa @paxmaxei @kumpelblase2 — this is the remaining bug after the
settings.pydefault was corrected. Happy to address any feedback.