janhq/jan

bug: Can't use Jan's openai server beyond localhost

Closed this issue · 2 comments

Version: 0.7.2 through Jan-bin AUR package

Describe the Bug

Even though I set the Server Host to 0.0.0.0, it only works succesfully on localhost

Steps to Reproduce

  1. Set Host to 0.0.0.0
  2. Start an openai server through Jan
  3. Try to obtain models from your LAN IP

Screenshots / Logs

> curl -X 'GET' \
        'http://localhost:1337/v1/models' \
        -H 'accept: application/json' \
        -H 'Authorization: Bearer example'

{"data":[{"created":1,"id":"Jan-v1-4B-Q4_K_M","object":"model","owned_by":"user"}],"object":"list"}⏎                                        

~ 
> curl -X 'GET' \
        'http://192.168.1.30:1337/v1/models' \
        -H 'accept: application/json' \
        -H 'Authorization: Bearer example'

Invalid host header⏎                                                  

~ 
> curl -X 'GET' \
        'http://127.0.0.1:1337/v1/models' \
        -H 'accept: application/json' \
        -H 'Authorization: Bearer example'

{"data":[{"created":1,"id":"Jan-v1-4B-Q4_K_M","object":"model","owned_by":"user"}],"object":"list"}⏎      

Operating System

  • MacOS
  • Windows
  • Linux

Found 3 possible duplicate issues:

  1. #6471
  2. #2142
  3. #4556

I solved it by putting an * in Trusted Hosts as mentioned in #6471 (comment)