# Vector dimension does not match the dimension of the index

**URL:** <https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978>\
**Category:** Support\
**Tags:** vector-database\
**Created:** [March 31, 2023, 10:47pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978 "2023-03-31T22:47:22Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjai](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@sjai](https://community.pinecone.io/u/sjai)\
**Post date:** [March 31, 2023, 10:47pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/1 "2023-03-31T22:47:22Z")

</div>

Running into error upserting data to index. I followed steps from [OpenAI](https://docs.pinecone.io/docs/openai)

1. I created index swith dimension 8 (max)
2. Ran steps [OpenAI](https://docs.pinecone.io/docs/openai#populating-the-index)

Getting the following error:  
Reason: Bad Request

HTTP response headers: HTTPHeaderDict({‘content-type’: ‘application/json’, ‘date’: ‘Fri, 31 Mar 2023 21:56:18 GMT’, ‘x-envoy-upstream-service-time’: ‘2’, ‘content-length’: ‘101’, ‘server’: ‘envoy’})

HTTP response body: {“code”:3,“message”:“Vector dimension 1536 does not match the dimension of the index 8”,“details”:}

---

<div class="post-metadata">

**Author:** ![Cory\_Pinecone](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/cory_pinecone/32/1712_2.png) [@Cory\_Pinecone](https://community.pinecone.io/u/Cory_Pinecone)\
**Post date:** [April 2, 2023, 6:34pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/2 "2023-04-02T18:34:01Z")

</div>

Hi @sjai,

Indexes must be created with a dimension that matches the model’s embedding dimension. The dimension of an index cannot be changed after creation. You will need to create a new index with 1536 dimensions to match OpenAI’s [text-embedding-ada-002](https://platform.openai.com/docs/guides/embeddings/embedding-models) model.

Thanks!

---

<div class="post-metadata">

**Author:** ![rensehuijg](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/rensehuijg/32/896_2.png) [@rensehuijg](https://community.pinecone.io/u/rensehuijg)\
**Post date:** [June 28, 2023, 12:04pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/3 "2023-06-28T12:04:49Z")

</div>

I have less dimensions than my index of 1536 and get the following messages {“code”:3,“message”:“Vector dimension 1409 does not match the dimension of the index 1536”,“details”:}

OpenAI text embedding didn’t gave me more than 1409. Should it be possible to add 1409 dementions to an 1536 index database? How?

---

<div class="post-metadata">

**Author:** ![Jasper](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/jasper/32/4514_2.png) [@Jasper](https://community.pinecone.io/u/Jasper)\
**Post date:** [June 28, 2023, 12:22pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/4 "2023-06-28T12:22:57Z")

</div>

Hi @rensehuijg

if your index dimensions are set to 1536 then you can not store vectors of any other dimesion. OpenAi embeddings (if you use the ada model) will always give embeddings with dimension 1536.

Hope this helps

---

<div class="post-metadata">

**Author:** ![rensehuijg](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/rensehuijg/32/896_2.png) [@rensehuijg](https://community.pinecone.io/u/rensehuijg)\
**Post date:** [June 28, 2023, 1:07pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/5 "2023-06-28T13:07:42Z")

</div>

Thanks Jasper, I found it. I didn’t save the duplicate vector values in my system that where returned form ada model.

---

<div class="post-metadata">

**Author:** ![vr14](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/vr14/32/980_2.png) [@vr14](https://community.pinecone.io/u/vr14)\
**Post date:** [July 6, 2023, 12:14pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/6 "2023-07-06T12:14:42Z")

</div>

Hey, Can you pls help on how to determine the dimension so that we can create relevant index  
@rensehuijg @Jasper

---

<div class="post-metadata">

**Author:** ![Jasper](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/jasper/32/4514_2.png) [@Jasper](https://community.pinecone.io/u/Jasper)\
**Post date:** [July 6, 2023, 1:36pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/7 "2023-07-06T13:36:20Z")

</div>

Hi @vr14

the dimension of your index are determined by which embeddings you will be using (OpenAi, BERT, etc.)

When you know that, you can set the dimensions of the index and start with upserting 🙂

Hope this helps

---

<div class="post-metadata">

**Author:** ![rensehuijg](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/rensehuijg/32/896_2.png) [@rensehuijg](https://community.pinecone.io/u/rensehuijg)\
**Post date:** [July 6, 2023, 1:48pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/8 "2023-07-06T13:48:18Z")

</div>

for embeding openai it you can find it here: [OpenAI Platform](https://platform.openai.com/docs/guides/embeddings/second-generation-models)

---

<div class="post-metadata">

**Author:** ![vr14](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/vr14/32/980_2.png) [@vr14](https://community.pinecone.io/u/vr14)\
**Post date:** [July 6, 2023, 2:16pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/9 "2023-07-06T14:16:43Z")

</div>

Yes, Thanks a lot 🙂

---

<div class="post-metadata">

**Author:** ![vr14](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/vr14/32/980_2.png) [@vr14](https://community.pinecone.io/u/vr14)\
**Post date:** [July 6, 2023, 2:17pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/10 "2023-07-06T14:17:18Z")

</div>

Thanks a lot for the links 🙂

---

<div class="post-metadata">

**Author:** ![bharadwaz.sripada](https://sea2.discourse-cdn.com/flex020/user_avatar/community.pinecone.io/bharadwaz.sripada/32/1258_2.png) [@bharadwaz.sripada](https://community.pinecone.io/u/bharadwaz.sripada)\
**Post date:** [August 19, 2023, 11:11am UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/11 "2023-08-19T11:11:48Z")

</div>

Reason: Bad Request  
HTTP response headers: HTTPHeaderDict({‘content-type’: ‘application/json’, ‘date’: ‘Sat, 19 Aug 2023 11:10:03 GMT’, ‘x-envoy-upstream-service-time’: ‘1’, ‘content-length’: ‘104’, ‘server’: ‘envoy’})  
HTTP response body: {“code”:3,“message”:“Vector dimension 1024 does not match the dimension of the index 1019”,“details”:}

I tried changing dimensions of the index but still I get the same error. Any idea on how to fix this?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/pinecone/original/1X/d16664eba369eeee623700cf12feab5562b37eaf.jpeg) [@system](https://community.pinecone.io/u/system)\
**Post date:** [October 15, 2023, 3:08pm UTC](https://community.pinecone.io/t/vector-dimension-does-not-match-the-dimension-of-the-index/978/12 "2023-10-15T15:08:33Z")

</div>

Closed on October 15, 2023, 3:08pm UTC

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