Skip to content

Commit fd8644d

Browse files
committed
backport Update litellm to fix bedrock models (onyx-dot-app#2649)
1 parent 0e6524d commit fd8644d

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

backend/danswer/llm/chat_llm.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,12 @@ def _completion(
290290
return litellm.completion(
291291
# model choice
292292
model=f"{self.config.model_provider}/{self.config.model_name}",
293-
api_key=self._api_key,
294-
base_url=self._api_base,
295-
api_version=self._api_version,
296-
custom_llm_provider=self._custom_llm_provider,
293+
# NOTE: have to pass in None instead of empty string for these
294+
# otherwise litellm can have some issues with bedrock
295+
api_key=self._api_key or None,
296+
base_url=self._api_base or None,
297+
api_version=self._api_version or None,
298+
custom_llm_provider=self._custom_llm_provider or None,
297299
# actual input
298300
messages=prompt,
299301
tools=tools,

backend/requirements/default.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jsonref==1.1.0
2828
langchain==0.1.17
2929
langchain-core==0.1.50
3030
langchain-text-splitters==0.0.1
31-
litellm==1.47.1
31+
litellm==1.48.7
3232
llama-index==0.9.45
3333
Mako==1.2.4
3434
msal==1.28.0

0 commit comments

Comments
 (0)