💻 Code: Add log display for model not found.
Browse files
main.py
CHANGED
@@ -879,7 +879,7 @@ async def get_right_order_providers(request_model, config, api_index, scheduling
|
|
879 |
matching_providers = get_matching_providers(request_model, config, api_index)
|
880 |
|
881 |
if not matching_providers:
|
882 |
-
raise HTTPException(status_code=404, detail="No matching model found")
|
883 |
|
884 |
num_matching_providers = len(matching_providers)
|
885 |
if app.state.channel_manager.cooldown_period > 0 and num_matching_providers > 1:
|
@@ -947,10 +947,10 @@ class ModelRequestHandler:
|
|
947 |
api_list = app.state.api_list
|
948 |
api_index = api_list.index(token)
|
949 |
|
|
|
950 |
if not safe_get(config, 'api_keys', api_index, 'model'):
|
951 |
-
raise HTTPException(status_code=404, detail="No matching model found")
|
952 |
|
953 |
-
request_model = request.model
|
954 |
scheduling_algorithm = safe_get(config, 'api_keys', api_index, "preferences", "SCHEDULING_ALGORITHM", default="fixed_priority")
|
955 |
|
956 |
matching_providers = await get_right_order_providers(request_model, config, api_index, scheduling_algorithm)
|
|
|
879 |
matching_providers = get_matching_providers(request_model, config, api_index)
|
880 |
|
881 |
if not matching_providers:
|
882 |
+
raise HTTPException(status_code=404, detail=f"No matching model found: {request_model}")
|
883 |
|
884 |
num_matching_providers = len(matching_providers)
|
885 |
if app.state.channel_manager.cooldown_period > 0 and num_matching_providers > 1:
|
|
|
947 |
api_list = app.state.api_list
|
948 |
api_index = api_list.index(token)
|
949 |
|
950 |
+
request_model = request.model
|
951 |
if not safe_get(config, 'api_keys', api_index, 'model'):
|
952 |
+
raise HTTPException(status_code=404, detail=f"No matching model found: {request_model}")
|
953 |
|
|
|
954 |
scheduling_algorithm = safe_get(config, 'api_keys', api_index, "preferences", "SCHEDULING_ALGORITHM", default="fixed_priority")
|
955 |
|
956 |
matching_providers = await get_right_order_providers(request_model, config, api_index, scheduling_algorithm)
|