#25567 [Bug]: Ollama get_model_info constructs redundant path .../api/chat/api/show, causing 404s on remote instances
### Check for existing issues
- [x] I have searched the existing issues and checked that my issue is not a duplicate.
### What happened?
#### Description
In litellm/llms/ollama/completion/transformation.py, the get_model_info method incorrectly uses a "polluted" api_base that already contains a provider suffix (like /api/chat), resulting in malformed URLs like: http://<IP>:11434/api/chat/api/show
This causes 404 errors for background tasks like cost calculation or capability checking, especially when Ollama is running on a remote host.
#### Proposed Fix The issue is in ```litellm/llms/ollama/completion/transformation.py``` within the get_model_info method. The api_base can be sanitized with the following logic:
```python # Strip existing provider suffixes from api_base before appending /api/show sanitized_base = api_base.rstrip("/") for suffix in ["/api/chat", "/api/generate"]: if sanitized_base.endswith(suffix): sanitized_base = sanitized_base[:-len(suffix)] url = f"{sanitized_base}/api/show" ```
### Steps to Reproduce
1. Configure LiteLLM to use a remote Ollama instance via OLLAMA_API_BASE. 2. Use the ollama_chat/ provider. 3. Trigger a completion. 4. Observe…