From 518b5f8e1a285b6517b65d850b804d2780e427ce Mon Sep 17 00:00:00 2001 From: spinagon <890571+spinagon@users.noreply.github.com> Date: Wed, 27 Nov 2024 21:39:23 +0300 Subject: [PATCH] Detect vision capable models --- llm_openrouter.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llm_openrouter.py b/llm_openrouter.py index 41384d8..21bb54d 100644 --- a/llm_openrouter.py +++ b/llm_openrouter.py @@ -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 ) )