0

Create Agent

Hi. I am making a bot with agents and tools. My Tools are like this: def pm_agent(idea): return llm(pm_prompt.format_messages(idea=idea)).content And then i created list of tools, then my memory and at last the agent that is like this: agents = initialize_agent( tools, llm, agent='zero-shot-react-description', memory=memory, verbose=True, handle_parsing_errors=True ) And then i run it with an idea but it entered a infinity loop of Think and Action until my GPU memory can not continue without any answer. I have a question i used Qwen4B could it be cause of my model? i saw many codes in langchain that use openai models.

18th Sep 2025, 1:55 PM
Fateme Biglari
Fateme Biglari - avatar
2 ответов
+ 1
Yes, your infinite loop is almost certainly due to the model not following the expected ReAct format. OpenAI’s models work because they’re trained for it; Qwen-4B is not. You can fix it by either enforcing stricter output parsing, giving a stronger system prompt, or switching to a model instruction-tuned for tool-using agents. Good Luck!
19th Sep 2025, 6:16 AM
Riyadh JS
Riyadh JS - avatar
0
if other model works, then maybe. did you try any other model? which tool did you use? : ollama, hugging face. lmstudio, .... ?
18th Sep 2025, 7:51 PM
Mihaly Nyilas
Mihaly Nyilas - avatar