Add example for multiple inference operations in a single request

This commit is contained in:
Abdon Pijpelink
2025-11-12 10:37:58 +01:00
parent 3a269f46d0
commit 53d001030f
2 changed files with 34 additions and 0 deletions
@@ -220,3 +220,9 @@ When you prepend a model name with `jinaai/`, the embedding request is automatic
For example, to use Jina AI's multimodal `jina-clip-v2` model, when ingesting and querying data, prepend the model name with `jinaai/` and provide your Jina AI API key in the `options` object. This example uses the Jina AI-specific API `dimensions` parameter to reduce the dimensionality to 512:
{{< code-snippet path="/documentation/headless/snippets/inference/jinaai/" >}}
## Multiple Inference Operations
You can run multiple inference operations within a single request, even when models are hosted in different locations. This example generates image embeddings using `jina-clip-v2` hosted by Jina AI, text embeddings using `all-minilm-l6-v2` hosted by Qdrant Cloud, and BM25 embeddings using the `bm25` model executed locally by the Qdrant cluster:
{{< code-snippet path="/documentation/headless/snippets/inference/multiple/" >}}
@@ -0,0 +1,28 @@
```http
PUT /collections/<your-collection_name>/points?wait=true
{
"points": [
{
"id": 1,
"vector": {
"image": {
"image": "https://qdrant.tech/example.png",
"model": "jinaai/jina-clip-v2",
"options": {
"jina-api-key": "<YOUR_JINAAI_API_KEY>",
"dimensions": 512
}
},
"text": {
"text": "Mars, the red planet",
"model": "sentence-transformers/all-minilm-l6-v2"
},
"bm25": {
"text": "Mars, the red planet",
"model": "qdrant/bm25"
}
}
}
]
}
```