mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 10:21:10 +02:00
Add Google Gemini as a fallback provider that activates automatically when Ollama is overloaded or unavailable, ensuring LLM requests always succeed even under load. New provider (src/providers/google.py): - Full LLMProvider implementation using google-genai SDK - Chat completions (streaming + non-streaming) - Vision/multimodal support (base64 images) - Embeddings via text-embedding-004 - Model mapping: Ollama models → Gemini equivalents (gemma3:4b → gemini-2.0-flash, llava:7b → gemini-2.0-flash, etc.) Auto-fallback routing (src/providers/router.py): - Concurrent request tracking for Ollama (OLLAMA_MAX_CONCURRENT=3) - When Ollama concurrent > max: route to Google automatically - When Ollama fails: retry on Google with model mapping - Health check caching (5s TTL) to avoid hammering Ollama - Non-Ollama providers (openrouter, groq, together) are never fallback-routed - Fallback info included in /health endpoint response New config (src/config.py): - GOOGLE_API_KEY: enables Google provider - GOOGLE_DEFAULT_MODEL: default gemini-2.0-flash - AUTO_FALLBACK_ENABLED: toggle fallback (default: true) - OLLAMA_MAX_CONCURRENT: concurrent request threshold (default: 3) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| mana-api-gateway | ||
| mana-core-auth | ||
| mana-crawler | ||
| mana-image-gen | ||
| mana-landing-builder | ||
| mana-llm | ||
| mana-media | ||
| mana-notify | ||
| mana-search | ||
| mana-stt | ||
| mana-tts | ||
| mana-voice-bot | ||
| matrix-calendar-bot | ||
| matrix-chat-bot | ||
| matrix-clock-bot | ||
| matrix-contacts-bot | ||
| matrix-mana-bot | ||
| matrix-manadeck-bot | ||
| matrix-nutriphi-bot | ||
| matrix-ollama-bot | ||
| matrix-onboarding-bot | ||
| matrix-picture-bot | ||
| matrix-planta-bot | ||
| matrix-presi-bot | ||
| matrix-project-doc-bot | ||
| matrix-questions-bot | ||
| matrix-skilltree-bot | ||
| matrix-stats-bot | ||
| matrix-storage-bot | ||
| matrix-stt-bot | ||
| matrix-todo-bot | ||
| matrix-tts-bot | ||
| matrix-zitare-bot | ||
| ollama-metrics-proxy | ||