#26170 [Bug] Ollama provider checks `litellm.api_base` global before explicit `api_base` kwarg (inconsistent with openai provider)
## Description
In `litellm/main.py`, the three Ollama-related provider blocks resolve `api_base` with the **global `litellm.api_base` before the explicit `api_base` kwarg**, while the openai provider (and every other major provider) resolve in the opposite order. This causes the explicit kwarg passed to `litellm.completion(...)` or `litellm.embedding(...)` to be silently overridden when `litellm.api_base` has been set by unrelated code earlier in the process.
## Affected code (current `litellm_internal_staging`)
- `litellm/main.py:3970` — ollama completion path - `litellm/main.py:3999` — ollama_chat completion path - `litellm/main.py:5318` — ollama embedding path
All three currently read:
```python api_base = ( litellm.api_base # global FIRST ← bug or api_base # explicit kwarg SECOND or get_secret("OLLAMA_API_BASE") or "http://localhost:11434" ) ```
Compare with the openai provider at `litellm/main.py:2038` and other occurrences — they all resolve kwarg first:
```python api_base = ( api_base # kwarg FIRST or litellm.api_base or get_secret("OPENAI_BASE_URL") or get_secret("OPENAI_API_BASE") or "…