Skip to content

feat(ai): llm gateway calls record their serving backend in the spend ledger #474

Closed

Description

@dan-petty

Context & Rationale

The gateway picks a deployment for every call, but devops-cli records only the gateway as the server. Cost, latency and review quality therefore cannot be attributed to the backend that did the work. The gateway already names the deployment in every response (x-litellm-model-id, x-litellm-model-api-base), and the spend ledger's backend_info column is unused for gateway calls.

Scope & Deliverables

  • Context & Rationale*: The gateway picks a deployment for every call, but devops-cli records only the gateway as the server. Cost, latency and review quality therefore cannot be attributed to the backend that did the work. The gateway already names the deployment in every response (x-litellm-model-id, x-litellm-model-api-base), and the spend ledger's backend_info column is unused for gateway calls.
  • Deliverable*: Capture those headers in the OpenAI-compatible client (streaming included) and record them per call. Add devops ai cost --by backend. This is the input for cost from real traffic in devops ai gateway tune and for the per-backend quality baseline.
  • Constraint*: Providers other than the gateway leave the field empty rather than guessing.

Strategic Alignment

  • Milestone: v0.2.23 (Foundational Architectural Guardrails & Project Hygiene)
  • Roadmap Reference: docs/ROADMAP.md

Activity

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

    @dan-petty
    OwnerAuthor

    Closed by #493, merged into release/v0.2.23.

    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 Sep 28, 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/aitype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions