Skip to content

docs: warn that model_cost entries may not be callable; surface get_valid_models#533

Open
dparkmit24 wants to merge 1 commit into
BerriAI:mainfrom
dparkmit24:docs/model-cost-vs-availability
Open

docs: warn that model_cost entries may not be callable; surface get_valid_models#533
dparkmit24 wants to merge 1 commit into
BerriAI:mainfrom
dparkmit24:docs/model-cost-vs-availability

Conversation

@dparkmit24

Copy link
Copy Markdown

litellm.model_cost is 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 from model_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_cost section of the token usage page directing readers to get_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 that get_max_tokens raises 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.

…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.
@vercel

vercel Bot commented Jul 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Jul 11, 2026 3:07am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant