4 Commits
Author SHA1 Message Date
BlackAngelTV 9808b38198 fix(backend): give the model its history back and its identity
Asked what the first message of the conversation was, the assistant answered
that it keeps no memory between interactions while the replayed context sat
right in front of it. Two causes, both measured on the real model. The system
prompt never said the history is its memory, nor who it is, so it fell back on
its training habit of denying recall. And Ollama's default context window
silently truncates from the beginning: on a 9194-token conversation only 4053
tokens were evaluated, so the oldest messages never reached the model at all.
The window is now requested explicitly (16384 by default) and the warm-up asks
for the same one, otherwise Ollama reloads the weights and throws the preheat
away. The prompt states the identity and forbids the false denial, while still
letting the assistant admit a message older than the replayed window.
2026-10-06 20:23:51 +02:00
BlackAngelTV 60984e70ec feat(backend): keep the model resident and load it before it is asked
Ollama drops an idle model after five minutes by default, so the first
question after a pause pays the whole several-second load. Every chat request
now carries keep_alive (30 minutes by default) and POST /api/chat/warm loads
the weights on demand, letting a client wake the model while the user is
still writing. A warm-up that fails answers warmed=false instead of an error:
it is an optimisation, not a step the answer depends on.
2026-10-06 20:03:31 +02:00
BlackAngelTV 31e9619727 feat(backend): stream /api/chat as spec-compliant SSE
Expose the bare `data:`/`[DONE]` contract on the main chat endpoint so
simple clients can consume the stream without parsing named events.
2026-10-05 20:40:12 +02:00
BlackAngelTV 877df963f9 test(backend): cover auth, projects and streaming with a mocked Ollama
Tests run without any external service; the mock streams NDJSON chunks so the
SSE path is exercised end to end.
2026-10-05 15:01:57 +02:00