Repository navigation
fix(embedding): reject text over the model token limit - #20
Merged
Merged
Appwrite / Hansi
succeeded
Nov 18, 2026 in 26s
Tier S: Ready to merge
The changed rejection path validates the full untruncated token count before inference and returns the intended 400 response.
The service now applies each model’s context limit, capped by EMBEDDING_MAX_TOKENS, and rejects over-limit input with a 400 before running inference. It counts unpadded input tokens, sizes inference sub-batches according to the configured limit, and documents the limits and memory guidance. Tests cover model-specific limits, rejection, and token counting.
Loading