# Any way of reducing the disk space for embbeding vectors in OpenSearch 3.0

**URL:** <https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797>\
**Category:** Machine Learning\
**Tags:** releases, discuss\
**Created:** [June 17, 2025, 4:06am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797 "2025-06-17T04:06:14Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![tejashu](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tejashu](https://forum.opensearch.org/u/tejashu)\
**Post date:** [June 17, 2025, 4:06am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/1 "2025-06-17T04:06:14Z")

</div>

Is there any way we can reduce the disk space of indices stored for embedding vectors?

Our normal index of 100mb is getting shot up to 1gb if embedded with one field of description.

This is 10x more disk space needed. So is there any solution to lessen the disk space while embedding?

---

<div class="post-metadata">

**Author:** ![vinod0x01](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@vinod0x01](https://forum.opensearch.org/u/vinod0x01)\
**Post date:** [June 17, 2025, 6:58am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/2 "2025-06-17T06:58:02Z")

</div>

> [@tejashu](#):
>
> stored

you can try this setting in documentation

> **[Indexing performance tuning](https://docs.opensearch.org/docs/latest/vector-search/performance-tuning-indexing/#expert-level-disable-vector-field-storage-in-the-source-field)**
>
> Indexing performance tuning

---

<div class="post-metadata">

**Author:** ![Navneet](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/navneet/32/3645_2.png) [@Navneet](https://forum.opensearch.org/u/Navneet)\
**Post date:** [June 17, 2025, 7:24am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/3 "2025-06-17T07:24:43Z")

</div>

Hi @tejashu

you should enable derived source feature. Here is the recent blog: [https://opensearch.org/blog/do-more-with-less-save-up-to-3x-on-storage-with-derived-vector-source/](https://opensearch.org/blog/do-more-with-less-save-up-to-3x-on-storage-with-derived-vector-source/)

@vinod0x01 Removing vectors from \_source limits capabilties like re-indexing, updates etc. To overcome those limitations with 2.19(as experimental) and 3.0 as GA we added derived source feature for Vectors. Please take a look at that feature: [https://opensearch.org/blog/do-more-with-less-save-up-to-3x-on-storage-with-derived-vector-source/](https://opensearch.org/blog/do-more-with-less-save-up-to-3x-on-storage-with-derived-vector-source/)

---

<div class="post-metadata">

**Author:** ![tejashu](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tejashu](https://forum.opensearch.org/u/tejashu)\
**Post date:** [June 18, 2025, 3:50am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/4 "2025-06-18T03:50:32Z")

</div>

Thanks for the blog.  
@Navneet  
Is it possible to only store byte vectors so that the storage size is reduced more instead of the FP32 vectors.  
Does OpenSearch provide such a configuration?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![vinod0x01](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@vinod0x01](https://forum.opensearch.org/u/vinod0x01)\
**Post date:** [June 18, 2025, 5:16am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/5 "2025-06-18T05:16:36Z")

</div>

Hi @Navneet thanks for sharing, this is a very helpful, I will try this in my indexing and lets see the performance

---

<div class="post-metadata">

**Author:** ![tejashu](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tejashu](https://forum.opensearch.org/u/tejashu)\
**Post date:** [June 18, 2025, 7:14am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/6 "2025-06-18T07:14:38Z")

</div>

I am sending documents in 10k batches.  
For the second 10k it throws an error

Failed to Validate Access for ModelId WLfEgZcBwC17uYVSzQPT  
org.opensearch.core.concurrency.OpenSearchRejectedExecutionException: rejected execution of org.opensearch.ml.task.MLPredictTaskRunner$$Lambda/0x00007ff0bce46528@3c594a35 on OpenSearchThreadPoolExecutor[name = /opensearch\_ml\_predict, queue capacity = 10000, org.opensearch.common.util.concurrent.OpenSearchThreadPoolExecutor@10408ea[Running, pool size = 12, active threads = 12, queued tasks = 10000, completed tasks = 90419]]

Is there any setting to increase the queue ?

---

<div class="post-metadata">

**Author:** ![Navneet](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/navneet/32/3645_2.png) [@Navneet](https://forum.opensearch.org/u/Navneet)\
**Post date:** [June 19, 2025, 6:04am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/7 "2025-06-19T06:04:58Z")

</div>

@ylwu is there a setting to increase the threadpool queue size? As far as I remember there is none.

Ref: [ml-commons/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java at main · opensearch-project/ml-commons · GitHub](https://github.com/opensearch-project/ml-commons/blob/main/plugin/src/main/java/org/opensearch/ml/plugin/MachineLearningPlugin.java#L1042-L1048)

---

<div class="post-metadata">

**Author:** ![dhrubo](https://avatars.discourse-cdn.com/v4/letter/d/9e8a1a/32.png) [@dhrubo](https://forum.opensearch.org/u/dhrubo)\
**Post date:** [June 19, 2025, 4:17pm UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/8 "2025-06-19T16:17:29Z")

</div>

No there is no settings to increase threadpool queue size in ml-commons.

@tejashu these are the all settings ml-commons have: [ML Commons cluster settings - OpenSearch Documentation](https://docs.opensearch.org/docs/latest/ml-commons-plugin/cluster-settings/)

If you want any more settings to be available, please feel free to cut an issue : [GitHub · Where software is built](https://github.com/opensearch-project/ml-commons/issues)

---

<div class="post-metadata">

**Author:** ![tejashu](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tejashu](https://forum.opensearch.org/u/tejashu)\
**Post date:** [July 2, 2025, 6:24am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/9 "2025-07-02T06:24:16Z")

</div>

Hello ,

Is there a mechanism to show only byte vectors or Opensearch has any api that allows to get the byte quantized vectors from FP32 vectors as this can still reduce the disk storage.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Navneet](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/navneet/32/3645_2.png) [@Navneet](https://forum.opensearch.org/u/Navneet)\
**Post date:** [July 2, 2025, 5:08pm UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/11 "2025-07-02T17:08:41Z")

</div>

I am bit confused on the question I will try to ans based on best of my understanding. If you still have questions feel free to put them.

OpenSearch do support different data types for vectors which include fp32, byte and binary. So if you already have vectors within this range I would suggest directly using the `data_type` [field](https://docs.opensearch.org/docs/latest/field-types/supported-field-types/knn-vector/#parameters) while creating the index mappings. This will reduce the memory and disk footprint since vectors are already present as byte or binary.

If your vectors are in fp32 but you want to quantize then to byte, binary or fp16. OpenSearch provides different [quantization technique](https://docs.opensearch.org/docs/latest/vector-search/optimizing-storage/knn-vector-quantization/) to do that. This also reduce the memory footprint and disk but not same as the first option I provided. Since we store both fp32 vectors and quantized vectors on disk. During search we are using only quantized vectors.

Now in quantization if you are asking as a user you can view what were the values of quantized vectors via some API then ans is no, you cannot do that.

---

<div class="post-metadata">

**Author:** ![tejashu](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tejashu](https://forum.opensearch.org/u/tejashu)\
**Post date:** [July 2, 2025, 5:14pm UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/12 "2025-07-02T17:14:05Z")

</div>

I was asking since the pretrained models returns and stores only FP32 vectors. Is there any way we can capture this FP32 vectors and quantize to byte/binary and store them.  
Would this cause accuracy of the data to be lost during search time?

---

<div class="post-metadata">

**Author:** ![Navneet](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/navneet/32/3645_2.png) [@Navneet](https://forum.opensearch.org/u/Navneet)\
**Post date:** [July 2, 2025, 7:19pm UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/13 "2025-07-02T19:19:05Z")

</div>

@tejashu if your index mappings has [quantization](https://docs.opensearch.org/docs/latest/vector-search/optimizing-storage/knn-vector-quantization/) in it, then after the model has converted the text to fp32 vector system will convert it.

If you want to do quantization of your own using some custom code in between, you can use Model PostProcessor. Here is a reference: [ml-commons/docs/tutorials/semantic\_search/semantic\_search\_with\_byte\_quantized\_vector.md at main · opensearch-project/ml-commons · GitHub](https://github.com/opensearch-project/ml-commons/blob/main/docs/tutorials/semantic_search/semantic_search_with_byte_quantized_vector.md)

---

<div class="post-metadata">

**Author:** ![tejashu](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tejashu](https://forum.opensearch.org/u/tejashu)\
**Post date:** [July 3, 2025, 3:24am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/14 "2025-07-03T03:24:07Z")

</div>

would this reduce the disk storage?  
or would it index both the FP32 and byte vector?

---

<div class="post-metadata">

**Author:** ![tejashu](https://avatars.discourse-cdn.com/v4/letter/t/e36b37/32.png) [@tejashu](https://forum.opensearch.org/u/tejashu)\
**Post date:** [July 3, 2025, 6:29am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/15 "2025-07-03T06:29:26Z")

</div>

> [@Navneet](#):
>
> O

Also the \_source excludes if set in mappings is increasing the storage size by 2X.  
Is this behavior expected or is this a bug?

Ex:

```
"mappings": {
  "_source": {
    "excludes": [
      "Description*"
    ]
  },
  "properties": {

```

increased the storage size for 9662 docs from 22mB to 53.7mB.

Could you please let me know your feddback,  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [September 1, 2025, 6:30am UTC](https://forum.opensearch.org/t/any-way-of-reducing-the-disk-space-for-embbeding-vectors-in-opensearch-3-0/24797/16 "2025-09-01T06:30:13Z")

</div>

Closed on September 1, 2025, 6:30am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
