project-nomad/admin
jakeaturner a013eb6394 fix(chat): stop capping answers at 1024 tokens and surface truncation
planPrompt() returned the response reserve as num_predict, and the
reserve was clamped by MAX_RESPONSE_RESERVE = 1024. Chat answers
stopped at 1024 output tokens regardless of window size, often
mid-sentence, and the normalized stream chunks dropped Ollama's
done_reason, so neither the UI nor API clients could discern between
a cut-off answer and a finished one.

- Decouple the generation cap from the reserve. num_predict is now the
  space left in the window after the prompt, less a 5% (min 64 token)
  margin for estimator error, with the reserve as its floor. Raise
  MAX_RESPONSE_RESERVE to 8192 so it only bounds prompt hold-back.
- Carry done_reason through all four OllamaService chat paths. Native
  forwards Ollama's done_reason; compat maps OpenAI's finish_reason.
- Log length-limited stops in OllamaController with num_predict,
  num_ctx and tokens generated.
- Show a truncation notice on cut-off answers, with a Continue button
  on the latest one that sends a normal follow-up turn.

Generation evals before and after this change are not length
comparable.

Closes #1342
2026-09-29 15:54:41 -07:00
..
app fix(chat): stop capping answers at 1024 tokens and surface truncation 2026-09-29 15:54:41 -07:00
bin feat: curated content system overhaul 2026-02-11 15:44:46 -08:00
commands feat(AI): give chat a sampler instead of the backend's defaults 2026-09-29 15:54:41 -07:00
config fix: lazy-connect + retry for ioredis to avoid blocked startup 2026-06-23 17:40:10 +00:00
constants feat(AI): give chat a sampler instead of the backend's defaults 2026-09-29 15:54:41 -07:00
database fix(db): allow 'dataset' in installed_resources.resource_type 2026-09-29 15:54:41 -07:00
docs feat(translate): offline translation for the Information Library (#1292) 2026-09-29 15:54:41 -07:00
inertia fix(chat): stop capping answers at 1024 tokens and surface truncation 2026-09-29 15:54:41 -07:00
providers fix(drug-reference): backfill the missing dataset install row on boot 2026-09-29 15:54:41 -07:00
public feat(creator-packs): add missing Modern Rogue banner asset (#1147) 2026-08-04 03:39:52 +00:00
resources chore: standardize brand name to Project NOMAD, retire backronym 2026-08-04 03:37:32 +00:00
scripts refactor(drug-reference): make collections JSON the single source for curated data (#1130) 2026-08-04 03:38:35 +00:00
start feat(zim): let users browse the Kiwix library in any language 2026-09-29 15:54:41 -07:00
tests fix(chat): stop capping answers at 1024 tokens and surface truncation 2026-09-29 15:54:41 -07:00
types fix(chat): stop capping answers at 1024 tokens and surface truncation 2026-09-29 15:54:41 -07:00
util Add offline FDA drug reference (labels, interaction view, conditions, remedies) (#1040) 2026-08-04 03:38:33 +00:00
views chore: standardize brand name to Project NOMAD, retire backronym 2026-08-04 03:37:32 +00:00
.editorconfig feat: initial commit 2025-06-29 15:51:08 -07:00
.env.example feat(creator-packs): gated per-creator video packs, offline via Kiwix (#1106) 2026-08-04 03:38:27 +00:00
ace.js feat: initial commit 2025-06-29 15:51:08 -07:00
adonisrc.ts fix(drug-reference): backfill the missing dataset install row on boot 2026-09-29 15:54:41 -07:00
eslint.config.js feat: openwebui+ollama and zim management 2025-07-09 09:08:21 -07:00
package-lock.json chore(deps): restore dev's package-lock 2026-09-29 15:54:41 -07:00
package.json refactor(maps): curate the marker icon set, drop the tree view 2026-09-29 15:54:41 -07:00
tailwind.config.ts feat: initial commit 2025-06-29 15:51:08 -07:00
tsconfig.json Add offline FDA drug reference (labels, interaction view, conditions, remedies) (#1040) 2026-08-04 03:38:33 +00:00
vite.config.ts fix(Maps): ensure proper parsing of hostnames (#640) 2026-04-03 14:26:50 -07:00