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
Timeout Error OpenAI #3512
Comments
Same for me as well |
Getting the same error, with map-reduce summarizing chain. |
Same, following 👀 |
+1 OpenAI chat endpoint always seems to time out when using the summarization chain. It works with the |
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?
+1 @shreyabhadwal Experiencing the exact same behaviour. Local works well but it timeouts on Azure. |
@Binb1 do the timeouts happen every time for you or occasionally? Also, are you using websockets or SSE? |
@shreyabhadwal Strangely enough, every time I deploy a new version of my app it seems to work well. But after a few minutes I get timeouts and I can't really understand why so far. I'm using SSE. |
@Binb1 I experience the exact same behavior. It works well if I restart the app, and then after a few minutes when I try again I get timeouts. Very weird. Interestingly, I have tried doing it without streaming and it seems to be working well. I don't quite understand it. |
@shreyabhadwal This makes me think that it is more Azure than langchain/openai related then 😕 I have not tried streaming yet as I don't really need it but it fails for me even without it. So strange. It feels like the webapp needs a "warmup" before being able to make the calls. |
Increasing the timeout fixes it for me! Thanks @timothyasp ! |
+1 |
openai requests can go as long as 600s, and if you're doing large token
prompts with gpt-4, 300s might be too low. So i'd set it at 600s and hope
for the best. But i have noticed latencies on OpenAI's end being a lot
higher over the last week or two.
…-Tim
On Fri, May 5, 2023 at 11:29 AM firezym ***@***.***> wrote:
+1
I set the timeout to 300s, but each time after 3 to 5 requests, It still
fails as timeout...
—
Reply to this email directly, view it on GitHub
<#3512 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFMY47CRDATG6DVC7KAY5TXEVBGXANCNFSM6AAAAAAXKZOUOA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@shreyabhadwal @Binb1 any luck with Azure? Same issue local fine and fast, on Azure issues. Driving me nuts and suspect there is a simple configuration I'm missing. |
Nope nothing yet |
@shreyabhadwal Not explicitly so I don't think so. I'm using generate on the ChatOpenAI so I can get the llm_output token etc and another run call to a chat-conversational-react-description agent with some additional tools. I'm using the OpenAI Chat model and hosting on an Azure web service. |
I am getting same error with model |
Same issue here. Running it in a Kubernetes Pod deployed to an AWS cluster and using async calls. Weirdly, calling the OpenAI LLM directly works, but running the Agent it gets stuck. This works: agent_executor = get_agent(user_token)
driver = agent_executor.agent.llm_chain.llm
cl = driver.client()
print(cl.create(model=driver.model_name, prompt='Tell me a poem')) But this does not: await agent_executor.arun(query) |
Ok so from the comments above I realised I was testing async in one case and blocking in the other. print(await cl.acreate(model=driver.model_name, prompt='Tell me a poem')) Does indeed also time out and fail to run! UPDATE I still can't make it run, neither for OpenAI nor Anthropic - but I think I know what's going on. Our Kubernetes cluster running the application is blocking access to the internet using Squid Proxy. The OpenAI API is allowed, but only for HTTP requests. |
I have the same issue. I am trying to hit completion api on text-davinci-003 engine. I am unable to replicate the issue on my local as it works always. When I containerize and deploy it in AWS Lambda, I get the following error sometimes (dont know when). Any resoultion? |
It could be a problem with the SSL key. Set it up as a system environment variable. |
Same issue here. Works for a bit and then starts timing out. |
+1 |
I have the same issue. Works well locally but faces timeout issues when the app is deployed to Azure App Service for Linux Python or Custom Container. |
Hi HaochenQ May be deploying your solution in a virtual machine might solve your problem. When I moved from AWS Lambda to EC2, the problem got resolved |
Thank you@jpsmartbots, I tried to deploy my container with an Azure VM, but the issue persists. For those of you who are facing 504 gateway timeout issues Not sure why the langchian call to the OpenAI after a period of inactivity will fail and cause a timeout. |
Hey all, I believe this being fixed in the openai-python client should also help with this issue, and with generations: The async and sync request_timeouts are NOT identical. |
same problem |
I'm running into the same issue. i am running a proxy container that talks to openai API works locally, but not when i deploy it to railway. |
did anyone fix this, running into the same issue when I use summarize map reduce chain from Langhian on AWS lambda? |
I am facing a Warning similar to the one described here #3005
WARNING:langchain.embeddings.openai:Retrying langchain.embeddings.openai.embed_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=600).
It just keeps retrying. How do I get around this?
The text was updated successfully, but these errors were encountered: