Skip to content

Commit 1e8ca2c

Browse files
committed
feat(utils): add vision model type
Signed-off-by: Max Wittig <[email protected]>
1 parent bb6644f commit 1e8ca2c

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/vllm_router/utils.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class ModelType(enum.Enum):
5151
embeddings = "/v1/embeddings"
5252
rerank = "/v1/rerank"
5353
score = "/v1/score"
54+
vision = "/v1/chat/completions"
5455

5556
@staticmethod
5657
def get_test_payload(model_type: str):
@@ -75,6 +76,26 @@ def get_test_payload(model_type: str):
7576
return {"query": "Hello", "documents": ["Test"]}
7677
case ModelType.score:
7778
return {"encoding_format": "float", "text_1": "Test", "test_2": "Test2"}
79+
case ModelType.vision:
80+
return {
81+
"messages": [
82+
{
83+
"role": "user",
84+
"content": [
85+
{
86+
"type": "text",
87+
"text": "This is a test. Just reply with yes",
88+
},
89+
{
90+
"type": "image_url",
91+
"image_url": {
92+
"url": "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAAG0lEQVR4nGLinfJq851wJn69udZSvIAAAAD//yf3BLKCfW8HAAAAAElFTkSuQmCC"
93+
},
94+
},
95+
],
96+
}
97+
]
98+
}
7899

79100
@staticmethod
80101
def get_all_fields():

0 commit comments

Comments
 (0)