Skip to content

[FEATURE] Allow custom annotations on the Helm-generated default ModelConfig #2200

Description

@marians

📋 Prerequisites

📝 Feature Summary

Add a values knob to set arbitrary metadata.annotations on the ModelConfig rendered by helm/kagent/templates/modelconfig.yaml.

❓ Problem Statement / Motivation

The Helm chart renders a default ModelConfig (name from kagent.defaultModelConfigName) from providers[.Values.providers.default]. Its metadata currently emits only name, namespace, and labels -- there is no way to attach annotations to it via values.

Downstream distributions and platform integrations often need to attach their own annotations to this object. In our case we run a UI in front of kagent that reads a display-name annotation off the ModelConfig to render a friendly model label; without an annotations knob there is no supported way to set it on the chart-generated default ModelConfig.

Today the only workarounds are to define a separate ModelConfig outside the chart (leaving the chart's default ModelConfig unused but still created — it has no disable toggle), or to post-patch a chart-owned object across release boundaries, which fights the Helm/Flux owner on every reconcile.

Anyone packaging kagent under their own platform, or integrating with tooling that keys off resource annotations, would benefit.

💡 Proposed Solution

Add an optional annotations map on the provider entry and render it onto the ModelConfig metadata. Per-provider fits the current template, since the default ModelConfig is derived from the single $model := index .Values.providers .Values.providers.default object it already reads.

Template change in helm/kagent/templates/modelconfig.yaml:

    metadata:
      name: {{ include "kagent.defaultModelConfigName" $dot | quote }}
      namespace: {{ include "kagent.namespace" . }}
      labels:
        {{- include "kagent.labels" $dot | nindent 4 }}
      {{- with $model.annotations }}
      annotations:
        {{- toYaml . | nindent 4 }}
      {{- end }}

Usage:

    providers:
      anthropic:
        provider: Anthropic
        model: claude-sonnet-4-6
        annotations:
          example.com/display-name: "Claude Sonnet 4.6"

🔄 Alternatives Considered

  • Define a separate, self-managed ModelConfig instead of using the chart's default. Works, but the chart still creates its (now unused) default ModelConfig — it is rendered unconditionally with no disable toggle -- so operators end up with a stray, un-annotated object.
  • Post-render / Flux post-build patch to inject the annotation into the chart-owned object. Crosses release/owner boundaries and conflicts with Helm's field manager on each reconcile.
  • A dedicated top-level defaultModelConfig.annotations block instead of per-provider. Also fine; per-provider was chosen as the smaller change that travels with the existing $model object.
  • Custom metadata (labels and annotations) for all generated resources.

🎯 Affected Service(s)

Not Sure

📚 Additional Context

Current template (helm/kagent/templates/modelconfig.yaml on main) emits only name/namespace/labels in metadata; spec reads provider, model, apiKeySecretRef, apiKeySecretKey, defaultHeaders, tls, config.

🙋 Are you willing to contribute?

  • I am willing to submit a PR for this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions