# Error when using chatmodels

**URL:** <https://community.n8n.io/t/error-when-using-chatmodels/54662>\
**Category:** Questions\
**Tags:** langchain, ai\
**Created:** [September 20, 2024, 10:17am UTC](https://community.n8n.io/t/error-when-using-chatmodels/54662 "2024-09-20T10:17:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan\_Rasmusson](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/stefan_rasmusson/32/19697_2.png) [@Stefan\_Rasmusson](https://community.n8n.io/u/Stefan_Rasmusson)\
**Post date:** [September 20, 2024, 10:17am UTC](https://community.n8n.io/t/error-when-using-chatmodels/54662/1 "2024-09-20T10:17:44Z")

</div>

Im trying to make my first AI workflow. Just a simple chat connected to an agent and a model. I have tried both Gemini and OpenAI models.  
I also tried to just use the OpenAI node to check that connection and credentials work. In that node all works fine.

Feels like there is some setting I missing. But I cant figure it out

When I use the Open AI chat model I get Timeout error after a while.

```auto
TimeoutError: Request timed out. at wrapOpenAIClientError (/usr/local/lib/node_modules/n8n/node_modules/@langchain/openai/dist/utils/openai.cjs:13:17) at /usr/local/lib/node_modules/n8n/node_modules/@langchain/openai/dist/chat_models.cjs:1356:69 at processTicksAndRejections (node:internal/process/task_queues:95:5) at RetryOperation._fn (/usr/local/lib/node_modules/n8n/node_modules/p-retry/index.js:50:12)

```

When i try Gemini I get

```auto
TypeError: fetch failed at node:internal/deps/undici/undici:13178:13 at processTicksAndRejections (node:internal/process/task_queues:95:5) at _makeRequestInternal (/usr/local/lib/node_modules/n8n/node_modules/@langchain/google-genai/node_modules/@google/generative-ai/dist/index.js:290:20) at generateContent (/usr/local/lib/node_modules/n8n/node_modules/@langchain/google-genai/node_modules/@google/generative-ai/dist/index.js:692:22) at /usr/local/lib/node_modules/n8n/node_modules/@langchain/google-genai/dist/chat_models.cjs:332:24 at RetryOperation._fn (/usr/local/lib/node_modules/n8n/node_modules/p-retry/index.js:50:12)

```

---

<div class="post-metadata">

**Author:** ![n8n](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/n8n/32/196425_2.png) [@n8n](https://community.n8n.io/u/n8n)\
**Post date:** [September 20, 2024, 10:17am UTC](https://community.n8n.io/t/error-when-using-chatmodels/54662/2 "2024-09-20T10:17:46Z")

</div>

It looks like your topic is missing some important information. Could you provide the following if applicable.

- **n8n version:**
- **Database (default: SQLite):**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app):**
- **Operating system:**

---

<div class="post-metadata">

**Author:** ![Stefan\_Rasmusson](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/stefan_rasmusson/32/19697_2.png) [@Stefan\_Rasmusson](https://community.n8n.io/u/Stefan_Rasmusson)\
**Post date:** [September 20, 2024, 10:21am UTC](https://community.n8n.io/t/error-when-using-chatmodels/54662/3 "2024-09-20T10:21:17Z")

</div>

> [@n8n](#):
>
> - **n8n version: 1.59.3**
> - **SQLite**
> - **EXECUTIONS\_PROCESS: own**
> - **Docker**
> - **Operating system: Ubuntu**

Running as UID 1000

---

<div class="post-metadata">

**Author:** ![Stefan\_Rasmusson](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/stefan_rasmusson/32/19697_2.png) [@Stefan\_Rasmusson](https://community.n8n.io/u/Stefan_Rasmusson)\
**Post date:** [September 20, 2024, 12:58pm UTC](https://community.n8n.io/t/error-when-using-chatmodels/54662/4 "2024-09-20T12:58:15Z")

</div>

This looks to be because the AI nodes are not respecting the HTTP proxy settings for N8n. I have created a bug report. [Langchain nodes not respecting HTTP proxy settings · Issue #10901 · n8n-io/n8n · GitHub](https://github.com/n8n-io/n8n/issues/10901)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [September 27, 2024, 12:58pm UTC](https://community.n8n.io/t/error-when-using-chatmodels/54662/5 "2024-09-27T12:58:50Z")

</div>

Closed on September 27, 2024, 12:58pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
