pinecone-io / canopy

Retrieval Augmented Generation (RAG) framework and context engine powered by Pinecone
https://www.pinecone.io/
Apache License 2.0
976 stars 121 forks source link

I don't have OpenAI credits #257

Closed grpinto closed 9 months ago

grpinto commented 10 months ago

Is this a new bug?

Current Behavior

I try to start an index :

canopy new test

and this is the error that I get : I don't understand how is this going to change the initial variable definition, how should it be provided, I already provided anyscale api key and still cannot use the command :

canonopy new test

This is the error that I get :

(canopy-env) kingsize@Goncalos-MacBook-Pro-3 EdGenAI % canopy new test Canopy is going to create a new index named canopy--test with the following initialization parameters: {}

Do you want to continue? [y/N]: y Error: Failed to create a new index. Reason: Canopy has failed to infer vectors' dimensionality using the selected encoder: OpenAIRecordEncoder. You can provide the dimension manually, try using a different encoder, or fix the underlying error: Failed to enconde documents using OpenAIRecordEncoder. Error: Your OpenAI account seem to have reached the rate limit. Details: You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.

Expected Behavior

I should expect th enormal behaviour after that command

Steps To Reproduce

Does anybody know how to fix this issue, maybe using anyscale, I already created an account and it works fine with the examples they provide. Thay also provide embeddings.

Relevant log output

No response

Environment

- **OS**:
- **Language version**:
- **Canopy version**:

Additional Context

No response

igiloh-pinecone commented 10 months ago

Hi @grpinto, thank you for you feedback!!

By default, Canopy uses OpenAI API key for two separate purposes:

  1. When inserting documents, Canopy uses OpenAI's embeddings model to encode the text into vector embeddings.
  2. Canopy's /chat/completion API uses an underlying LLM like OpenAI's ChatGPT to provide a knowledgeable AI chatbot that uses your own documents for context.

For both purposes, other providers like Anyscale or Cohere can be used instead of the default OpenAI. These can be set by changing the record_encoder and llm parameters in Canopy's config file respectively.
Note that Canopy can not be used without a valid account to an embeddings model provider, hence the error you are getting.

More specifically, when you run canopy new, Canopy needs to know the dime of the embedding vectors. This is done by simply sending the word "hello" to the RecordEncoder you selected in your config, and measuring the dimension of the returned vector.
You could theoretically bypass this mechanism by providing an explicit dimension in the config file, under create_index_params: section - but without a valid embeddings model you won't be able to insert any documents.

grpinto commented 10 months ago

Hello,

I don't understand how to proceed. I am sorry to be bothering you, but could you please explain to me, if I want to use anyscale, what should be the commands that I must follow ? It is not clear to me from the readme file. Thank you for the attention.

igiloh-pinecone commented 10 months ago
  1. Set an account with Anyscale Endpoints
  2. Set an environment variable named ANYSCALE_API_KEY with the API key they gave you
  3. Download Canopy's example config file for using Anyscale
  4. Start the Canopy server with the command canopy start --config anyscale.yaml