[GH-ISSUE #3348] [BUG]: @agents continuously retrying without budget control limits #2156

Closed
opened 2026-02-22 18:28:22 -05:00 by yindo · 2 comments
Owner

Originally created by @colakang on GitHub (Feb 26, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3348

How are you running AnythingLLM?

Docker (local)

What happened?

I've encountered an issue while using the agents mode. After submitting a query, I received a "no response" message. Upon checking the logs, I noticed the process was continuously retrying, which resulted in a charge of $20 USD for this single query.
I haven't experienced this problem in the standard mode. The issue only occurs when using the @agent command. I should mention that I have enabled RAG and document review permissions.
Has anyone else faced similar issues or knows how to resolve this problem? I'm concerned about unexpected costs accumulating due to these retry loops.

Log:

[backend] info: [Event Logged] - sent_chat
[backend] info: [AgentHandler] Start 695db8c2-03c4-42f8-b868-7b29289320fc::openai:gpt-4o
[backend] info: [TELEMETRY SENT] {"event":"agent_chat_started","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"runtime":"docker"}}
[backend] info: [AgentHandler] Attached websocket plugin to Agent cluster
[backend] info: [AgentHandler] Attached chat-history plugin to Agent cluster
[backend] info: [AgentHandler] Attaching user and default agent to Agent cluster.
[backend] info: [AgentHandler] Attached rag-memory plugin to Agent cluster
[backend] info: [AgentHandler] Attached document-summarizer plugin to Agent cluster
[backend] info: [AgentHandler] Attached create-chart plugin to Agent cluster
[backend] info: [AgentHandler] Attached web-browsing plugin to Agent cluster
[backend] info: [TELEMETRY SENT] {"event":"agent_chat_sent","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"runtime":"docker"}}
[backend] info: [AgentHandler] End 695db8c2-03c4-42f8-b868-7b29289320fc::openai:gpt-4o
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] info: [TELEMETRY SENT] {"event":"sent_chat","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"multiUserMode":true,"LLMSelection":"openai","Embedder":"openai","VectorDbSelection":"pinecone","multiModal":false,"TTSSelection":"native","runtime":"docker"}}
[backend] info: [Event Logged] - sent_chat
[backend] info: [AgentHandler] Start f3a96998-17d5-44ff-9b88-eaa39e089b48::openai:gpt-4o
[backend] info: [TELEMETRY SENT] {"event":"agent_chat_started","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"runtime":"docker"}}
[backend] info: [AgentHandler] Attached websocket plugin to Agent cluster
[backend] info: [AgentHandler] Attached chat-history plugin to Agent cluster
[backend] info: [AgentHandler] Attaching user and default agent to Agent cluster.
[backend] info: [AgentHandler] Attached rag-memory plugin to Agent cluster
[backend] info: [AgentHandler] Attached document-summarizer plugin to Agent cluster
[backend] info: [AgentHandler] Attached create-chart plugin to Agent cluster
[backend] info: [TokenManager] Returning existing instance for model: gpt-4o
[backend] info: [TELEMETRY SENT] {"event":"agent_chat_sent","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"runtime":"docker"}}
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] info: [TokenManager] Returning existing instance for model: gpt-4o
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:634:22)
[backend] error: (node:139) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. Use events.setMaxListeners() to increase limit
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
[backend] info: [AgentHandler] End f3a96998-17d5-44ff-9b88-eaa39e089b48::openai:gpt-4o
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
[backend] info: Client took too long to respond, chat thread is dead after 300000ms
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
[backend] info: [TokenManager] Returning existing instance for model: gpt-4o
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:634:22)
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13)
at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75)
at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44)
at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28)
at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15)
at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22)
at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22)
[backend] info: [TELEMETRY SENT] {"event":"sent_chat","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"multiUserMode":true,"LLMSelection":"openai","Embedder":"openai","VectorDbSelection":"pinecone","multiModal":false,"TTSSelection":"native","runtime":"docker"}}
[backend] info: [Event Logged] - sent_chat
[backend] info: [TELEMETRY SENT] {"event":"agent_chat_sent","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"runtime":"docker"}}
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] info: Client took too long to respond, chat thread is dead after 300000ms
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...
[backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions?
at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24)
at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21)
at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15)
at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5)
[backend] error: retrying in 60 seconds...

Are there known steps to reproduce?

No response

Originally created by @colakang on GitHub (Feb 26, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3348 ### How are you running AnythingLLM? Docker (local) ### What happened? I've encountered an issue while using the agents mode. After submitting a query, I received a "no response" message. Upon checking the logs, I noticed the process was continuously retrying, which resulted in a charge of $20 USD for this single query. I haven't experienced this problem in the standard mode. The issue only occurs when using the @agent command. I should mention that I have enabled RAG and document review permissions. Has anyone else faced similar issues or knows how to resolve this problem? I'm concerned about unexpected costs accumulating due to these retry loops. Log: [backend] info: [Event Logged] - sent_chat [backend] info: [AgentHandler] Start 695db8c2-03c4-42f8-b868-7b29289320fc::openai:gpt-4o [backend] info: [TELEMETRY SENT] {"event":"agent_chat_started","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"runtime":"docker"}} [backend] info: [AgentHandler] Attached websocket plugin to Agent cluster [backend] info: [AgentHandler] Attached chat-history plugin to Agent cluster [backend] info: [AgentHandler] Attaching user and default agent to Agent cluster. [backend] info: [AgentHandler] Attached rag-memory plugin to Agent cluster [backend] info: [AgentHandler] Attached document-summarizer plugin to Agent cluster [backend] info: [AgentHandler] Attached create-chart plugin to Agent cluster [backend] info: [AgentHandler] Attached web-browsing plugin to Agent cluster [backend] info: [TELEMETRY SENT] {"event":"agent_chat_sent","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"runtime":"docker"}} [backend] info: [AgentHandler] End 695db8c2-03c4-42f8-b868-7b29289320fc::openai:gpt-4o [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] info: [TELEMETRY SENT] {"event":"sent_chat","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"multiUserMode":true,"LLMSelection":"openai","Embedder":"openai","VectorDbSelection":"pinecone","multiModal":false,"TTSSelection":"native","runtime":"docker"}} [backend] info: [Event Logged] - sent_chat [backend] info: [AgentHandler] Start f3a96998-17d5-44ff-9b88-eaa39e089b48::openai:gpt-4o [backend] info: [TELEMETRY SENT] {"event":"agent_chat_started","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"runtime":"docker"}} [backend] info: [AgentHandler] Attached websocket plugin to Agent cluster [backend] info: [AgentHandler] Attached chat-history plugin to Agent cluster [backend] info: [AgentHandler] Attaching user and default agent to Agent cluster. [backend] info: [AgentHandler] Attached rag-memory plugin to Agent cluster [backend] info: [AgentHandler] Attached document-summarizer plugin to Agent cluster [backend] info: [AgentHandler] Attached create-chart plugin to Agent cluster [backend] info: [TokenManager] Returning existing instance for model: gpt-4o [backend] info: [TELEMETRY SENT] {"event":"agent_chat_sent","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"runtime":"docker"}} [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] info: [TokenManager] Returning existing instance for model: gpt-4o Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:634:22) [backend] error: (node:139) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. Use events.setMaxListeners() to increase limit [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) [backend] info: [AgentHandler] End f3a96998-17d5-44ff-9b88-eaa39e089b48::openai:gpt-4o Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) [backend] info: Client took too long to respond, chat thread is dead after 300000ms Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) [backend] info: [TokenManager] Returning existing instance for model: gpt-4o Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:634:22) [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... Failed to calculate number of tokens, falling back to approximate count Error: Unknown model at getEncodingNameForModel (/app/server/node_modules/js-tiktoken/dist/lite.cjs:230:13) at encodingForModel (/app/server/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59) at ChatOpenAI.getNumTokens (/app/server/node_modules/@langchain/core/dist/language_models/base.cjs:182:75) at LLMChain._getNumTokens (/app/server/node_modules/langchain/dist/chains/llm_chain.cjs:212:44) at MapReduceDocumentsChain._call (/app/server/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async MapReduceDocumentsChain.invoke (/app/server/node_modules/langchain/dist/chains/base.cjs:58:28) at async summarizeContent (/app/server/utils/agents/aibitat/utils/summarize.js:55:15) at async Object.summarizeDoc (/app/server/utils/agents/aibitat/plugins/summarize.js:159:22) at async Object.handler (/app/server/utils/agents/aibitat/plugins/summarize.js:63:22) [backend] info: [TELEMETRY SENT] {"event":"sent_chat","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"multiUserMode":true,"LLMSelection":"openai","Embedder":"openai","VectorDbSelection":"pinecone","multiModal":false,"TTSSelection":"native","runtime":"docker"}} [backend] info: [Event Logged] - sent_chat [backend] info: [TELEMETRY SENT] {"event":"agent_chat_sent","distinctId":"6a267e67-572f-4790-a390-c3a6643224d6","properties":{"runtime":"docker"}} [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] info: Client took too long to respond, chat thread is dead after 300000ms [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... [backend] error: error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? Error: 404 This is not a chat model and thus not supported in the v1/chat/completions endpoint. Did you mean to use v1/completions? at OpenAIProvider.complete (/app/server/utils/agents/aibitat/providers/openai.js:126:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async AIbitat.handleExecution (/app/server/utils/agents/aibitat/index.js:596:24) at async AIbitat.reply (/app/server/utils/agents/aibitat/index.js:578:21) at async AIbitat.chat (/app/server/utils/agents/aibitat/index.js:374:15) at async AIbitat.retry (/app/server/utils/agents/aibitat/index.js:712:5) [backend] error: retrying in 60 seconds... ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:28:22 -05:00
yindo closed this issue 2026-02-22 18:28:22 -05:00
Author
Owner

@timothycarambat commented on GitHub (Feb 26, 2025):

What model are you using for this? The looping is not weird since that is exactly how agents work - however it shows that each call was a 404 so these tokens should not have even been sent. Also the UI did not show you anything related to this error while you were in a waiting state? You should have been seeing continous loading states or failures in the UI being reported.

@timothycarambat commented on GitHub (Feb 26, 2025): What model are you using for this? The looping is not weird since that is exactly how agents work - however it shows that each call was a 404 so these tokens should not have even been sent. Also the UI did not show you anything related to this error while you were in a waiting state? You should have been seeing continous loading states or failures in the UI being reported.
Author
Owner

@colakang commented on GitHub (Feb 26, 2025):

What model are you using for this? The looping is not weird since that is exactly how agents work - however it shows that each call was a 404 so these tokens should not have even been sent. Also the UI did not show you anything related to this error while you were in a waiting state? You should have been seeing continous loading states or failures in the UI being reported.


I'm using GPT-4o as my default chat model and haven't specifically configured which model the agents use - it's set to the system default.

The UI didn't show any error messages. It only displayed "AI agents executing tasks" for about 5-6 minutes before finally reporting that it couldn't find the information I was querying.

My document is a 2MB Excel file, and I have both RAG and document summarize features enabled for the agents functionality.

I only discovered the $20+ cost when checking my OpenAI billing details afterward. There was no indication during the process that multiple retries were occurring or that costs were accumulating.

So while the looping behavior might be expected for agents, the lack of feedback about 404 errors and the continuous billing without any budget controls seems problematic. The system continued to charge me despite failing to access the required resources.​​​​​​​​​​​​​​​​

@colakang commented on GitHub (Feb 26, 2025): > What model are you using for this? The looping is not weird since that is exactly how agents work - however it shows that each call was a 404 so these tokens should not have even been sent. Also the UI did not show you anything related to this error while you were in a waiting state? You should have been seeing continous loading states or failures in the UI being reported. --- I'm using GPT-4o as my default chat model and haven't specifically configured which model the agents use - it's set to the system default. The UI didn't show any error messages. It only displayed "AI agents executing tasks" for about 5-6 minutes before finally reporting that it couldn't find the information I was querying. My document is a 2MB Excel file, and I have both RAG and document summarize features enabled for the agents functionality. I only discovered the $20+ cost when checking my OpenAI billing details afterward. There was no indication during the process that multiple retries were occurring or that costs were accumulating. So while the looping behavior might be expected for agents, the lack of feedback about 404 errors and the continuous billing without any budget controls seems problematic. The system continued to charge me despite failing to access the required resources.​​​​​​​​​​​​​​​​
yindo changed title from [BUG]: @agents continuously retrying without budget control limits to [GH-ISSUE #3348] [BUG]: @agents continuously retrying without budget control limits 2026-06-05 14:44:53 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#2156