feat: add FOREMAN_KEEP_ALIVE config for worker model residency
Allow configuring how long the worker model stays resident on the Ollama
target after a request via FOREMAN_KEEP_ALIVE env var. Accepts Ollama
duration strings ("-1" forever, "0" unload, "15m", "1h", etc). Defaults
to "-1" (pin forever). The embedder warm-up is unaffected and always
uses keep_alive=-1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -48,7 +48,7 @@ func newTestForeman(t *testing.T, ollamaClient ollama.Client, webhookSecret stri
|
||||
|
||||
notifier := worker.NewNotifier()
|
||||
dispatcher := webhook.NewDispatcher(webhookSecret, logger)
|
||||
w := worker.New(st, ollamaClient, inv, notifier, dispatcher, logger)
|
||||
w := worker.New(st, ollamaClient, inv, notifier, dispatcher, logger, "-1")
|
||||
|
||||
cfg := config.Config{
|
||||
OllamaURL: "http://localhost:11434",
|
||||
@@ -260,7 +260,7 @@ func TestSubmit_AuthToken(t *testing.T) {
|
||||
|
||||
notifier := worker.NewNotifier()
|
||||
dispatcher := webhook.NewDispatcher("", logger)
|
||||
w := worker.New(st, ollamaStub, inv, notifier, dispatcher, logger)
|
||||
w := worker.New(st, ollamaStub, inv, notifier, dispatcher, logger, "-1")
|
||||
|
||||
cfg := config.Config{
|
||||
OllamaURL: "http://localhost:11434",
|
||||
|
||||
Reference in New Issue
Block a user