Papert.in
  • Welcome to papertlab
  • Getting Started
    • Installation
      • Prerequisites
  • papertlab UI
    • Main Interface
    • File Management
    • Chat Interaction
    • File Editor
      • Inline AI Editor
    • Settings
      • Token & Usage Reporting Management
      • Auto Commit On/Off
    • Model Selection
    • Terminal Integration
  • Connecting to LLMs
    • OpenAI
    • Anthropic
    • Cohere
    • Gemini
    • Groq
    • Ollama
  • Aruguments
    • Main Options
    • Terminal Args
    • Git Settings
    • Other settings
  • Troubleshooting
    • File Editing Problems
    • large_repos
    • model_warnings
    • token_limits
Powered by GitBook
On this page
  1. Connecting to LLMs

Gemini

PreviousCohere NextGroq

Last updated 8 months ago

Google currently provides free API access to the Gemini 1.5 Pro model, one of the most powerful models available for free. This model offers code editing capabilities comparable to GPT-3.5, making it an excellent choice for use with PapertLab. To get started, you’ll need to obtain a Gemini API key.

Adding API Keys via PapertLab Settings

In addition to setting the API key via environment variables, you can also add your Gemini API key directly through PapertLab’s settings page for easier management:

  1. Open PapertLab and Go to Settings: Start PapertLab and navigate to the settings page.

  2. Locate the API Section: Find the section dedicated to API key management.

  3. Enter Your API Key: Input your Gemini API key in the provided field.

  4. Save Your Changes: After entering the key, save your settings. PapertLab will now use the Gemini models with the provided API key.

By following these steps, you can seamlessly integrate the Gemini 1.5 Pro model with PapertLab and take full advantage of its powerful code editing capabilities. Whether you prefer setting up via the command line or using the convenient settings page, PapertLab offers flexibility in how you connect and use Gemini’s AI models.

Steps to Use Gemini 1.5 Pro with PapertLab

  1. Install PapertLab: First, ensure that PapertLab is installed on your system. If it’s not, you can install it easily using pip:

    python -m pip install papert-lab
  2. Set Your Gemini API Key:

    • Mac/Linux:

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

      setx GEMINI_API_KEY <your-api-key>

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

  3. Using PapertLab with the Gemini 1.5 Pro Model:

    • To utilize the Gemini 1.5 Pro model, specify it when running PapertLab:

      papertlab --model gemini/gemini-1.5-pro-latest
  4. Listing Available Gemini Models: To explore other models offered by Gemini, list them with the following command:

    papertlab --models gemini/