|
@@ -761,6 +761,7 @@ async def generate_chat_completion(
|
|
|
form_data: GenerateChatCompletionForm,
|
|
|
url_idx: Optional[int] = None,
|
|
|
user=Depends(get_verified_user),
|
|
|
+ bypass_filter: Optional[bool] = False,
|
|
|
):
|
|
|
payload = {**form_data.model_dump(exclude_none=True)}
|
|
|
log.debug(f"generate_chat_completion() - 1.payload = {payload}")
|
|
@@ -769,7 +770,7 @@ async def generate_chat_completion(
|
|
|
|
|
|
model_id = form_data.model
|
|
|
|
|
|
- if app.state.config.ENABLE_MODEL_FILTER:
|
|
|
+ if not bypass_filter and app.state.config.ENABLE_MODEL_FILTER:
|
|
|
if user.role == "user" and model_id not in app.state.config.MODEL_FILTER_LIST:
|
|
|
raise HTTPException(
|
|
|
status_code=403,
|