Ollama embedding API silently truncated 45% of a document without warning
A developer running Ollama 0.40.14 with qwen3-embedding:0.6b on a GPU-less machine found that /api/embed cut a 7,510-token document to 4,095 tokens. The server defaulted to a 4,096-token context because it could not measure VRAM, and the API truncates inputs by default. Text appended at the end of the document produced a vector identical to the document without it, so the content was unsearchable. The response gave no truncation flag, and the only sign was a prompt token count equal to the context minus one. Setting truncate to false makes overlong inputs return an HTTP 400 error instead, and the author recommends chunking documents to about 2,000 characters.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in