mtmd: Add another API example

This commit is contained in:
oobabooga 2025-08-10 20:39:04 -07:00
parent 9ec310d858
commit c5340533c0

View file

@ -77,7 +77,9 @@ curl http://127.0.0.1:5000/v1/chat/completions \
}'
```
#### Multimodal support (llama.cpp and ExLlamaV3)
#### Multimodal/vision (llama.cpp and ExLlamaV3)
##### /v1/chat/completions (recommended!)
```shell
curl http://127.0.0.1:5000/v1/chat/completions \
@ -87,7 +89,7 @@ curl http://127.0.0.1:5000/v1/chat/completions \
{
"role": "user",
"content": [
{"type": "text", "text": "What color is this image?"},
{"type": "text", "text": "Please describe what you see in this image."},
{"type": "image_url", "image_url": {"url": "https://github.com/turboderp-org/exllamav3/blob/master/examples/media/cat.png?raw=true"}}
]
}
@ -95,6 +97,38 @@ curl http://127.0.0.1:5000/v1/chat/completions \
}'
```
##### /v1/completions
```shell
curl http://127.0.0.1:5000/v1/completions \
-H "Content-Type: application/json" \
-d '{
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "About image <__media__> and image <__media__>, what I can say is that the first one"
},
{
"type": "image_url",
"image_url": {
"url": "https://github.com/turboderp-org/exllamav3/blob/master/examples/media/cat.png?raw=true"
}
},
{
"type": "image_url",
"image_url": {
"url": "https://github.com/turboderp-org/exllamav3/blob/master/examples/media/strawberry.png?raw=true"
}
}
]
}
]
}'
```
#### SSE streaming
```shell