fix(llm): hardware badge defaults to NVIDIA L4
Browse filesStale string from the droplet days — _default_hardware_label() still
returned "AMD MI300X" when remote vLLM was configured, so the UI
badge and /api/backend disagreed with the emissions ledger (which
already maps to nvidia_l4 correctly via _hardware_for).
Both Riprap inference Spaces run on L4. Operator override via
RIPRAP_HARDWARE_LABEL still works for redeploys.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- app/llm.py +9 -2
app/llm.py
CHANGED
|
@@ -315,10 +315,17 @@ def _default_hardware_label() -> str:
|
|
| 315 |
"""Best-guess hardware label for the UI badge.
|
| 316 |
|
| 317 |
Auto-detected from env. Operators can override with
|
| 318 |
-
RIPRAP_HARDWARE_LABEL (e.g. "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 319 |
"""
|
| 320 |
if _PRIMARY == "vllm" and _VLLM_BASE:
|
| 321 |
-
return "
|
| 322 |
if os.environ.get("SPACE_ID") or os.environ.get("HF_SPACE_ID"):
|
| 323 |
return "NVIDIA T4"
|
| 324 |
return "Local"
|
|
|
|
| 315 |
"""Best-guess hardware label for the UI badge.
|
| 316 |
|
| 317 |
Auto-detected from env. Operators can override with
|
| 318 |
+
RIPRAP_HARDWARE_LABEL (e.g. "NVIDIA L4" / "AMD MI300X" /
|
| 319 |
+
"NVIDIA T4" / "Apple M3 Pro").
|
| 320 |
+
|
| 321 |
+
Default when a remote vLLM/Ollama backend is configured is "NVIDIA
|
| 322 |
+
L4" — both Riprap inference Spaces (msradam/riprap-vllm,
|
| 323 |
+
msradam/riprap-inference) run on L4. The MI300X droplet was
|
| 324 |
+
decommissioned 2026-05-06; set RIPRAP_HARDWARE_LABEL=AMD MI300X
|
| 325 |
+
explicitly if redeploying to that hardware.
|
| 326 |
"""
|
| 327 |
if _PRIMARY == "vllm" and _VLLM_BASE:
|
| 328 |
+
return "NVIDIA L4"
|
| 329 |
if os.environ.get("SPACE_ID") or os.environ.get("HF_SPACE_ID"):
|
| 330 |
return "NVIDIA T4"
|
| 331 |
return "Local"
|