Skip to content

Support custom or self-hosted models that aren't on OpenRouter #17

Description

@TheCoder30ec4

Motivation

Candidates currently have to exist in OpenRouter's catalog. Teams also use Azure OpenAI deployments, local models (Ollama, vLLM) and fine-tunes, which can't be routed to today. The router also can't start at all if OpenRouter's model list is unreachable.

Proposal

Let models accept ModelInfo objects as well as id strings:

Router(jev_api_key=k, models=[
    "openai/gpt-6-luna",
    ModelInfo("local/llama-4-8b", context_length=128_000, max_output_tokens=8_000,
              prompt_price=0.0, completion_price=0.0, description="Local, private, slow"),
])

Only fetch the catalog when at least one id string needs looking up.

Done when

  • A router made only of ModelInfo objects never touches the network until route()
  • Tests and a README example

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: catalogLive model list, prices and provider filteringenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions