Issues connecting Ollama llama3 model with AI Agent

I’m starting building up an ai agent which uses Ollama locall in my system with llama3 model, Ollama integration is successfull, but in the node connection to the Agent appears a red asterics, and when I trigger the chat message “Error: Failed to receive response” and it keeps loading. I’m not sure what I’m doing wrong.

1 Like

usually the red asterisk means the connection dropped to Ollama. we had this when the service wasn’t actually running — make sure it’s up and the URL is accessible. also the qwen model needs to finish downloading, that took like 20 minutes for us on first run

1 Like

welcome to the n8n community @Ivan_Magana
I had the same issue. What fixed it for me was reselecting the lama3 model in the Ollama node and making sure Ollama was actually running and reachable. After that, I reconnected it to the Agent and the error stopped

good tip @tamy.santos — reselecting the model in the node is one of those things that’s easy to miss but fixes it more often than you’d expect. @Ivan_Magana let us know if it’s still happening after that!

I have reselected the model and even selected qwen or mistral (already downloaded) and asterisk is still there, weird part is that I have downloaded a template and replaced the model by ollama (local) and it also is displaying the red asterisk but there the workflow is working properly even when the red asterisk, I have deep search into the issue and found this KB ( Unable to start workflow with the chat trigger node in n8n web gui ) it seems there is an issue with the chat trigger itself, something about N8N_RUNNERS_MODE=internal, it seems new version by default uses external and I need to change it to internal, however when I look for the entry in the .yml file it does not have any entry like that

Ivan_Magana, this usually happens with Ollama when the agent can’t properly reach or receive a response from the local model

The red asterisk on the AI Agent node is a sign that something in the connection is not fully configured or not responding correctly. Since your Ollama node is connected but you get “Failed to receive response”, the issue is most likely at the network or model response level, not the agent logic.

First thing to check is your Ollama endpoint. If you’re using something like http://localhost:11434, it works only if n8n is running on the same machine. If n8n is running in Docker or another environment, localhost will not work. In that case, you need to use your machine’s IP (for example http://192.168.x.x:11434).

Also confirm that your model is actually running. Run this in your terminal:
ollama run llama3
If the model is not active or still loading, n8n may timeout and show that error.

Another common issue is timeout. Local models can be slow, especially on first response. Try increasing the timeout in the Ollama node or reduce the prompt size to test.

About the red asterisk on the Agent node, double check that:

  • the Chat Model is properly selected

  • no required field is empty

  • the model node is correctly linked (not just visually connected, but configured)

One more thing to test is removing the HTTP tool temporarily. Sometimes the agent waits on tools and never completes, which can look like a model failure. Try running the agent with just the Ollama model first to confirm it responds.

If after this it still hangs, check your n8n logs. Most times you’ll see either a connection error or timeout there, which will point directly to the cause.

Hi @Blessing

Ollama is setup properly

Ollama is running Locally with no issues

PS C:\WINDOWS\system32> ollama run llama3
>>> hello
Hello! It's nice to meet you. Is there something I can help you with, or would you like to chat?

>>> Send a message (/? for help)

I have verified that the n8n container can communicate with Ollama and receive a successful response by executing a command directly from within the container. Since Ollama responded correctly, we can rule out any network connectivity issues between the Docker container and the Ollama LLM.

PS C:\WINDOWS\system32> docker exec -it local-files-n8n-1 wget -O- --post-data='{\"model\": \"llama3\", \"prompt\": \"Hi can you hear me\", \"stream\": false}' http://192.168.1.65:11434/api/generate
Connecting to 192.168.1.65:11434 (192.168.1.65:11434)
writing to stdout
{"model":"llama3","created_at":"2026-04-07T16:49:03.5861251Z","response":"Hello! Yes, I can hear you. I'm an AI assistant trained to understand and respond to human language, so feel free to chat with me anytime. What's on your mind?","done":true,"done_reason":"stop","context":[128006,882,128007,271,13347,649,499,6865,757,128009,128006,78191,128007,271,9906,0,7566,11,358,649,6865,499,13,358,2846,459,15592,18328,16572,311,3619,323,6013,311,3823,4221,11,779,2733,1949,311,6369,449,757,30194,13,3639,596,389,701,4059,30],"total_duration":243445620-                    100% |**********************************************************************************************************************************************************************************************************************************|   674  0:00:00 ETA
written to stdout
PS C:\WINDOWS\system32>

I have created a basic workflow (chat trigger, AI Agent and Ollama model), but still getting the same error ”Error: Failed to receive response” when entering a message in the chat.

Another test I ran was to establish a test message in the chat trigger and the workflow completed successfully even with the red asterik, is there any reason about why entering a message in the Test chat is not working?

:waving_hand: Hi, @Ivan_Magana
Try:

ollama serve

Ollama’s local API runs on http://localhost:11434, and the API responses include useful runtime details such as prompt_eval_count, prompt_eval_duration, eval_count, and eval_duration, so the logs can help with requests, “errors”, and basic performance checks. ()

From the official docs, I do not see a built-in request-history UI or evaluation dashboard, so if you need full tracking or audit logs, you would usually add that yourself in n8n, a database, or another logging layer. ()

You can also try LM Studio. I shared a practical workflow example in another article on that setup.

:backhand_index_pointing_right: Running a local LLM with LM Studio → n8n — fixed workflow (real case, step-by-step) - #2 by Haian_Abou-Karam