Skip to content

fix(proxy): skip pricing lookup for passthrough model labels - #3174

Open
Hughhhhcoder wants to merge 1 commit into
headroomlabs-ai:mainfrom
Hughhhhcoder:fix/skip-passthrough-pricing
Open

fix(proxy): skip pricing lookup for passthrough model labels#3174
Hughhhhcoder wants to merge 1 commit into
headroomlabs-ai:mainfrom
Hughhhhcoder:fix/skip-passthrough-pricing

Conversation

@Hughhhhcoder

@Hughhhhcoder Hughhhhcoder commented Aug 21, 2026

Copy link
Copy Markdown

Description

Internal passthrough:<endpoint> model labels (used by passthrough handlers such as Anthropic /v1/messages/count_tokens) are not billable model calls. CostTracker passed them into LiteLLM for pricing lookup, which rejects them with LLM Provider NOT provided and emits a spurious pricing WARNING per process — plus a misleading passthrough:* row on the dashboard.

Closes #2578

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Changes Made

  • Added _is_passthrough_model() to detect internal passthrough: labels.
  • Skip pricing lookup for those labels before touching LiteLLM, so no spurious WARNING is emitted.

Testing

  • Unit tests pass (pytest)
  • New tests added for new functionality

Test Output

$ pytest tests/test_cost_passthrough_pricing.py -q
3 passed

Real Behavior Proof

  • Environment: macOS, Python 3.11
  • Exact command / steps: pytest tests/test_cost_passthrough_pricing.py -q
  • Observed result: 3 passed — passthrough labels return None with no WARNING; non-passthrough models still priced.
  • Not tested: full headroom test suite (only the new/changed cost tests).

Runtime Rollout Safety

  • Rollout-managed feature(s): N/A
  • Minimum rollout channel: N/A
  • Stable/default behavior changed: No — passthrough labels already failed pricing; this only removes the spurious WARNING.
  • Kill switch / disable path: N/A (pure lookup skip, no new state)
  • Unsafe override required: No
  • Qualification impact: None
  • Rollback path: Revert this commit.

Review Readiness

  • I have performed a self-review
  • This PR is ready for human review

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • New and existing unit tests pass locally with my changes
  • I did not edit CHANGELOG.md

Additional Notes

  • Only the new/changed cost tests were run locally; the change is localized to the pricing lookup path and does not touch core proxy routing.

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

PR governance

This PR follows the template and is marked ready for human review.

@github-actions github-actions Bot added status: needs author action Pull request body or readiness checklist still needs author updates status: ready for review Pull request body is complete and the author marked it ready for human review and removed status: needs author action Pull request body or readiness checklist still needs author updates labels Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ready for review Pull request body is complete and the author marked it ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pricing lookup for internal passthrough:* model names spams "LLM Provider NOT provided" warnings via LiteLLM

1 participant