crewAI icon indicating copy to clipboard operation
crewAI copied to clipboard

Getting timeout error when request takes longer than 5 minutes

Open abdinal1 opened this issue 1 year ago • 5 comments

I get

HTTPSConnectionPool(host='foobar.com', port=443): Max retries exceeded with url: /foo/bar

With certain models which take more than 5 minutes for an inference. If I swap to a tinyer model it works well but using bigger models results to this error when the request takes longer than 5 minutes. I have played around with a lot of different parameters like Ollama(timeout) etc. all of them had no effect so I came to the conclusion after testing barely on Ollama LLM like:

llm = Ollama(model="agent", base_url="/foo/bar")

that it has to be crewai because above line executed with 13 minutes of needed time.

Any idea how this can be solved @joaomdmoura ?

abdinal1 avatar Jan 22 '24 20:01 abdinal1

@abdinal1 are you runing your ollama and crewai in the same virtual env? have you tried to connect to the http://localhost:11434/ url to see if it will respond?

Biancamazzi avatar Jan 22 '24 21:01 Biancamazzi

maybe crewAI community can help you https://discord.com/channels/1192246288507474000/1192247377705320479 the link direct to questions channel

Biancamazzi avatar Jan 22 '24 21:01 Biancamazzi

maybe crewAI community can help you https://discord.com/channels/1192246288507474000/1192247377705320479 the link direct to questions channel

The discord link doesn't work anybody have one that does.

quincy451 avatar Jan 22 '24 21:01 quincy451

https://discord.com/invite/X4JWnZnxPb

Biancamazzi avatar Jan 22 '24 21:01 Biancamazzi

@Biancamazzi

Im running the ollama server on kaggle rescources as shown in the notebook: https://www.kaggle.com/code/aliabdin1/ollama-server

Everything works fine unless my model size increases, I dont get out of memory it does do computations but as soon as 5 minutes are reached as a request it times out with the above mentioned error HTTPSConnectionPool

When I access ollama without going over crewai's agents it does not timeout and let me request longer times but as soon as my request goes over crewai's framework I get a 5 minute timeout once I'm above that time.

I havent found where I could set the timeout or where it might set a 5 minute treshold for a response (as default)

abdinal1 avatar Jan 23 '24 09:01 abdinal1

@Biancamazzi Hello all, i have created a gradio endpoint using hugging face model " CodeQwen1.5-7B" the gradio endpoint generate successfully but when I try to infrencing my crew agent with gradio endpoint its giving me error : image

but at first try its give me error but when I did same prompt second time its show this error. even my gradio endpoint working fine. also I retest my gradio endpoint its working fine. I am using colab with latest version of crewai, gradio. kindly is there anyone who face same issue ?

SyedMuqtasidAli avatar Jun 04 '24 08:06 SyedMuqtasidAli

Is your max_execution_time set to none?

https://docs.crewai.com/core-concepts/Agents/#agent-attributes

gadgethome avatar Jun 04 '24 15:06 gadgethome