Skip to content

Models with no context_length are silently excluded with a misleading 'context 0' reason #10

Description

@TheCoder30ec4

Problem

If OpenRouter omits context_length, ModelInfo.from_openrouter stores 0. The router then always rejects the model with context 0 < N tokens, which reads like the model is tiny rather than "unknown".

Where

  • src/model_router/models.py (from_openrouter)
  • src/model_router/router.py (_reject_reason)

Suggested fix

Store None for unknown context. In _reject_reason, either skip the context check or reject with the reason "context size unknown". Pick one and document it.

Done when

  • The rejection reason says the context size is unknown
  • Test covers a model without context_length

Activity

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

Metadata

Metadata

Assignees

Labels

area: catalogLive model list, prices and provider filteringbugSomething isn't workinggood first issueGood for newcomerspriority: lowNice to have

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions