Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
models: {
  "GPT-4 Turbo": {
    provider: "openai",
    model: "gpt-4-1106-preview",
    apiKey: "sk-....."
  },
  "GPT-3.5 Turbo": {
    provider: "openai",
    model: "gpt-3.5-turbo-1106",
    apiKey: "sk-....."
  },
  "Mistral 7B": {
    endpoint: "https://api.endpoints.anyscale.com/v1",
    apiFormat: "completion",
    model: "mistralai/Mistral-7B-Instruct-v0.1",
    apiKey: "esecret_......"
  },
  "Gemini Pro": {
    provider: "google",
    model: "gemini-pro",
    apiKey: "AI......"
  }
}

Model Properties

provider

When this property is specified (e.g. “openai” or “google”), the endpoint and apiFormat properties assume default values for each respective provider.

...

This property contains the API key or secret key associated with the respective model. These keys are used for authentication when making requests to the API.

OpenAI Models

To setup and an OpenAI model, you will need an API key. Follow these steps to create the key:

  1. Go the OpenAI website.

  2. Click Sign Up or Sign In in the top-right corner. You may need to provide payment details for API usage. See OpenAI pricing for details.

  3. Go the API keys section.

  4. Create a new secret key (you can provide an identifiable secret key name, such as “Profound AI Key”).

  5. Copy the secret key (it generally starts with “sk-”), and paste it into your config.js file assigning it to the “apiKey” property.

Google Models

To setup a model from Google, visit https://ai.google.dev/ and select Get API key.

Copy the API key into into your config.js file assigning it to the “apiKey” property.

Prior to using models from Google, you must install the following prerequesites:

  • Node.js v18+

  • GoogleGenerativeAI package - use command below to install

Code Block
npm install @google/generative-ai