Skip to content

Commit

Permalink
Detect vision capable models
Browse files Browse the repository at this point in the history
  • Loading branch information
spinagon authored Nov 27, 2024
1 parent b01ab71 commit 518b5f8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions llm_openrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ def register_models(register):
if not key:
return
for model_definition in get_openrouter_models():
vision = False
if "image" in model_definition["architecture"]["modality"].split("->")[0]:
vision = True
register(
OpenRouterChat(
model_id="openrouter/{}".format(model_definition["id"]),
model_name=model_definition["id"],
api_base="https://openrouter.ai/api/v1",
headers={"HTTP-Referer": "https://llm.datasette.io/", "X-Title": "LLM"},
vision=vision
)
)

Expand Down

0 comments on commit 518b5f8

Please sign in to comment.