Skip to main content

Gemini (Google AI Studio)

Gemini is Google's family of multimodal large language models, accessible through Google AI Studio. It can generate text, analyze documents, reason over complex inputs, and handle a wide range of tasks across text, code, and images.

Google AI Studio vs. Vertex AI

This adapter uses a Google AI Studio API key — the simplest way to use Gemini. If you need GCP-managed access with service account credentials, use the Google / VertexAI Gemini Pro adapter instead.

Getting started with Gemini

  1. Sign in to Google AI Studio using your Google account. Google AI Studio provides a free tier that's sufficient for evaluation — you can start without enabling billing.

  2. From the left side navigation, choose API keys.

  3. Click on Create API key in the top right corner.

    img Gemini API Key Creation

  4. Select or create a Google Cloud project for the key, then copy the generated API key and keep it safe.

Setting up the Gemini LLM model in Unstract

Now that we have an API key from Google AI Studio, we can use it to set up an LLM profile on the Unstract platform. For this:

  • Sign in to the Unstract Platform

  • From the side navigation menu, choose Settings 🞂 LLMs

  • Click on the New LLM Profile button.

  • From the list of LLMs, choose Gemini. You should see a dialog box where you enter details.

    img Gemini Adapter Selection

    img Gemini LLM Configuration

  • For Name, enter a unique name for this adapter instance. Example: gemini-group-1.

  • In the API Key field, paste the API key copied from Google AI Studio.

  • In the Model field, enter the Gemini model name. Supported models: gemini-2.0-flash, gemini-2.5-pro, gemini-2.5-flash, gemini-1.5-pro, gemini-1.5-flash. The gemini/ prefix will be added automatically if omitted. Refer to Gemini Models for the full list.

  • For Temperature, set a sampling temperature between 0 and 2. Default is 0.1.

  • For Maximum Output Tokens, set the maximum number of output tokens. Default is 8192. The maximum possible value differs from model to model.

  • Leave Timeout (in seconds) and Max Retries at their default values unless you have specific requirements.

  • Click on Test Connection and ensure it succeeds. You can finally click on Submit and that should create a new LLM Profile for use in your Unstract projects.