Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not-useful error message when CORS disabled but required #443

Open
abrenneke opened this issue Feb 17, 2025 · 4 comments
Open

Not-useful error message when CORS disabled but required #443

abrenneke opened this issue Feb 17, 2025 · 4 comments

Comments

@abrenneke
Copy link

Which version of LM Studio?

LM Studio 0.3.9

Which operating system?

Mac OS

What is the bug?

When a CORS request is made to /v1/chat/completions and CORS isn't enabled in LM Studio, it spits out an unhelpful error "messages field is required" that is confusing to the user.

Screenshots

Image

Logs

To Reproduce

  1. Disable CORS
  2. Make a request from the browser to /v1/chat/completions with valid data
@yagil
Copy link
Member

yagil commented Feb 17, 2025

Hi @abrenneke I would expect that you'd get this message when the request doesn't contain messages.

Can you please share the request that made this happen?

@abrenneke
Copy link
Author

Right, the request doesn't contain message because it's a CORS preflight request that's failing:

using httpie:

http options localhost:1234/v1/chat/completions Access-Control-Request-Method:POST Access-Control-Request-Headers:Authorization Origin:http://localhost:8080

@yagil
Copy link
Member

yagil commented Feb 18, 2025

Thanks @abrenneke to be sure: things are working, but the error message is annoying? Or is it functionally not working either

@abrenneke
Copy link
Author

Things are working, the error message was just confusing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants