[GH-ISSUE #2215] [BUG]: Chunk Size Not Having Tokens as Set in Chunk Size Parameter #1444

Closed
opened 2026-02-22 18:24:50 -05:00 by yindo · 1 comment
Owner

Originally created by @Muzammilahmed1997 on GitHub (Sep 4, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2215

How are you running AnythingLLM?

Local development

What happened?

Hi, I'm facing this issue while using anythingllm for Document based question answering. When i create chunks then most of the Chunks are not containing the number of characters i have set in chunk size settings. As you can see in this picture only a few characters are in the chunks retrieved whereas I have set the chunk size of 100 with overlap 20. I'm using the Anythingllm preferred Embeddings model.

Similarly if i set the chunk size of 1000 with overlap for ex 200 then it will not contain 1000 Tokens.

Does anyone know how to resolve this issue.

chunk size

Are there known steps to reproduce?

No response

Originally created by @Muzammilahmed1997 on GitHub (Sep 4, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/2215 ### How are you running AnythingLLM? Local development ### What happened? Hi, I'm facing this issue while using anythingllm for Document based question answering. When i create chunks then most of the Chunks are not containing the number of characters i have set in chunk size settings. As you can see in this picture only a few characters are in the chunks retrieved whereas I have set the chunk size of 100 with overlap 20. I'm using the Anythingllm preferred Embeddings model. Similarly if i set the chunk size of 1000 with overlap for ex 200 then it will not contain 1000 Tokens. Does anyone know how to resolve this issue. ![chunk size](https://github.com/user-attachments/assets/e113e7ef-b1e8-4033-a1b7-90175982d8e6) ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:24:50 -05:00
yindo closed this issue 2026-02-22 18:24:50 -05:00
Author
Owner

@timothycarambat commented on GitHub (Sep 4, 2024):

Depending on the raw text, it may be being split on seperator, not raw count of chars
https://github.com/langchain-ai/langchainjs/blob/9c131b30edb88b2454a0d697410601977ddb9d14/libs/langchain-textsplitters/src/text_splitter.ts#L283

@timothycarambat commented on GitHub (Sep 4, 2024): Depending on the raw text, it may be being split on seperator, not raw count of chars https://github.com/langchain-ai/langchainjs/blob/9c131b30edb88b2454a0d697410601977ddb9d14/libs/langchain-textsplitters/src/text_splitter.ts#L283
yindo changed title from [BUG]: Chunk Size Not Having Tokens as Set in Chunk Size Parameter to [GH-ISSUE #2215] [BUG]: Chunk Size Not Having Tokens as Set in Chunk Size Parameter 2026-06-05 14:40:49 -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#1444