Update litellm/llms/ollama/completion/transformation.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Monesh Ram 2026-03-26 13:40:37 +05:30 committed by GitHub
parent bd89cbf3ac
commit 65da14e6bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -238,7 +238,7 @@ class OllamaConfig(BaseConfig):
)
# Strip /api/chat suffix if present (same logic as get_complete_url in chat/transformation.py)
if api_base.endswith("/api/chat"):
api_base = api_base[:-10]
api_base = api_base[:-9]
api_key = self.get_api_key()
headers = {"Authorization": f"Bearer {api_key}"} if api_key else {}