Google Gemini

~2 min read

Google Gemini

Google’s Gemini family. Particularly strong on grounded reasoning and long context.

Setting the key

Gemini is one of the backends for Lettuce’s LLM-powered features (enhance, the answer RAG tool, the semantic lint advisor). It does not provide embeddings — semantic_search and embedding-based retrieval require a separate OpenAI-compatible embeddings endpoint. Select Gemini and store its key either in the GUI under Settings → AI providers, or via environment variables for the CLI.

Get an AI Studio key (AIza...) from Google AI Studio, then either paste it into Settings → AI providers (it is stored in the macOS Keychain), or export it for the CLI:

export LETTUCE_LLM_PROVIDER=gemini
export GEMINI_API_KEY=AIza...      # or GOOGLE_API_KEY

Lettuce talks to the public Generative Language API (generativelanguage.googleapis.com) and sends the key in the x-goog-api-key header.

Models

The default model is gemini-2.0-flash. Override it in Settings → AI providers, or with an environment variable:

export LETTUCE_ENHANCE_MODEL=gemini-2.5-pro
Model Notes
gemini-2.0-flash default — fast, cheap
gemini-2.5-pro flagship, very long context
gemini-2.5-flash faster, cheaper

Structured output

Lettuce’s enhancement features ask the model for structured JSON. The GeminiClient maps each tool’s JSON Schema into Gemini’s responseSchema subset (uppercase type, no additionalProperties) and requests responseMimeType: application/json, so you get clean structured results back without any extra configuration.

Differences

Cost

Pay-per-token, billed via Google Cloud / AI Studio. Lettuce does not track or display Gemini usage; check your spend in the Google Cloud / AI Studio console.