Error log message: Failed to calculate number of tokens

Hey, I’m seeing such error when using

docker compose logs

and I don’t understand where it’s coming from. maybe from the ChainSummarization node?
any ideas? thank you.

n8n_app  | Failed to calculate number of tokens, falling back to approximate count Error: Unknown model
n8n_app  |     at getEncodingNameForModel (/usr/local/lib/node_modules/n8n/node_modules/js-tiktoken/dist/lite.cjs:251:13)
n8n_app  |     at encodingForModel (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/utils/tiktoken.cjs:23:59)
n8n_app  |     at ChatOpenAI.getNumTokens (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/language_models/base.cjs:206:75)
n8n_app  |     at LLMChain._getNumTokens (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/chains/llm_chain.cjs:217:44)
n8n_app  |     at MapReduceDocumentsChain._call (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/chains/combine_docs_chain.cjs:180:73)
n8n_app  |     at processTicksAndRejections (node:internal/process/task_queues:95:5)
n8n_app  |     at MapReduceDocumentsChain.invoke (/usr/local/lib/node_modules/n8n/node_modules/langchain/dist/chains/base.cjs:58:28)
n8n_app  |     at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainSummarization/V2/ChainSummarizationV2.node.js:379:28)
n8n_app  |     at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:681:27)
n8n_app  |     at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:915:51
n8n_app  |     at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1246:20

Information on your n8n setup

  • n8n version: 1.89.2
  • Database (default: SQLite): Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Linux

What kind of workflows are you running? Are there a lot? Are there any errors within the workflows themselves?