From 15eb7c3b4572f2b6b6d9bed07072caeb430e2cbb Mon Sep 17 00:00:00 2001 From: Timmy Time Date: Thu, 19 Mar 2026 15:44:10 -0400 Subject: [PATCH] [loop-cycle-538] refactor: remove dead airllm provider from cascade router (#459) (#481) --- config/providers.yaml | 13 --------- src/infrastructure/router/cascade.py | 11 +------- tests/infrastructure/test_router_cascade.py | 30 +-------------------- 3 files changed, 2 insertions(+), 52 deletions(-) diff --git a/config/providers.yaml b/config/providers.yaml index 0e60c3e..11d5eeb 100644 --- a/config/providers.yaml +++ b/config/providers.yaml @@ -54,19 +54,6 @@ providers: context_window: 2048 capabilities: [text, vision, streaming] - # Secondary: Local AirLLM (if installed) - - name: airllm-local - type: airllm - enabled: false # Enable if pip install airllm - priority: 2 - models: - - name: 70b - default: true - capabilities: [text, tools, json, streaming] - - name: 8b - capabilities: [text, tools, json, streaming] - - name: 405b - capabilities: [text, tools, json, streaming] # Tertiary: OpenAI (if API key available) - name: openai-backup diff --git a/src/infrastructure/router/cascade.py b/src/infrastructure/router/cascade.py index 83a4f4a..74ee8d3 100644 --- a/src/infrastructure/router/cascade.py +++ b/src/infrastructure/router/cascade.py @@ -100,7 +100,7 @@ class Provider: """LLM provider configuration and state.""" name: str - type: str # ollama, openai, anthropic, airllm + type: str # ollama, openai, anthropic enabled: bool priority: int url: str | None = None @@ -308,15 +308,6 @@ class CascadeRouter: logger.debug("Ollama provider check error: %s", exc) return False - elif provider.type == "airllm": - # Check if airllm is installed - try: - import importlib.util - - return importlib.util.find_spec("airllm") is not None - except (ImportError, ModuleNotFoundError): - return False - elif provider.type in ("openai", "anthropic", "grok"): # Check if API key is set return provider.api_key is not None and provider.api_key != "" diff --git a/tests/infrastructure/test_router_cascade.py b/tests/infrastructure/test_router_cascade.py index d482d7a..cab475f 100644 --- a/tests/infrastructure/test_router_cascade.py +++ b/tests/infrastructure/test_router_cascade.py @@ -2,7 +2,7 @@ import time from pathlib import Path -from unittest.mock import AsyncMock, MagicMock, patch +from unittest.mock import AsyncMock, patch import pytest import yaml @@ -489,34 +489,6 @@ class TestProviderAvailabilityCheck: assert router._check_provider_available(provider) is False - def test_check_airllm_installed(self): - """Test AirLLM when installed.""" - router = CascadeRouter(config_path=Path("/nonexistent")) - - provider = Provider( - name="airllm", - type="airllm", - enabled=True, - priority=1, - ) - - with patch("importlib.util.find_spec", return_value=MagicMock()): - assert router._check_provider_available(provider) is True - - def test_check_airllm_not_installed(self): - """Test AirLLM when not installed.""" - router = CascadeRouter(config_path=Path("/nonexistent")) - - provider = Provider( - name="airllm", - type="airllm", - enabled=True, - priority=1, - ) - - with patch("importlib.util.find_spec", return_value=None): - assert router._check_provider_available(provider) is False - class TestCascadeRouterReload: """Test hot-reload of providers.yaml."""