Skip to content

feat(ai): track local llm usage against hardware spend and recognize cluster gateways #930

Closed

Description

@dan-petty

Summary

The user tracks local LLM usage against their hardware investment ($7,000) to measure amortization, daily savings run-rate, and break-even payoff. Currently:

  1. ai.hardware_cost_usd and ai.reference_model are not displayed in devops config show or documented in config.example.yaml.
  2. is_local() only checks static domain suffixes (.lan, .local) and hostnames, failing to identify cluster/gateway endpoints (e.g. matching k8s.domain, cloudflare.domain, or ai.gateway_url). As a result, requests through cluster gateways are misclassified as external and excluded from local hardware savings calculations, showing $0 equivalent spend.
  3. OpenTelemetry and Prometheus AI telemetry does not emit equivalent local spend counters, and the Grafana AI spend dashboard lacks panels for tracking local hardware savings and payoff against hardware spend.

Deliverables

  • Add opt.AI_HARDWARE_COST_USD and opt.AI_REFERENCE_MODEL to devops config show and document them in config.example.yaml.
  • Enhance is_local() in src/devops_cli/ai/spend/pricing.py to identify cluster endpoints and local gateway hosts via settings (ai.gateway_url, ai.api_base_url, k8s.domain, cloudflare.domain, ai.ollama_urls).
  • Add AI_LOCAL_COST_EQUIVALENT_USD_TOTAL (devops_cli_ai_local_cost_equivalent_usd_total) counter instrument to track cumulative counterfactual hosted savings.
  • Update track_request_spend() in src/devops_cli/ai/spend/ledger.py to emit equivalent spend when requests execute on local/cluster infrastructure.
  • Add local hardware savings and investment amortization payoff panels to k8s/monitoring/dashboards/ai-spend.json.
  • Update /workspaces/devops-cli/config.yaml to set ai.hardware_cost_usd: 7000.0.
  • Unit & integration tests for local identification, config visibility, OTLP metrics emission, and dashboard linting.

Activity

  1. added this to the v0.2.25 milestone on Oct 2, 2026
  2. added
    type/feature
    scope/ai
    scope/telemetry
    priority/p1-high
    on Oct 2, 2026
  3. dan-petty commented on Oct 2, 2026

    @dan-petty
    OwnerAuthor

    Closed by #934, merged into release/v0.2.25.

    GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by devops gh issues close-merged.

  4. added a commit that references this issue on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/aiscope/telemetrytype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions