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
Frequent request timed out error #3005
Comments
+1 I'm seeing a lot of these as with |
I couldn't reproduce the error rn, but if you see the |
Seems to work again so probably OpenAI API issues? |
+1, I'm consistently encountering the same error today. |
+1, seeing the same issue when using langchain only. Direct calls to Open AI works fine. |
|
I have set up upto 20 seconds in openai.py def _create_retry_decorator(self) -> Callable[[Any], Any]:
But still have an rate limit error: Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.._completion_with_retry in 20.0 seconds as it raised RateLimitError: Rate limit reached for default-gpt-3.5-turbo in organization org-oTVXM6oG3frz1CFRijB3heo9 on requests per min. Limit: 3 / min. Please try again in 20s. Contact support@openai.com if you continue to have issues. Please add a payment method to your account to increase your rate limit. Visit https://platform.openai.com/account/billing to add a payment method is there only 3 requests per minute with a normal user? |
Increasing the timeout helped. Thanks for the tip, @rafaelquintanilha ! |
USER_NAME = "Agent 007" # The name you want to use when interviewing the agent. But I did not work for my case. |
+1 frequently timeout with gpt-4, I increased the request_timeout, but didn't help much. Tried OpenAI direct call, works as expected. Any workaround or potential root cause? Usage: Refine summarization chain |
Increasing the request_timeout value helped. Thanks. |
Not sure if this should be marked as completed. It's probably still a "bug" since it happens more often than not when using gpt-4. Maybe the request timeout should be set to 120 if model_name is "gpt-4" by default. |
Had this appear for some complex prompts today. Changed timeout to 120. It helped! |
With longer context and completions, gpt-3.5-turbo and, especially, gpt-4, will more times than not take > 60seconds to respond. Based on some other discussions, it seems like this is an increasingly common problem, especially with summarization tasks. - #3512 - #3005 OpenAI's max 600s timeout seems excessive, so I settled on 120, but I do run into generations that take >240 seconds when using large prompts and completions with GPT-4, so maybe 240 would be a better compromise?
This is driving me completely batty - hoping for any advice. Increasing the timeout just increases how long until this error is raised I know this may be more of an Azure thing but any advice? |
Today I am getting the same error every time with model yesterday that was working well, but today it is giving me same error and driving crazy |
I have same problem with gpt-4. My script workes well. From yesterday its timeout all the time :). |
@Suprimepl which model you are using in your script ? |
model="gpt-4", |
That same problem is happening to me with "model=gpt-3.5-turbo" and "request_timeout=120" |
Quite the same problem for me since midnight when I used "gpt-4-0314". It worked well before I went to sleep, but most of the stuff timeout today |
Getting this same error. Code seems to be fine but problem is exponentially worse when executing within AWS |
I think it's OPEN AI fault :/ |
Still driving me batty. Looking at server config gunicorn on azure gthread / gevent worker and thread numbers timeouts, Auzure timeouts etc. Could just be the size of the VM, but I shouldn't need a production level server for testing with 5 users. |
It's common to have to increase the gunicorn timeout when running on prod, their default timeout is too short. However, from a designing perspective, calling Langchain may take unpredictable times, so a safer solution in this case would implement some sort of queue system (for example using Celery). This way the processing happens in background and you won't have timeout issues with gunicorn. That said, you can try to increase gunicorn timeout by doing something like |
Thanks @rafaelquintanilha my timeout was at 600. Will investigate Celery. My attempts at using gevent were unsuccessful - like crashing the container due to ignorance. |
Any updates on this issue? |
I still have this issue . Does anyone knows a workaround ? |
Hi, for me the problem went away when I set "request_timeout=600" (or more than 600, and I think is the default value in the last versions of langchain). I think that this problem is mainly a time request issue. |
To ensure that retries are made until the Timeout is reached. |
I still have this issue . Does anyone knows how to solve it? |
I'm using langchain==0.0.319 and Adding request_timeout=120 to ChatOpenAI() looks working well.
Actually I don't know but I guess it's because openai, which is server-side, does not return responses for various reasons:
Since the root cause of the request timeout is on the server side, this is unavoidable on the client side. The server side will sometimes not respond, and the client side has a responsibility to handle on this scenario. If the retry results in a response, there should be no problem. In my case, the LLM sometimes does not respond, so I set the response_timeout value to a smaller value to cause a retry on purpose, so that the LLM will retry when it does not respond, and as a result, I could get the LLM respond properly. I hope this may be help. |
facing a similar issue with vertex-ai Gemini pro models , and gevent that after 60 seconds the stuff chain times out. but when i am using simple worker type its working fine . |
Check if you have installed root HTTPS certificates for your venvs. |
#15222 (comment) |
Could you pls explain in details how to resolve this issue and what do you mean by "simple worker type"? |
Could you pls explain in details how to resolve this issue and what do you mean by "simple worker type"? |
basically it was an issue wrt to gevent and grpc after upgrading library and doing monkey patching it worked for me , simple worker type by i mean is using sync worker and not the gevent one ... |
Could you pls clarify your reply by "LangChain code"? |
I am getting this error whenever the time is greater than 60 seconds. I tried giving timeout=120 seconds in ChatOpenAI().
Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised Timeout: Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Read timed out. (read timeout=60).
What is the reason for this issue and how can I rectify it?
The text was updated successfully, but these errors were encountered: