mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-04 02:18:29 +02:00
Add MRL to Inference docs
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
This code snippet illustrates how to use smaller vectors for the initial prefetching of candidates from a large collection, followed by re-scoring with the original-sized vectors to improve accuracy, combined with inference. For the smaller vector, it employs Matryoshka Representation Learning (MRL) to reduce the dimensionality of embeddings by specifying the `mrl` parameter in the `options` object.
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
```http
|
||||
POST /collections/{collection_name}/points/query
|
||||
{
|
||||
"prefetch": {
|
||||
"query": {
|
||||
"text": "How to bake cookies?",
|
||||
"model": "openai/text-embedding-3-small",
|
||||
"options": {
|
||||
"openai-api-key": "<YOUR_OPENAI_API_KEY>",
|
||||
"mrl": 64
|
||||
}
|
||||
},
|
||||
"using": "small",
|
||||
"limit": 1000
|
||||
},
|
||||
"query": {
|
||||
"text": "How to bake cookies?",
|
||||
"model": "openai/text-embedding-3-small",
|
||||
"options": {
|
||||
"openai-api-key": "<YOUR_OPENAI_API_KEY>"
|
||||
}
|
||||
},
|
||||
"using": "large",
|
||||
"limit": 10
|
||||
}
|
||||
```
|
||||
@@ -0,0 +1 @@
|
||||
This code snippet illustrates how to reduce the dimensionality of embeddings using Matryoshka Representation Learning (MRL) when using inference. It demonstrates how to insert a point into a Qdrant collection with a reduced-size vector by specifying the `mrl` parameter in the `options` object.
|
||||
@@ -0,0 +1,20 @@
|
||||
```http
|
||||
PUT /collections/{collection_name}/points?wait=true
|
||||
{
|
||||
"points": [
|
||||
{
|
||||
"id": 1,
|
||||
"vector": {
|
||||
"small": {
|
||||
"text": "Recipe for baking chocolate chip cookies",
|
||||
"model": "openai/text-embedding-3-small",
|
||||
"options": {
|
||||
"openai-api-key": "<YOUR_OPENAI_API_KEY>",
|
||||
"mrl": 64
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user