Update README.md
Browse files
README.md
CHANGED
|
@@ -68,9 +68,103 @@ Built on [Qwen3-1.7B-Base](https://huggingface.co/Qwen/Qwen3-1.7B-Base) with [Si
|
|
| 68 |
| InternVL3-2B | 2.2B | 69.2 | 73.6 | 71.9 | 64.3 |
|
| 69 |
| InternVL3.5-2B | 2.2B | 71.6 | 74.6 | 70.9 | 62.0 |
|
| 70 |
|
| 71 |
-
## Usage
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
```bash
|
| 76 |
uv sync
|
|
|
|
| 68 |
| InternVL3-2B | 2.2B | 69.2 | 73.6 | 71.9 | 64.3 |
|
| 69 |
| InternVL3.5-2B | 2.2B | 71.6 | 74.6 | 70.9 | 62.0 |
|
| 70 |
|
|
|
|
| 71 |
|
| 72 |
+
## Via Jina API
|
| 73 |
+
|
| 74 |
+
We provide an OpenAI-compatible API at `https://api-beta-vlm.jina.ai`.
|
| 75 |
+
|
| 76 |
+
All requests require a Jina API key in the Authorization header:
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
Authorization: Bearer YOUR_JINA_API_KEY
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
Get your API key at [jina.ai](https://jina.ai).
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
### Image from URL
|
| 86 |
+
|
| 87 |
+
| Format | Example |
|
| 88 |
+
|--------|---------|
|
| 89 |
+
| HTTP/HTTPS URL | `https://example.com/image.jpg` |
|
| 90 |
+
| Base64 data URI | `data:image/jpeg;base64,/9j/4AAQ...` |
|
| 91 |
+
|
| 92 |
+
```bash
|
| 93 |
+
curl https://api-beta-vlm.jina.ai/v1/chat/completions \
|
| 94 |
+
-H "Content-Type: application/json" \
|
| 95 |
+
-H "Authorization: Bearer $JINA_API_KEY" \
|
| 96 |
+
-d '{
|
| 97 |
+
"model": "jina-vlm",
|
| 98 |
+
"messages": [{
|
| 99 |
+
"role": "user",
|
| 100 |
+
"content": [
|
| 101 |
+
{"type": "text", "text": "Describe this image"},
|
| 102 |
+
{"type": "image_url", "image_url": {"url": "https://example.com/photo.jpg"}}
|
| 103 |
+
]
|
| 104 |
+
}]
|
| 105 |
+
}'
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
### Text-only query
|
| 109 |
+
|
| 110 |
+
```bash
|
| 111 |
+
curl https://api-beta-vlm.jina.ai/v1/chat/completions \
|
| 112 |
+
-H "Content-Type: application/json" \
|
| 113 |
+
-H "Authorization: Bearer $JINA_API_KEY" \
|
| 114 |
+
-d '{
|
| 115 |
+
"model": "jina-vlm",
|
| 116 |
+
"messages": [{"role": "user", "content": "What is the capital of France?"}]
|
| 117 |
+
}'
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
### Local image (base64)
|
| 121 |
+
|
| 122 |
+
```bash
|
| 123 |
+
curl https://api-beta-vlm.jina.ai/v1/chat/completions \
|
| 124 |
+
-H "Content-Type: application/json" \
|
| 125 |
+
-H "Authorization: Bearer $JINA_API_KEY" \
|
| 126 |
+
-d '{
|
| 127 |
+
"model": "jina-vlm",
|
| 128 |
+
"messages": [{
|
| 129 |
+
"role": "user",
|
| 130 |
+
"content": [
|
| 131 |
+
{"type": "text", "text": "What is in this image?"},
|
| 132 |
+
{"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,'$(base64 -i image.jpg)'"}}
|
| 133 |
+
]
|
| 134 |
+
}]
|
| 135 |
+
}'
|
| 136 |
+
```
|
| 137 |
+
|
| 138 |
+
### Streaming response
|
| 139 |
+
|
| 140 |
+
Add `"stream": true` to receive tokens as they're generated:
|
| 141 |
+
|
| 142 |
+
```bash
|
| 143 |
+
curl https://api-beta-vlm.jina.ai/v1/chat/completions \
|
| 144 |
+
-H "Content-Type: application/json" \
|
| 145 |
+
-H "Authorization: Bearer $JINA_API_KEY" \
|
| 146 |
+
-d '{
|
| 147 |
+
"model": "jina-vlm",
|
| 148 |
+
"stream": true,
|
| 149 |
+
"messages": [{"role": "user", "content": "Write a haiku about coding"}]
|
| 150 |
+
}'
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
When the service is cold starting, you'll receive:
|
| 154 |
+
|
| 155 |
+
```json
|
| 156 |
+
{
|
| 157 |
+
"error": {
|
| 158 |
+
"message": "Model is loading, please retry in 30-60 seconds. Cold start takes ~30s after the service scales up.",
|
| 159 |
+
"code": 503
|
| 160 |
+
}
|
| 161 |
+
}
|
| 162 |
+
```
|
| 163 |
+
|
| 164 |
+
Simply retry your request after waiting.
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
## Local Installation
|
| 168 |
|
| 169 |
```bash
|
| 170 |
uv sync
|