lm-sys / RouteLLM

A framework for serving and evaluating LLM routers - save LLM costs without compromising quality!
Apache License 2.0
3.3k stars 250 forks source link

Server doesn't respond to CORS preflight requests #43

Open bitnom opened 3 months ago

bitnom commented 3 months ago

The server fails for some clients/chat interfaces trying to connect to it bc it doesn't respond to preflight requests (CORS), causing the client to not POST completion requests.

The following server output is observed:

INFO:     127.0.0.1:13579 - "OPTIONS /dashboard/billing/usage?start_date=2024-08-01&end_date=2024-08-07 HTTP/1.1" 404 Not Found
INFO:     127.0.0.1:13580 - "OPTIONS /dashboard/billing/subscription HTTP/1.1" 404 Not Found
INFO:     127.0.0.1:13590 - "OPTIONS /v1/v1/chat/completions HTTP/1.1" 404 Not Found
INFO:     127.0.0.1:13645 - "OPTIONS /v1/chat/completions HTTP/1.1" 405 Method Not Allowed
INFO:     127.0.0.1:13655 - "OPTIONS /dashboard/billing/usage?start_date=2024-08-01&end_date=2024-08-07 HTTP/1.1" 404 Not Found
INFO:     127.0.0.1:13656 - "OPTIONS /dashboard/billing/subscription HTTP/1.1" 404 Not Found

PR incoming