mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-16 08:17:51 +00:00
Merge pull request #781 from clalanliu/main
fix: fix bug for the case --model is not specified
This commit is contained in:
@@ -106,11 +106,8 @@ async def chat_completion(request: Request, model: Optional[str] = None):
|
||||
try:
|
||||
data = await request.json()
|
||||
print(f"data: {data}")
|
||||
data["model"] = (
|
||||
server_settings.get("completion_model", None) # server default
|
||||
or model # model passed in url
|
||||
or data["model"] # default passed in
|
||||
)
|
||||
server_model = server_settings.get("completion_model", None) if server_settings else None
|
||||
data["model"] = server_model or model or data["model"]
|
||||
## CHECK KEYS ##
|
||||
# default to always using the "ENV" variables, only if AUTH_STRATEGY==DYNAMIC then reads headers
|
||||
# env_validation = litellm.validate_environment(model=data["model"])
|
||||
|
||||
Reference in New Issue
Block a user