mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +00:00
Merge pull request #781 from clalanliu/main
fix: fix bug for the case --model is not specified
This commit is contained in:
commit
8cedacfa2d
1 changed files with 2 additions and 5 deletions
|
@ -106,11 +106,8 @@ async def chat_completion(request: Request, model: Optional[str] = None):
|
||||||
try:
|
try:
|
||||||
data = await request.json()
|
data = await request.json()
|
||||||
print(f"data: {data}")
|
print(f"data: {data}")
|
||||||
data["model"] = (
|
server_model = server_settings.get("completion_model", None) if server_settings else None
|
||||||
server_settings.get("completion_model", None) # server default
|
data["model"] = server_model or model or data["model"]
|
||||||
or model # model passed in url
|
|
||||||
or data["model"] # default passed in
|
|
||||||
)
|
|
||||||
## CHECK KEYS ##
|
## CHECK KEYS ##
|
||||||
# default to always using the "ENV" variables, only if AUTH_STRATEGY==DYNAMIC then reads headers
|
# default to always using the "ENV" variables, only if AUTH_STRATEGY==DYNAMIC then reads headers
|
||||||
# env_validation = litellm.validate_environment(model=data["model"])
|
# env_validation = litellm.validate_environment(model=data["model"])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue