fix: HuggingFace model pricing, vendor detection, cost precision (v1.9.3)#135
Merged
devonakelley merged 1 commit intomainfrom Mar 29, 2026
Merged
Conversation
…cision Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three fixes for $0 cost display and missing model pricing in telemetry.
Fix 1:
pricing.py— Missing HuggingFace modelsAdded pricing entries for models actively used in the routing pipeline that were returning fallback/wrong costs:
meta-llama/llama-3.3-70b-instruct($0.90/$0.90 per 1M)mistralai/mixtral-8x22b-v0.1($1.20/$1.20 per 1M)qwen/qwen2.5-72b-instruct($0.90/$0.90 per 1M)deepseek/deepseek-r1($0.55/$2.19 per 1M)Also added a HuggingFace fuzzy matching block to
normalize_model_name()— this block was missing entirely, meaning all HF models fell through to raw string lookup and often missed.Fix 2:
openai_instr.py— Vendor detection for HF-routed modelsModels like
meta-llama/Llama-3.3-70B-Instructare called via the OpenAI-compatible API but were being attributed as vendoropenai, hitting the GPT-4 pricing fallback ($30/$60 per 1M) instead of correct HF pricing.Updated
_detect_vendor()to detect Llama, Mixtral, and Qwen model names and route them to thehuggingfacevendor for correct cost attribution.Fix 3:
collector.py— Cost precisionCost was stored at 6 decimal places but the dashboard was rendering small values as $0.00. Rounded
cost_usdto 4 decimal places in the event payload so sub-cent costs (e.g. $0.0028) display correctly instead of showing $0.Testing
All 72 existing tests pass. No breaking changes — all fixes are additive.
Version
Bumped to
1.9.3.