# Weaviate Openai Embedding Models

**URL:** <https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375>\
**Category:** General\
**Created:** [August 16, 2024, 3:01pm UTC](https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375 "2024-08-16T15:01:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![spark](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@spark](https://forum.weaviate.io/u/spark)\
**Post date:** [August 16, 2024, 3:01pm UTC](https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375/1 "2024-08-16T15:01:30Z")

</div>

do we have any models for text2vec-openai embedding module which has token limit greater than 8192?

the message i’m getting:  
`weaviate.exceptions.UnexpectedStatusCodeException: Create class! Unexpected status code: 422, with response body: {'error': [{'message': "module 'text2vec-openai': wrong OpenAI model name, available model names are: [ada babbage curie davinci text-embedding-3-small text-embedding-3-large]"}]}.`

```auto
"moduleConfig": {
                "generative-openai": {},
                "text2vec-openai": {
                    "model": "?????",
                }
            },

```

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [August 16, 2024, 6:47pm UTC](https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375/2 "2024-08-16T18:47:06Z")

</div>

hi @spark !!

by default, if you do not provide a model, it will use ada.

However, you can use any of the supported models, as stated in the error message:

- ada
- babbage
- curie
- davinci
- text-embedding-3-small
- text-embedding-3-large

Notice that with the last two you can also specify the dimensions.

You can find more informations on this here:

> **[text2vec-openai | Weaviate - Vector Database](https://weaviate.io/developers/weaviate/modules/retriever-vectorizer-modules/text2vec-openai#available-models-openai)**
>
> Overview

Let me know if that helps!

THanks!

---

<div class="post-metadata">

**Author:** ![spark](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@spark](https://forum.weaviate.io/u/spark)\
**Post date:** [August 16, 2024, 7:22pm UTC](https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375/3 "2024-08-16T19:22:22Z")

</div>

I totally understand @DudaNogueira  
but could you please help me out in this regard which I’m facing, I was using the default.

`{'error': [{'message': "update vector: connection to: OpenAI API failed with status: 400 error: This model's maximum context length is 8192 tokens, however you requested 9655 tokens (9655 in your prompt; 0 for the completion). Please reduce your prompt; or completion length."}]}`

`{'error': [{'message': "update vector: connection to: OpenAI API failed with status: 400 error: This model's maximum context length is 8192 tokens, however you requested 9745 tokens (9745 in your prompt; 0 for the completion). Please reduce your prompt; or completion length."}]}`

---

<div class="post-metadata">

**Author:** ![JK\_Rider](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jk_rider/32/1671_2.png) [@JK\_Rider](https://forum.weaviate.io/u/JK_Rider)\
**Post date:** [August 17, 2024, 5:00pm UTC](https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375/4 "2024-08-17T17:00:37Z")

</div>

All of Openai’s embedding models currently max out 8192 tokens. Some open-source embedding models support larger context windows, but I’d suggest chunking your data and you’ll(probably) get better performance that way too.

---

<div class="post-metadata">

**Author:** ![spark](https://avatars.discourse-cdn.com/v4/letter/s/4da419/32.png) [@spark](https://forum.weaviate.io/u/spark)\
**Post date:** [August 18, 2024, 3:08pm UTC](https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375/5 "2024-08-18T15:08:03Z")

</div>

Could you please guide in this regard?  
@DudaNogueira @JK_Rider

---

<div class="post-metadata">

**Author:** ![JK\_Rider](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/jk_rider/32/1671_2.png) [@JK\_Rider](https://forum.weaviate.io/u/JK_Rider)\
**Post date:** [August 18, 2024, 3:53pm UTC](https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375/6 "2024-08-18T15:53:04Z")

</div>

Here’s a quick guide on Chunking which should help out:[A Guide to Chunking Strategies for Retrieval Augmented Generation (RAG) — Sagacify](https://www.sagacify.com/news/a-guide-to-chunking-strategies-for-retrieval-augmented-generation-rag).

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [August 19, 2024, 12:56pm UTC](https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375/7 "2024-08-19T12:56:58Z")

</div>

hi @spark !!

as @JK_Rider mentioned, the issue is about passing too much context.

If you see this when vectorizing (which seems to be the case, considering the “update vector” part of the log), it is probably be because your chunks are too big to fit in that context windows.

However, if you see this while generating, you are probably passing too much objects (limit=X) to the generation step.

here are some other content on chunking. As you will soon discover, there isn’t a “one size fits all”, as it will depend on a lot of requirements.

> **[A brief introduction to chunking | Weaviate - Vector Database](https://weaviate.io/developers/academy/py/standalone/chunking/introduction)**
>
> \<!-- import imageUrl from '../../tmpimages/academyplaceholder.jpg';

And also this video on advanced RAG techniques:

[![](https://canada1.discourse-cdn.com/flex027/uploads/weaviate/original/2X/3/35f9f0a666f2e6cb1642ffc4f161aa17de68bb37.jpeg "Learn Advanced RAG Tricks with Zain 💚") ](https://www.youtube.com/watch?v=RlghyhIPXJY)

Thanks!

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [August 19, 2024, 1:01pm UTC](https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375/8 "2024-08-19T13:01:34Z")

</div>

By the way we an upcoming webinar on this topic:

# Chunking

**Live workshop**  
Wednesday, August 28th  
9am PDT, 12pm EDT, 6pm CEST

> **[Online Workshops & Events | Weaviate](https://weaviate.io/community/events)**
>
> \-Join us at conferences, meetups, webinars or workshops

---

<div class="post-metadata">

**Author:** ![SomebodySysop](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/somebodysysop/32/70_2.png) [@SomebodySysop](https://forum.weaviate.io/u/SomebodySysop)\
**Post date:** [August 23, 2024, 8:34am UTC](https://forum.weaviate.io/t/weaviate-openai-embedding-models/3375/9 "2024-08-23T08:34:01Z")

</div>

Since the subject is chunking, my two cents: [Using gpt-4 API to Semantically Chunk Documents - #166 by SomebodySysop - API - OpenAI Developer Forum](https://community.openai.com/t/using-gpt-4-api-to-semantically-chunk-documents/715689/166)
