feat: auto-fill custom provider prices from models.dev#2024
Merged
guillaumegay13 merged 4 commits intoMay 26, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2024 +/- ##
=======================================
Coverage 99.41% 99.41%
=======================================
Files 186 186
Lines 17321 17363 +42
Branches 6871 6884 +13
=======================================
+ Hits 17220 17262 +42
Misses 99 99
Partials 2 2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
1 issue found across 11 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Bundle ReportChanges will increase total bundle size by 2.04kB (0.1%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: manifest-frontend-esmAssets Changed:
Files in
Files in
Files in
|
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
provider_namefrom the frontend probe flow so detected models return imported prices in the custom-provider form.Context
This is the second step after the model catalog cap increase. It preserves manual prices/context, leaves unmatched model IDs on the existing blank-price/default-context path, and only uses exact models.dev matches. It does not fuzzy-match or invent prices.
As of 2026-05-26, models.dev has no Mammouth/Mammoth provider. A Mammouth-style custom provider can still prefill prices for exact model IDs that models.dev knows, such as
openai/gpt-4o-mini; unknown Mammouth-native model IDs remain blank.Validation
npm run build --workspace=packages/sharednpm test --workspace=packages/backend -- models-dev-sync.service.spec.ts custom-provider.service.spec.ts custom-provider.controller.spec.tsnpm test --workspace=packages/frontend -- CustomProviderForm.test.tsx api-extra.test.ts routing-extra.test.tsnpm test --workspace=packages/frontend -- CustomProviderForm.test.tsx InfoTooltip.test.tsx api-extra.test.ts routing-extra.test.tsnpm run build --workspace=packages/backendnpm run build --workspace=packages/frontend(existing large Playground chunk warning)npm exec eslint -- packages/frontend/src/components/CustomProviderForm.tsx packages/frontend/src/components/InfoTooltip.tsx packages/frontend/src/services/api/routing.tsnpm exec prettier -- --check packages/frontend/src/components/CustomProviderForm.tsx packages/frontend/src/components/InfoTooltip.tsx packages/frontend/src/styles/routing-providers.cssgit diff --checkSummary by cubic
Auto-fill custom provider model prices and context from models.dev using provider-name + model ID matches, with an exact model-only fallback marked as estimated. The form shows a single estimated-price tooltip beside Models, preserves user edits, and passes
price_estimatedthrough the API.input_price_per_million_tokens,output_price_per_million_tokens, andcontext_windowon create/update/probe when matched; preserves user-entered values; leaves unmatched blank.price_estimated: true.price_estimatedto DTO/entity and API inpackages/backendandpackages/frontend; probe acceptsprovider_nameand returns enriched models.provider_nameduring probe, renders one info tooltip for estimated prices, and submitsprice_estimatedwhen applicable.Written for commit 174d329. Summary will update on new commits. Review in cubic