[GH-ISSUE #3834] [BUG]: generic-openai embedding engine doesn't respect EMBEDDING_MODEL_MAX_CHUNK_LENGTH #2449

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

Originally created by @jharmison-redhat on GitHub (May 15, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3834

How are you running AnythingLLM?

Docker (remote machine)

What happened?

EMBEDDING_MODEL_MAX_CHUNK_LENGTH is primarily evaluated in the maximumChunkLength function in server/utils/helpers/index.js, which is respected for ollama, liteLLM, localAi, and lmstudio Embeddings engines. The generic-openai, and any other relevant embeddings engines, do not respect this value. Self-hosting an embeddings model with vLLM, presenting an OpenAI compatible API, isn't possible unless the model I choose can tolerate an 8192 max chunk length (which is more or less hard-coded for openai and generic-openai embeddings engines.

Are there known steps to reproduce?

  • Deploy with the EMBEDDING_MODEL_MAX_CHUNK_LENGTH environment variable set to anything other than 8192
  • Check the value in Settings -> AI Providers -> Text Splitter & Chunking what the Text Chunk Size is set to.
Originally created by @jharmison-redhat on GitHub (May 15, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3834 ### How are you running AnythingLLM? Docker (remote machine) ### What happened? `EMBEDDING_MODEL_MAX_CHUNK_LENGTH` is primarily evaluated in the `maximumChunkLength` function in `server/utils/helpers/index.js`, which is respected for `ollama`, `liteLLM`, `localAi`, and `lmstudio` Embeddings engines. The `generic-openai`, and any other relevant embeddings engines, do not respect this value. Self-hosting an embeddings model with vLLM, presenting an OpenAI compatible API, isn't possible unless the model I choose can tolerate an `8192` max chunk length (which is more or less hard-coded for `openai` and `generic-openai` embeddings engines. ### Are there known steps to reproduce? - Deploy with the `EMBEDDING_MODEL_MAX_CHUNK_LENGTH` environment variable set to anything other than `8192` - Check the value in `Settings` -> `AI Providers` -> `Text Splitter & Chunking` what the `Text Chunk Size` is set to.
yindo added the possible bug label 2026-02-22 18:29:43 -05:00
yindo closed this issue 2026-02-22 18:29:43 -05:00
Author
Owner

@jharmison-redhat commented on GitHub (May 16, 2025):

20 hours from report to fix - thank you!

@jharmison-redhat commented on GitHub (May 16, 2025): 20 hours from report to fix - thank you!
Author
Owner

@timothycarambat commented on GitHub (May 16, 2025):

I went to bed - otherwise it would have been less :)

@timothycarambat commented on GitHub (May 16, 2025): I went to bed - otherwise it would have been less :)
yindo changed title from [BUG]: generic-openai embedding engine doesn't respect EMBEDDING_MODEL_MAX_CHUNK_LENGTH to [GH-ISSUE #3834] [BUG]: generic-openai embedding engine doesn't respect EMBEDDING_MODEL_MAX_CHUNK_LENGTH 2026-06-05 14:46:38 -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#2449