OpenAI

To utilize OpenAI’s powerful models with PapertLab, you need to provide your OpenAI API key. You can do this in two ways: by setting the OPENAI_API_KEY environment variable or by adding the key directly through the API section of the settings page in PapertLab. Additionally, you can specify the API key via the --openai-api-key command line option.

Adding API Keys via PapertLab Settings

You can also connect PapertLab to OpenAI by adding your API key directly through the PapertLab settings page:

  1. Navigate to the Settings Page: Open PapertLab and go to the settings page.

  2. Locate the API Section: In the API section, enter your OpenAI API key in the designated field.

  3. Save Your Changes: Click "Save" to apply the settings. PapertLab will now be connected to OpenAI using the provided API key.

This method is particularly useful if you prefer managing your keys through the user interface rather than using environment variables or command line options.

PapertLab is optimized to work seamlessly with the most popular OpenAI models, and it has been thoroughly tested and benchmarked to ensure smooth performance:

  1. Installation: First, ensure that PapertLab is installed on your system.

    python -m pip install papert-lab
  2. Set the OpenAI API Key:

    • Mac/Linux:

      export OPENAI_API_KEY=<your-api-key>
    • Windows:

      setx OPENAI_API_KEY <your-api-key>

      (Note: After running setx, restart your shell for the changes to take effect.)

  3. Using PapertLab with OpenAI Models:

    • Default Model: By default, PapertLab uses the GPT-4o model, which offers advanced capabilities for code editing.

      papertlab
    • GPT-4 Turbo (1106): If you prefer to use a specific version of GPT-4 Turbo, you can do so by specifying the model.

      papertlab --4-turbo
    • GPT-3.5 Turbo: You can switch to using GPT-3.5 Turbo if needed.

      papertlab --35-turbo
  4. Listing Available Models: To see all the models available from OpenAI that PapertLab can connect with, use the following command:

    papertlab --models openai/
  5. Using Other OpenAI Models: If you want to use a specific OpenAI model, simply pass the model name to the --model option. For example, to use a specific preview version of GPT-4 Turbo, you can run:

    papertlab --model gpt-4-0125-preview

Last updated