Skip to content

feat(controller): add InferenceService hardware-labels info metric (#1121)#1160

Merged
Defilan merged 2 commits into
defilantech:mainfrom
Defilan:foreman/night-1121/issue-1121
Jul 18, 2026
Merged

feat(controller): add InferenceService hardware-labels info metric (#1121)#1160
Defilan merged 2 commits into
defilantech:mainfrom
Defilan:foreman/night-1121/issue-1121

Conversation

@Defilan

@Defilan Defilan commented Jul 18, 2026

Copy link
Copy Markdown
Member

What

Add an llmkube_inferenceservice_info gauge (value 1) carrying {inferenceservice, namespace, accelerator, runtime} so a fleet dashboard can group InferenceServices by hardware family (Metal / AMD / NVIDIA) and serving backend directly from the CR-state metric.

Why

Fixes #1121. Today llmkube_inferenceservice_phase carries only {inferenceservice, namespace, phase}, so a fleet-overview dashboard can list models and phases but cannot answer "group my models by Metal vs AMD vs NVIDIA" without joining node-level metrics. This is the Phase-3 hardware-per-model follow-up to the fleet dashboard.

How

  • New InferenceServiceInfo gauge in internal/metrics/metrics.go, registered once.
  • Set in status_builder.go from Model.Spec.Hardware.Accelerator and InferenceService.Spec.Runtime (with the CRD defaults cpu / llamacpp as fallbacks; empty values guarded). Bounded cardinality (both labels are closed enums).
  • Stale-series cleanup: DeletePartialMatch({inferenceservice, namespace}) runs before the Set(1) so that when a Model's accelerator or an ISvc's runtime changes in place, exactly one series exists per ISvc (no double-counting on a fleet dashboard).

Testing

  • Metrics-package test asserts the info gauge is emitted with the hardware labels and that a prior label-set is removed when it changes (the old combo reads 0 after DeletePartialMatch).
  • Full internal/controller + internal/metrics suites green; make lint clean.

Checklist

  • Tests added/updated
  • make test passes (controller envtest + metrics suites green)
  • make lint passes (0 issues)
  • Conventional commits, DCO signed
  • AI assistance disclosed below
  • Fixes #1121

AI-assisted (band-3): implemented by an LLMKube Foreman coder agent (qwopus 35B), then reviewed by a human who caught a stale-series leak; a second Foreman revision cycle applied the DeletePartialMatch fix, re-verified before opening. Human owns the review conversation.

Defilan added 2 commits July 18, 2026 02:45
Add a companion llmkube_inferenceservice_info gauge (value 1) carrying
{inferenceservice, namespace, accelerator, runtime} labels so operators
can group the fleet by Metal/AMD/NVIDIA and serving backend without
churning the phase metric cardinality.

The accelerator label is sourced from Model.Spec.Hardware.Accelerator
(defaulting to "cpu" when unset), and the runtime label from
InferenceService.Spec.Runtime (defaulting to "llamacpp").

Also add a unit test asserting the new metric is registered and emitted
with the hardware labels for a representative InferenceService.

Fixes defilantech#1121

Signed-off-by: Foreman Bot <chris@mahercode.io>
…changes

The InferenceServiceInfo info gauge only called WithLabelValues(...).Set(1)
for the current accelerator/runtime label-set and never cleared the
previous one. When a Model's accelerator changed in place (e.g. cpu ->
cuda) or an InferenceService's runtime changed, the old series lingered
at 1 forever alongside the new one, causing double-counting on fleet
dashboards grouping by accelerator.

Fix by calling DeletePartialMatch on the info gauge before emitting the
new series, ensuring exactly one series exists per InferenceService.

Also fix the TestInferenceServiceInfo regression test which asserted the
old 'cuda' series was still 1 after switching to 'rocm' — that encoded
the bug. Change it to assert the old label-set is gone (0) and only the
new label-set is 1.

Fixes defilantech#1121

Signed-off-by: Foreman Bot <chris@mahercode.io>
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.27273% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/controller/inferenceservice_controller.go 66.66% 3 Missing ⚠️
internal/controller/status_builder.go 83.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@Defilan
Defilan merged commit 039adaa into defilantech:main Jul 18, 2026
23 checks passed
@github-actions github-actions Bot mentioned this pull request Jul 18, 2026
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request Jul 20, 2026
…7 ➔ 0.9.8) (#1660)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/defilantech/charts/llmkube](https://github.com/defilantech/LLMKube) | patch | `0.9.7` → `0.9.8` |

---

### Release Notes

<details>
<summary>defilantech/LLMKube (ghcr.io/defilantech/charts/llmkube)</summary>

### [`v0.9.8`](https://github.com/defilantech/LLMKube/blob/HEAD/CHANGELOG.md#098-2026-07-19)

[Compare Source](defilantech/LLMKube@v0.9.7...v0.9.8)

##### Features

- **controller:** add InferenceService hardware-labels info metric ([#&#8203;1121](defilantech/LLMKube#1121)) ([#&#8203;1160](defilantech/LLMKube#1160)) ([039adaa](defilantech/LLMKube@039adaa))
- **controller:** add llamacpp-router runtime for multi-model serving ([#&#8203;1152](defilantech/LLMKube#1152)) ([fae5983](defilantech/LLMKube@fae5983))
- **controller:** explicit vllm serve entrypoint for image-agnostic vLLM ([#&#8203;1164](defilantech/LLMKube#1164)) ([#&#8203;1165](defilantech/LLMKube#1165)) ([3eeb580](defilantech/LLMKube@3eeb580))
- **controller:** pass staged model directory to vLLM/SGLang for multi-file models ([#&#8203;1157](defilantech/LLMKube#1157)) ([#&#8203;1159](defilantech/LLMKube#1159)) ([a24fa94](defilantech/LLMKube@a24fa94))
- **controller:** ROCm/HIP runtime tier for AMD nodes ([#&#8203;701](defilantech/LLMKube#701)) ([#&#8203;1154](defilantech/LLMKube#1154)) ([3704d47](defilantech/LLMKube@3704d47))
- **finalize:** gate foreman-finalize on the Foreman verify verdict ([#&#8203;1150](defilantech/LLMKube#1150)) ([#&#8203;1153](defilantech/LLMKube#1153)) ([5c7b2cd](defilantech/LLMKube@5c7b2cd))
- **foreman:** in-executor envtest gate feedback loop ([#&#8203;768](defilantech/LLMKube#768)) ([#&#8203;1135](defilantech/LLMKube#1135)) ([074544a](defilantech/LLMKube@074544a))
- **foreman:** provider-neutral CodeHost/WorkItems/ChangePolicy seams ([#&#8203;1158](defilantech/LLMKube#1158)) ([#&#8203;1161](defilantech/LLMKube#1161)) ([d3a8ad6](defilantech/LLMKube@d3a8ad6))
- **observability:** per-InferenceService SLO declaration via Pyrra ([#&#8203;415](defilantech/LLMKube#415)) ([#&#8203;1149](defilantech/LLMKube#1149)) ([4ae022c](defilantech/LLMKube@4ae022c))

##### Bug Fixes

- bump boilerplate copyright year 2025 -> 2026 ([#&#8203;1162](defilantech/LLMKube#1162)) ([#&#8203;1163](defilantech/LLMKube#1163)) ([30dfaf2](defilantech/LLMKube@30dfaf2))

##### Documentation

- document strict-taint model caches ([#&#8203;1132](defilantech/LLMKube#1132)) ([9250996](defilantech/LLMKube@9250996))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/1660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add accelerator/runtime labels to InferenceService state metrics for hardware-per-model dashboards

1 participant