Stalling for hours at 6 agents/tasks or more
I think since the latest update, or maybe the previous one, every time I reach the 6th agent and 6th task, no matter what it is, no matter how simple it is, the agent always stalls and it takes literally hours for it to get to next task/agent. It doesnt kill or stop the process, it just waits and waits and waits then after a huge amount of time it produces the output, then it goes on to agent 7 and task 7 where the stall begins a new. The first 5 agents fly by, but the 6th always stalls. and it certainly wasnt like this a few days ago ( i just updated yesterday/or the day before, was using a way older version before, but unfortunately i lost track of which one it was, as I got the source from the examples.)
My 1st and 6th agent are just tasked with a simple copy+paste task of a single file. Thats it, its not complex analysis or browsing or anything, its just copy+paste and it still stalls and doesnt move for hours, but again it doesnt matter what the 6th task is, it always stalls there 100% of the time.
Figured out a very wooden workaround that manages to fix this issue. You have to split the crew into 2 crews, otherwise it always stalls immensely after the 5th agent, consistently, 100% of the time. So each crew can have no more than 4-5 agents MAX otherwise you will get nowhere.
So if you are using gpt-4-1106-preview and have more than 4 agents, until an actual fix comes, split your main.py file into two crews and just pass whatever data you want from one crew to the next. Works sorta fine, at least it actually finishes now:
# First crew with the first four agents and tasks
first_crew = Crew(
agents=[
agent1,
agent2,
agent3,
agent4,
],
tasks=[
task1,
task2,
task3,
task4,
],
verbose=True
)
# Execute the first part of the crew
for agent in first_crew.agents:
print(f"> Entering new AgentExecutor chain for {agent.role}...")
first_result = first_crew.kickoff()
print("\n\n########################")
print("## Here is the First Part of the Report")
print("########################\n")
print(first_result)
# Second crew
second_crew = Crew(
agents=[
agent5,
agent6,
agent7,
],
tasks=[
task5,
task6,
task7,
],
verbose=True
)
# Execute the second part of the crew
for agent in second_crew.agents:
print(f"> Entering new AgentExecutor chain for {agent.role}...")
second_result = second_crew.kickoff()
print("\n\n########################")
print("## Here is the Second Part of the Report")
print("########################\n")
print(second_result)
# Combine the results from both parts
combined_result = first_result + "\n\n" + second_result
return combined_result
'''
Probably you are hitting the Max number of requests per minute for your LLM.
There is a parameter in Crew class for that, named "max_rpm"
i havent touched anything in the Crew. i am using the default=None for max_rpm so its definitely not that. And with the new version its even slower, it stalls immensely now at agent 4-5 and its significantly slower, and all the action inputs are now new out of nowhere and throwing errors.
I think you didn't understand my message. I was talking about an LLM limitation even when having Crew untouched. Check limit for gpt-4-1106-preview tokens per minute and requests per minute