docs: warn that model_cost entries may not be callable; surface get_valid_models#533
Open
dparkmit24 wants to merge 1 commit into
Open
docs: warn that model_cost entries may not be callable; surface get_valid_models#533dparkmit24 wants to merge 1 commit into
dparkmit24 wants to merge 1 commit into
Conversation
…alid_models A model appearing in litellm.model_cost does not mean a given API key can call it; entries can be retired, not yet GA, or account-gated, and the map is the natural place users look when deciding which model strings to put in an app. Add a warning admonition on the model_cost section pointing to get_valid_models(check_provider_endpoint=True) for live availability, expand the get_valid_models docs to say when to prefer the endpoint check over the static list, add a model picker example, and note that get_max_tokens raises for models absent from the map.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
litellm.model_costis the natural reference for which model strings exist, but it exists for cost tracking: it holds pricing data for every model LiteLLM can calculate costs for, including entries that are retired, not yet generally available, or account-gated at the provider, and a mapped model can still 404 for a given key. I hit this while seeding a model picker frommodel_cost; several mapped strings were rejected by the live providers. Related to BerriAI/litellm#32785, which came out of the same build session.This adds a warning admonition on the
model_costsection of the token usage page directing readers toget_valid_models(check_provider_endpoint=True)for live availability, expands that helper's section in set_keys to explain when to prefer the endpoint check over the static list, adds a model picker example, and adds a one line note thatget_max_tokensraises for models absent from the map.Verified with
npm run build(passes; the new cross page anchor resolves in the built HTML; the only warnings are pre-existing ones in old release notes).Disclosure: built with AI assistance (my two-agent Claude workflow — Claude Code implemented against my written spec). The issue analysis, scope decisions, and line-by-line review are mine.