Find answers from the community

Updated 2 years ago

OpenAI API

At a glance

The community member is using the GPTSimpleVectorIndex to index content, but the index.query is consuming a large number of tokens, making it costly to ask questions. The first comment suggests customizing the chunk size, which has reduced the token usage a bit. The second comment recommends trying the SentenceEmbeddingOptimizer during query-time as another optimization. There is no explicitly marked answer, but the community members are discussing ways to optimize the token usage for their queries.

Useful resources
Hello, quick qn, index.query is taking huge number of tokens, for each index.query call https://platform.openai.com/account/usage shows 4 requests with total of ~5000+ tokens, it is getting too costly to ask a question 😦 , I am using GPTSimpleVectorIndex to index the content. Any suggestions ?
j
D
4 comments
you can customize chunk size, by default it is pretty large:

index = GPTSimpleVectorIndex(..., chunk_size_limit=512)
Thank you, it has reduced a bit, can you please suggest any other optimizations you can think of ?
another optimization is to try using the SentenceEmbeddingOptimizer during query-time, see https://github.com/jerryjliu/llama_index/blob/main/examples/optimizer/OptimizerDemo.ipynb
Add a reply
Sign up and join the conversation on Discord