|
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>
|
|---|
|
|
| .env.example |
|---|
| .gitignore |
|---|
| navi/config.py |
|---|
| navi/core/registry.py |
|---|
| navi/exceptions.py |
|---|
| navi/llm/fallback.py 0 → 100644 |
|---|
| navi/llm/ollama.py |
|---|
| navi/profiles/base.py |
|---|
| navi/profiles/developer/config.json |
|---|
| navi/profiles/loader.py |
|---|
| navi/profiles/secretary/config.json |
|---|
| navi/profiles/server_admin/config.json |
|---|
| navi/profiles/tool_developer/config.json |
|---|
| navi/tools/base.py |
|---|