Add Ollama multi-server fallback with in-memory blacklisting
- New FallbackOllamaBackend (navi/llm/fallback.py): tries servers and
  models in priority order; on LLMConnectionError blacklists the server
  for the process lifetime, on LLMModelNotFoundError blacklists the
  (server, model) pair — eliminates latency from repeated failed probes
- OllamaBackend now raises typed LLMConnectionError / LLMModelNotFoundError
  instead of bare LLMBackendError; accepts list[str] | str | None for model
- AgentProfile.model changed from str to list[str] (str auto-normalised);
  all profiles updated to ["gemma4:31b-cloud", "gemma4:26b-a4b-it-q4_K_M"]
- New config field OLLAMA_BACKENDS_FILE: path to [{host, api_key?}] JSON;
  when set, registry creates FallbackOllamaBackend instead of OllamaBackend
- ollama_backends.json template added (gitignored — contains API key)
- current_model ContextVar type widened to list[str] | str | None

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 470d0be commit 511dc463e302f1e5ee169f941ea5ac9019235a99
@Eugene Sukhodolskiy Eugene Sukhodolskiy authored on 24 Apr
Showing 14 changed files
View
.env.example
View
.gitignore
View
navi/config.py
View
navi/core/registry.py
View
navi/exceptions.py
View
navi/llm/fallback.py 0 → 100644
View
navi/llm/ollama.py
View
navi/profiles/base.py
View
navi/profiles/developer/config.json
View
navi/profiles/loader.py
View
navi/profiles/secretary/config.json
View
navi/profiles/server_admin/config.json
View
navi/profiles/tool_developer/config.json
View
navi/tools/base.py