-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Web server doesn't work #934
Comments
@SunixLiu - I tried the web server and it works for me. So it may be something else. Just to make sure, do you do have the "Enable Web Server" option on? (I am 99.999% sure you did, but it doesn't hurt to ask) If you do, Try the CURL example (or use any http REST client to mimic the HTTP headers/data) as mentioned here - https://platform.openai.com/docs/api-reference/completions/create So, you'd send a test http POST request: ie: (Each -H item is a HTTP heading, and the -d is the data payload) If it works, you should get a JSON response back like: '{"choices":[{"finish_reason":"stop","index":0,"logprobs":null,"references":[],"text":"I'm doing well, thank you! How can I assist you today?"}],"created":1686413902,"id":"foobarbaz","model":"gpt4all-j-v1.3-groovy","object":"text_completion","usage":{"completion_tokens":15,"prompt_tokens":16,"total_tokens":31}}' (Here's a screenshot from a REST Client I used) If you're still getting the connection refused error then windows firewall might be blocking it. Check your settings to make sure it isn't blocking the app:
Try the REST request again to see if that works. Good luck! |
Thank you K ! This helps! |
This was very, very useful, Thanks a lot. |
System Info
GPT4ALL 2.4.6
Platform: Windows 10
Python 3.10.9
After checking the enable web server box, and try to run server access code here https://docs.gpt4all.io/gpt4all_chat.html#server-mode, I got error message as below:
openai.error.APIConnectionError: Error communicating with OpenAI: HTTPConnectionPool(host='localhost', port=4891): Max retries exceeded with url: /v1/completions (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f95a1427fa0>: Failed to establish a new connection: [Errno 111] Connection refused'))
Information
Related Components
Reproduction
Expected behavior
{
"choices": [
{
"finish_reason": "stop",
"index": 0,
"logprobs": null,
"text": "Who is Michael Jordan?\nMichael Jordan is a former professional basketball player who played for the Chicago Bulls in the NBA. He was born on December 30, 1963, and retired from playing basketball in 1998."
}
],
"created": 1684260896,
"id": "foobarbaz",
"model": "gpt4all-j-v1.3-groovy",
"object": "text_completion",
"usage": {
"completion_tokens": 35,
"prompt_tokens": 39,
"total_tokens": 74
}
}
The text was updated successfully, but these errors were encountered: