mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-24 18:24:20 +00:00
fix: fix bug for the case --model is not specified
This commit is contained in:
parent
3239ec80c9
commit
6c17ab6e75
1 changed files with 2 additions and 5 deletions
|
@ -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"])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue