Self-correction pass caught this before publishing: the previous commit's test
comment and companion post draft claimed a keepAlive set through
ChatClient.prompt().options(...) never reaches the request Ollama receives,
and worked around it by calling ChatModel.call(Prompt) directly instead. That
claim was never actually verified against /api/ps for the ChatClient path --
only inferred from a failed timing assertion that, it turned out, would have
failed the same way even with a genuinely confirmed unload (see below).
Checked directly: unloading via ChatClient.prompt().options(OllamaChatOptions
.builder()...keepAlive("0")).call() and immediately querying /api/ps shows an
empty model registry, same as the ChatModel path. The options merge works
correctly. Simplified the test back to ChatClient throughout, consistent with
the rest of this series, and removed the incorrect comment.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FtpJvZfg4nvLvtzgJTDWpB
10 lines
483 B
Plaintext
10 lines
483 B
Plaintext
/api/ps immediately after the unload call: {"models":[]}
|
|
|
|
prompt: "Reply with a single short sentence: why do developers like small local models?"
|
|
response: Developers often appreciate small local models because they are more efficient and can provide quicker, more relevant results for their applications.
|
|
|
|
total-duration: 1076ms
|
|
load-duration: 2ms
|
|
prompt-eval-count: 44, prompt-eval-duration: 41ms
|
|
eval-count: 27, eval-duration: 1028ms
|
|
26.25 tokens/sec (eval-count / eval-duration) |