project-nomad/admin/app
chriscrosstalk b194dfa136
fix(RAG): pass num_ctx and truncate to Ollama embed call (#763)
Some Ollama installs ship nomic-embed-text:v1.5 with the embedding
model's default num_ctx=2048, which the RAG chunker (sized for ~1500
tokens of estimated content with ratio=2 chars/token) can exceed on
dense PDFs. The result is `400 the input length exceeds the context
length` from /api/embed, which then hits the OpenAI-compatible
fallback (which also errors), and surfaces as a BadRequestError.

Pass options.num_ctx=8192 (nomic-embed-text v1.5's RoPE-extrapolated
max) and truncate=true (silent truncation safety net) on every
embed call so we don't depend on the local modelfile defaults.

Reported on #756 by @NC4WD; same root cause as #369 and #670 which
were closed without an actual fix.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 21:43:10 -07:00
..
controllers fix(AI): stop local nomad_ollama container when remote Ollama is configured (#744) 2026-04-20 16:02:49 -07:00
exceptions fix(Docs): documentation renderer fixes 2025-12-23 16:00:33 -08:00
jobs fix(AI): allow cancelling in-progress model downloads and ensure consistent progress UI (#701) 2026-04-17 14:43:41 -07:00
middleware fix(API): skip compression for Server-Sent Events (#798) 2026-04-27 19:00:31 -07:00
models feat(maps): add scale bar and location markers (#636) 2026-04-03 14:26:50 -07:00
services fix(RAG): pass num_ctx and truncate to Ollama embed call (#763) 2026-04-27 21:43:10 -07:00
utils fix(Downloads): remove duplicate err listnr and improv Range req stability 2026-04-17 14:01:27 -07:00
validators fix: block IPv4-mapped IPv6 and IPv6 all-zeros in SSRF check (#520) 2026-04-03 14:26:50 -07:00