From af281b7c94b7212aa8f37d6bbd61b4e2fcc93292 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 16 Mar 2026 14:18:36 -0700 Subject: [PATCH 1/3] Fix Lemonade v10 system-info device key compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lemonade Server v10 renamed device keys in the /api/v1/system-info response: npu → amd_npu, gpu → amd_igpu/amd_dgpu. This broke NPU detection in the Hardware Advisor agent and any other consumer using the legacy key names. Add _normalize_system_info() to LemonadeClient that creates bidirectional aliases so both old (npu, gpu) and new (amd_npu, amd_igpu) keys work transparently. Existing callers require no changes. --- examples/hardware_advisor_agent.py | 3 + src/gaia/llm/lemonade_client.py | 51 +++++++++++++-- tests/test_hardware_advisor_agent.py | 81 ++++++++++++++++++++++++ tests/test_lemonade_client.py | 93 ++++++++++++++++++++++++++++ 4 files changed, 224 insertions(+), 4 deletions(-) diff --git a/examples/hardware_advisor_agent.py b/examples/hardware_advisor_agent.py index 1fed242ef..1a0d45735 100644 --- a/examples/hardware_advisor_agent.py +++ b/examples/hardware_advisor_agent.py @@ -142,6 +142,9 @@ def get_hardware_info() -> Dict[str, Any]: ) # Get NPU information from Lemonade + # LemonadeClient.get_system_info() normalizes v10 keys + # (amd_npu) to legacy aliases (npu), so "npu" works for + # both Lemonade v9 and v10+. devices = info.get("devices", {}) npu_info = devices.get("npu", {}) npu_available = npu_info.get("available", False) diff --git a/src/gaia/llm/lemonade_client.py b/src/gaia/llm/lemonade_client.py index e53e1f56c..fc8b1f102 100644 --- a/src/gaia/llm/lemonade_client.py +++ b/src/gaia/llm/lemonade_client.py @@ -2668,6 +2668,11 @@ def get_system_info(self, verbose: bool = False) -> Dict[str, Any]: """ Get system hardware information and device enumeration. + Supports both Lemonade Server v9 (legacy) and v10+ response formats. + The v10 response uses ``amd_npu``, ``amd_igpu``, and ``amd_dgpu`` keys + under ``devices``. This method normalizes those to the legacy ``npu`` + and ``gpu`` aliases so callers can use either key. + Args: verbose: If True, returns additional details like Python packages and extended system information @@ -2679,15 +2684,18 @@ def get_system_info(self, verbose: bool = False) -> Dict[str, Any]: - Physical Memory (RAM) - devices: Dictionary with device information - cpu: Name, cores, threads, availability - - gpu: AMD iGPU/dGPU name, memory (MB), driver version, availability - - npu: Name, driver version, power mode, availability + - amd_igpu: AMD integrated GPU info (v10+) + - amd_dgpu: AMD discrete GPU list (v10+) + - amd_npu: AMD NPU info (v10+) + - gpu: Alias for amd_igpu (backward compat) + - npu: Alias for amd_npu (backward compat) Examples: # Check available devices sysinfo = client.get_system_info() devices = sysinfo.get("devices", {}) - # Select best device + # Select best device (works with both v9 and v10) if devices.get("npu", {}).get("available"): print("Using NPU for acceleration") elif devices.get("gpu", {}).get("available"): @@ -2701,7 +2709,42 @@ def get_system_info(self, verbose: bool = False) -> Dict[str, Any]: url = f"{self.base_url}/system-info" if verbose: url += "?verbose=true" - return self._send_request("get", url) + result = self._send_request("get", url) + return self._normalize_system_info(result) + + @staticmethod + def _normalize_system_info(info: Dict[str, Any]) -> Dict[str, Any]: + """Normalize system-info response for backward compatibility. + + Lemonade v10 renamed device keys: + - ``npu`` → ``amd_npu`` + - ``gpu`` → ``amd_igpu`` / ``amd_dgpu`` + + This adds legacy aliases (``npu``, ``gpu``) when only v10 keys are + present, and adds v10 aliases when only legacy keys are present, so + callers can use either convention. + """ + devices = info.get("devices") + if not isinstance(devices, dict): + return info + + # --- NPU normalization --- + if "amd_npu" in devices and "npu" not in devices: + # v10 → add legacy alias + devices["npu"] = devices["amd_npu"] + elif "npu" in devices and "amd_npu" not in devices: + # legacy → add v10 alias + devices["amd_npu"] = devices["npu"] + + # --- GPU normalization --- + if "amd_igpu" in devices and "gpu" not in devices: + # v10 → add legacy alias (prefer iGPU as the default "gpu") + devices["gpu"] = devices["amd_igpu"] + elif "gpu" in devices and "amd_igpu" not in devices: + # legacy → add v10 alias + devices["amd_igpu"] = devices["gpu"] + + return info def ready(self) -> bool: """ diff --git a/tests/test_hardware_advisor_agent.py b/tests/test_hardware_advisor_agent.py index 1dd70d684..210be2b4f 100644 --- a/tests/test_hardware_advisor_agent.py +++ b/tests/test_hardware_advisor_agent.py @@ -187,3 +187,84 @@ def test_recommend_models_respects_memory_constraints(self, agent): assert result["constraints"]["available_ram_gb"] == 8.0 # Max model size should be ~70% of RAM assert result["constraints"]["max_model_size_gb"] == pytest.approx(5.6, rel=0.1) + + +class TestHardwareAdvisorLemonadeV10: + """Test Hardware Advisor works with Lemonade v10 response format. + + Lemonade v10 renamed device keys: npu → amd_npu, gpu → amd_igpu/amd_dgpu. + The LemonadeClient normalizes these, so the agent should work transparently. + """ + + @pytest.fixture + def mock_lemonade_client_v10(self): + """Mock Lemonade client returning v10 format (amd_npu, amd_igpu).""" + with patch( + "examples.hardware_advisor_agent.LemonadeClient" + ) as mock_client_class: + mock_client = MagicMock() + # Simulate the normalized response (client adds legacy aliases) + mock_client.get_system_info.return_value = { + "OS Version": "Windows 11 24H2", + "Processor": "AMD Ryzen AI 9 HX 375", + "Physical Memory": "32.0 GB", + "devices": { + "cpu": { + "name": "AMD Ryzen AI 9 HX 375", + "cores": 12, + "threads": 24, + "available": True, + }, + "amd_igpu": { + "name": "AMD Radeon 890M", + "vram_gb": 0.5, + "available": True, + }, + "amd_dgpu": [], + "amd_npu": { + "name": "XDNA2", + "available": True, + "power_mode": "Default", + }, + # Legacy aliases added by _normalize_system_info + "npu": { + "name": "XDNA2", + "available": True, + "power_mode": "Default", + }, + "gpu": { + "name": "AMD Radeon 890M", + "vram_gb": 0.5, + "available": True, + }, + }, + } + mock_client.list_models.return_value = {"data": []} + mock_client.get_model_info.return_value = {"size_gb": 0} + mock_client_class.return_value = mock_client + yield mock_client + + @pytest.fixture + def agent_v10(self, mock_lemonade_client_v10): + """Create agent with v10 mock.""" + return HardwareAdvisorAgent() + + def test_get_hardware_info_detects_npu_v10(self, agent_v10): + """Test that NPU is detected from Lemonade v10 normalized response.""" + from gaia.agents.base.tools import _TOOL_REGISTRY + + get_hw = _TOOL_REGISTRY["get_hardware_info"]["function"] + result = get_hw() + + assert result["success"] is True + assert result["npu"]["available"] is True + assert result["npu"]["name"] == "XDNA2" + + def test_get_hardware_info_parses_ram_v10(self, agent_v10): + """Test RAM parsing with v10 response.""" + from gaia.agents.base.tools import _TOOL_REGISTRY + + get_hw = _TOOL_REGISTRY["get_hardware_info"]["function"] + result = get_hw() + + assert result["ram_gb"] == 32.0 diff --git a/tests/test_lemonade_client.py b/tests/test_lemonade_client.py index 2fd4fd60a..ff196ac6e 100644 --- a/tests/test_lemonade_client.py +++ b/tests/test_lemonade_client.py @@ -1842,6 +1842,99 @@ def test_integration_responses_endpoint(self): print("⚠️ Responses endpoint might not be fully implemented yet") +class TestNormalizeSystemInfo: + """Tests for LemonadeClient._normalize_system_info backward compatibility.""" + + def test_v10_keys_get_legacy_aliases(self): + """Lemonade v10 response (amd_npu, amd_igpu) gets npu/gpu aliases.""" + v10_response = { + "OS Version": "Windows 11", + "Processor": "AMD Ryzen AI 9 HX 375", + "Physical Memory": "32.0 GB", + "devices": { + "cpu": {"name": "AMD Ryzen AI 9 HX 375", "available": True}, + "amd_igpu": {"name": "AMD Radeon 890M", "available": True}, + "amd_dgpu": [], + "amd_npu": {"name": "XDNA2", "available": True}, + }, + } + result = LemonadeClient._normalize_system_info(v10_response) + devices = result["devices"] + + # Legacy aliases should be added + assert "npu" in devices + assert devices["npu"]["name"] == "XDNA2" + assert devices["npu"]["available"] is True + assert "gpu" in devices + assert devices["gpu"]["name"] == "AMD Radeon 890M" + + # Original keys should still be present + assert "amd_npu" in devices + assert "amd_igpu" in devices + + def test_legacy_keys_get_v10_aliases(self): + """Lemonade v9 response (npu, gpu) gets amd_npu/amd_igpu aliases.""" + v9_response = { + "OS Version": "Linux", + "Physical Memory": "64.0 GB", + "devices": { + "npu": {"name": "AMD Ryzen AI NPU", "available": True}, + "gpu": {"name": "AMD Radeon", "available": True}, + }, + } + result = LemonadeClient._normalize_system_info(v9_response) + devices = result["devices"] + + # v10 aliases should be added + assert "amd_npu" in devices + assert devices["amd_npu"]["name"] == "AMD Ryzen AI NPU" + assert "amd_igpu" in devices + assert devices["amd_igpu"]["name"] == "AMD Radeon" + + # Original keys should still be present + assert "npu" in devices + assert "gpu" in devices + + def test_no_devices_key(self): + """Response without devices key is returned as-is.""" + info = {"OS Version": "Linux", "Physical Memory": "16.0 GB"} + result = LemonadeClient._normalize_system_info(info) + assert result == info + + def test_empty_devices(self): + """Response with empty devices dict is returned as-is.""" + info = {"devices": {}} + result = LemonadeClient._normalize_system_info(info) + assert result["devices"] == {} + + def test_npu_not_available_v10(self): + """NPU with available=False is still normalized.""" + info = { + "devices": { + "amd_npu": {"name": "XDNA2", "available": False}, + }, + } + result = LemonadeClient._normalize_system_info(info) + assert result["devices"]["npu"]["available"] is False + + def test_both_keys_present_no_overwrite(self): + """When both legacy and v10 keys exist, neither is overwritten.""" + info = { + "devices": { + "npu": {"name": "legacy-npu", "available": True}, + "amd_npu": {"name": "v10-npu", "available": True}, + "gpu": {"name": "legacy-gpu", "available": True}, + "amd_igpu": {"name": "v10-igpu", "available": True}, + }, + } + result = LemonadeClient._normalize_system_info(info) + # Neither should be overwritten + assert result["devices"]["npu"]["name"] == "legacy-npu" + assert result["devices"]["amd_npu"]["name"] == "v10-npu" + assert result["devices"]["gpu"]["name"] == "legacy-gpu" + assert result["devices"]["amd_igpu"]["name"] == "v10-igpu" + + if __name__ == "__main__": # Use pytest to run tests - either all tests or a specific test pattern import pytest From 3d1f38037ec361972e36d918505ed46fe76e9c65 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 16 Mar 2026 14:35:25 -0700 Subject: [PATCH 2/3] Simplify: use v10 device keys directly, drop normalization layer Remove _normalize_system_info() and update all code to use the Lemonade v10 key names (amd_npu, amd_igpu, amd_dgpu) directly. --- examples/hardware_advisor_agent.py | 5 +- src/gaia/llm/lemonade_client.py | 58 +++-------------- tests/test_hardware_advisor_agent.py | 87 ++------------------------ tests/test_lemonade_client.py | 93 ---------------------------- 4 files changed, 13 insertions(+), 230 deletions(-) diff --git a/examples/hardware_advisor_agent.py b/examples/hardware_advisor_agent.py index 1a0d45735..3cada2862 100644 --- a/examples/hardware_advisor_agent.py +++ b/examples/hardware_advisor_agent.py @@ -142,11 +142,8 @@ def get_hardware_info() -> Dict[str, Any]: ) # Get NPU information from Lemonade - # LemonadeClient.get_system_info() normalizes v10 keys - # (amd_npu) to legacy aliases (npu), so "npu" works for - # both Lemonade v9 and v10+. devices = info.get("devices", {}) - npu_info = devices.get("npu", {}) + npu_info = devices.get("amd_npu", {}) npu_available = npu_info.get("available", False) npu_name = ( npu_info.get("name", "Not detected") diff --git a/src/gaia/llm/lemonade_client.py b/src/gaia/llm/lemonade_client.py index fc8b1f102..5afd6d70c 100644 --- a/src/gaia/llm/lemonade_client.py +++ b/src/gaia/llm/lemonade_client.py @@ -2668,11 +2668,6 @@ def get_system_info(self, verbose: bool = False) -> Dict[str, Any]: """ Get system hardware information and device enumeration. - Supports both Lemonade Server v9 (legacy) and v10+ response formats. - The v10 response uses ``amd_npu``, ``amd_igpu``, and ``amd_dgpu`` keys - under ``devices``. This method normalizes those to the legacy ``npu`` - and ``gpu`` aliases so callers can use either key. - Args: verbose: If True, returns additional details like Python packages and extended system information @@ -2684,22 +2679,20 @@ def get_system_info(self, verbose: bool = False) -> Dict[str, Any]: - Physical Memory (RAM) - devices: Dictionary with device information - cpu: Name, cores, threads, availability - - amd_igpu: AMD integrated GPU info (v10+) - - amd_dgpu: AMD discrete GPU list (v10+) - - amd_npu: AMD NPU info (v10+) - - gpu: Alias for amd_igpu (backward compat) - - npu: Alias for amd_npu (backward compat) + - amd_igpu: AMD integrated GPU name, VRAM, driver version, availability + - amd_dgpu: AMD discrete GPU list + - amd_npu: AMD NPU name, driver version, power mode, availability Examples: # Check available devices sysinfo = client.get_system_info() devices = sysinfo.get("devices", {}) - # Select best device (works with both v9 and v10) - if devices.get("npu", {}).get("available"): + # Select best device + if devices.get("amd_npu", {}).get("available"): print("Using NPU for acceleration") - elif devices.get("gpu", {}).get("available"): - print("Using GPU for acceleration") + elif devices.get("amd_igpu", {}).get("available"): + print("Using iGPU for acceleration") else: print("Using CPU") @@ -2709,42 +2702,7 @@ def get_system_info(self, verbose: bool = False) -> Dict[str, Any]: url = f"{self.base_url}/system-info" if verbose: url += "?verbose=true" - result = self._send_request("get", url) - return self._normalize_system_info(result) - - @staticmethod - def _normalize_system_info(info: Dict[str, Any]) -> Dict[str, Any]: - """Normalize system-info response for backward compatibility. - - Lemonade v10 renamed device keys: - - ``npu`` → ``amd_npu`` - - ``gpu`` → ``amd_igpu`` / ``amd_dgpu`` - - This adds legacy aliases (``npu``, ``gpu``) when only v10 keys are - present, and adds v10 aliases when only legacy keys are present, so - callers can use either convention. - """ - devices = info.get("devices") - if not isinstance(devices, dict): - return info - - # --- NPU normalization --- - if "amd_npu" in devices and "npu" not in devices: - # v10 → add legacy alias - devices["npu"] = devices["amd_npu"] - elif "npu" in devices and "amd_npu" not in devices: - # legacy → add v10 alias - devices["amd_npu"] = devices["npu"] - - # --- GPU normalization --- - if "amd_igpu" in devices and "gpu" not in devices: - # v10 → add legacy alias (prefer iGPU as the default "gpu") - devices["gpu"] = devices["amd_igpu"] - elif "gpu" in devices and "amd_igpu" not in devices: - # legacy → add v10 alias - devices["amd_igpu"] = devices["gpu"] - - return info + return self._send_request("get", url) def ready(self) -> bool: """ diff --git a/tests/test_hardware_advisor_agent.py b/tests/test_hardware_advisor_agent.py index 210be2b4f..b5edebae9 100644 --- a/tests/test_hardware_advisor_agent.py +++ b/tests/test_hardware_advisor_agent.py @@ -30,7 +30,7 @@ def mock_lemonade_client(self): "Processor": "AMD Ryzen 9 7940HS", "Physical Memory": "32.0 GB", "devices": { - "npu": {"available": True, "name": "AMD Ryzen AI NPU"}, + "amd_npu": {"available": True, "name": "AMD Ryzen AI NPU"}, }, } mock_client.list_models.return_value = { @@ -134,7 +134,9 @@ def mock_lemonade_client(self): "OS Version": "Linux", "Processor": "AMD", "Physical Memory": "64.0 GB", - "devices": {"npu": {"available": True, "name": "Test NPU"}}, + "devices": { + "amd_npu": {"available": True, "name": "Test NPU"}, + }, } mock_client.list_models.return_value = { "data": [ @@ -187,84 +189,3 @@ def test_recommend_models_respects_memory_constraints(self, agent): assert result["constraints"]["available_ram_gb"] == 8.0 # Max model size should be ~70% of RAM assert result["constraints"]["max_model_size_gb"] == pytest.approx(5.6, rel=0.1) - - -class TestHardwareAdvisorLemonadeV10: - """Test Hardware Advisor works with Lemonade v10 response format. - - Lemonade v10 renamed device keys: npu → amd_npu, gpu → amd_igpu/amd_dgpu. - The LemonadeClient normalizes these, so the agent should work transparently. - """ - - @pytest.fixture - def mock_lemonade_client_v10(self): - """Mock Lemonade client returning v10 format (amd_npu, amd_igpu).""" - with patch( - "examples.hardware_advisor_agent.LemonadeClient" - ) as mock_client_class: - mock_client = MagicMock() - # Simulate the normalized response (client adds legacy aliases) - mock_client.get_system_info.return_value = { - "OS Version": "Windows 11 24H2", - "Processor": "AMD Ryzen AI 9 HX 375", - "Physical Memory": "32.0 GB", - "devices": { - "cpu": { - "name": "AMD Ryzen AI 9 HX 375", - "cores": 12, - "threads": 24, - "available": True, - }, - "amd_igpu": { - "name": "AMD Radeon 890M", - "vram_gb": 0.5, - "available": True, - }, - "amd_dgpu": [], - "amd_npu": { - "name": "XDNA2", - "available": True, - "power_mode": "Default", - }, - # Legacy aliases added by _normalize_system_info - "npu": { - "name": "XDNA2", - "available": True, - "power_mode": "Default", - }, - "gpu": { - "name": "AMD Radeon 890M", - "vram_gb": 0.5, - "available": True, - }, - }, - } - mock_client.list_models.return_value = {"data": []} - mock_client.get_model_info.return_value = {"size_gb": 0} - mock_client_class.return_value = mock_client - yield mock_client - - @pytest.fixture - def agent_v10(self, mock_lemonade_client_v10): - """Create agent with v10 mock.""" - return HardwareAdvisorAgent() - - def test_get_hardware_info_detects_npu_v10(self, agent_v10): - """Test that NPU is detected from Lemonade v10 normalized response.""" - from gaia.agents.base.tools import _TOOL_REGISTRY - - get_hw = _TOOL_REGISTRY["get_hardware_info"]["function"] - result = get_hw() - - assert result["success"] is True - assert result["npu"]["available"] is True - assert result["npu"]["name"] == "XDNA2" - - def test_get_hardware_info_parses_ram_v10(self, agent_v10): - """Test RAM parsing with v10 response.""" - from gaia.agents.base.tools import _TOOL_REGISTRY - - get_hw = _TOOL_REGISTRY["get_hardware_info"]["function"] - result = get_hw() - - assert result["ram_gb"] == 32.0 diff --git a/tests/test_lemonade_client.py b/tests/test_lemonade_client.py index ff196ac6e..2fd4fd60a 100644 --- a/tests/test_lemonade_client.py +++ b/tests/test_lemonade_client.py @@ -1842,99 +1842,6 @@ def test_integration_responses_endpoint(self): print("⚠️ Responses endpoint might not be fully implemented yet") -class TestNormalizeSystemInfo: - """Tests for LemonadeClient._normalize_system_info backward compatibility.""" - - def test_v10_keys_get_legacy_aliases(self): - """Lemonade v10 response (amd_npu, amd_igpu) gets npu/gpu aliases.""" - v10_response = { - "OS Version": "Windows 11", - "Processor": "AMD Ryzen AI 9 HX 375", - "Physical Memory": "32.0 GB", - "devices": { - "cpu": {"name": "AMD Ryzen AI 9 HX 375", "available": True}, - "amd_igpu": {"name": "AMD Radeon 890M", "available": True}, - "amd_dgpu": [], - "amd_npu": {"name": "XDNA2", "available": True}, - }, - } - result = LemonadeClient._normalize_system_info(v10_response) - devices = result["devices"] - - # Legacy aliases should be added - assert "npu" in devices - assert devices["npu"]["name"] == "XDNA2" - assert devices["npu"]["available"] is True - assert "gpu" in devices - assert devices["gpu"]["name"] == "AMD Radeon 890M" - - # Original keys should still be present - assert "amd_npu" in devices - assert "amd_igpu" in devices - - def test_legacy_keys_get_v10_aliases(self): - """Lemonade v9 response (npu, gpu) gets amd_npu/amd_igpu aliases.""" - v9_response = { - "OS Version": "Linux", - "Physical Memory": "64.0 GB", - "devices": { - "npu": {"name": "AMD Ryzen AI NPU", "available": True}, - "gpu": {"name": "AMD Radeon", "available": True}, - }, - } - result = LemonadeClient._normalize_system_info(v9_response) - devices = result["devices"] - - # v10 aliases should be added - assert "amd_npu" in devices - assert devices["amd_npu"]["name"] == "AMD Ryzen AI NPU" - assert "amd_igpu" in devices - assert devices["amd_igpu"]["name"] == "AMD Radeon" - - # Original keys should still be present - assert "npu" in devices - assert "gpu" in devices - - def test_no_devices_key(self): - """Response without devices key is returned as-is.""" - info = {"OS Version": "Linux", "Physical Memory": "16.0 GB"} - result = LemonadeClient._normalize_system_info(info) - assert result == info - - def test_empty_devices(self): - """Response with empty devices dict is returned as-is.""" - info = {"devices": {}} - result = LemonadeClient._normalize_system_info(info) - assert result["devices"] == {} - - def test_npu_not_available_v10(self): - """NPU with available=False is still normalized.""" - info = { - "devices": { - "amd_npu": {"name": "XDNA2", "available": False}, - }, - } - result = LemonadeClient._normalize_system_info(info) - assert result["devices"]["npu"]["available"] is False - - def test_both_keys_present_no_overwrite(self): - """When both legacy and v10 keys exist, neither is overwritten.""" - info = { - "devices": { - "npu": {"name": "legacy-npu", "available": True}, - "amd_npu": {"name": "v10-npu", "available": True}, - "gpu": {"name": "legacy-gpu", "available": True}, - "amd_igpu": {"name": "v10-igpu", "available": True}, - }, - } - result = LemonadeClient._normalize_system_info(info) - # Neither should be overwritten - assert result["devices"]["npu"]["name"] == "legacy-npu" - assert result["devices"]["amd_npu"]["name"] == "v10-npu" - assert result["devices"]["gpu"]["name"] == "legacy-gpu" - assert result["devices"]["amd_igpu"]["name"] == "v10-igpu" - - if __name__ == "__main__": # Use pytest to run tests - either all tests or a specific test pattern import pytest From 660425c8f1d5c4eb2ec8e5c4e1827a0be82610ce Mon Sep 17 00:00:00 2001 From: Claude Code Date: Mon, 16 Mar 2026 14:39:00 -0700 Subject: [PATCH 3/3] Update agent output keys to amd_npu/amd_igpu for consistency --- examples/hardware_advisor_agent.py | 4 ++-- tests/test_hardware_advisor_agent.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/hardware_advisor_agent.py b/examples/hardware_advisor_agent.py index 3cada2862..9439c488a 100644 --- a/examples/hardware_advisor_agent.py +++ b/examples/hardware_advisor_agent.py @@ -156,13 +156,13 @@ def get_hardware_info() -> Dict[str, Any]: "os": info.get("OS Version", "Unknown"), "processor": info.get("Processor", "Unknown"), "ram_gb": ram_gb, - "gpu": { + "amd_igpu": { "name": gpu_name, "memory_mb": gpu_memory_mb, "memory_gb": gpu_memory_gb, "available": gpu_available, }, - "npu": {"name": npu_name, "available": npu_available}, + "amd_npu": {"name": npu_name, "available": npu_available}, } except Exception as e: return { diff --git a/tests/test_hardware_advisor_agent.py b/tests/test_hardware_advisor_agent.py index b5edebae9..ed4d58d0b 100644 --- a/tests/test_hardware_advisor_agent.py +++ b/tests/test_hardware_advisor_agent.py @@ -92,8 +92,8 @@ def test_get_hardware_info_returns_success(self, agent, mock_lemonade_client): assert result["success"] is True assert "ram_gb" in result - assert "gpu" in result - assert "npu" in result + assert "amd_igpu" in result + assert "amd_npu" in result assert result["ram_gb"] == 32.0 def test_list_available_models_returns_success(self, agent, mock_lemonade_client): @@ -173,8 +173,8 @@ def test_get_hardware_info_includes_all_components(self, agent): assert "os" in result assert "processor" in result assert "ram_gb" in result - assert "gpu" in result - assert "npu" in result + assert "amd_igpu" in result + assert "amd_npu" in result def test_recommend_models_respects_memory_constraints(self, agent): """Test recommend_models filters by available RAM."""