Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/hardware_advisor_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def get_hardware_info() -> Dict[str, Any]:

# Get NPU information from Lemonade
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")
Expand All @@ -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 {
Expand Down
11 changes: 6 additions & 5 deletions src/gaia/llm/lemonade_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2679,19 +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
- gpu: AMD iGPU/dGPU name, memory (MB), driver version, availability
- npu: Name, driver version, power mode, availability
- 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
if devices.get("npu", {}).get("available"):
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")

Expand Down
14 changes: 8 additions & 6 deletions tests/test_hardware_advisor_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -171,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."""
Expand Down
Loading