examples/google-aistudio-gemini/README.md
You can run this example with:
npx promptfoo@latest init --example google-aistudio-gemini
cd google-aistudio-gemini
This example demonstrates using Google's Gemini and Gemma models with promptfoo to evaluate math puzzle-solving capabilities.
npm install -g promptfoo or brew install promptfoo)GOOGLE_API_KEYThe example tests across multiple Gemini and Gemma models:
Gemini 3.7 Flash, 3.6 Flash, and 3.5 Flash-Lite use thinkingLevel instead of
deprecated temperature, topP, or topK controls. Gemini 3.7 Flash does not
support MINIMAL thinking.
This example also demonstrates how to load system instructions from an external file using the file:// prefix:
providers:
- id: google:gemini-2.5-pro
label: gemini-with-system-instruction-file
config:
systemInstruction: file://system-instruction.txt
The system-instruction.txt file contains reusable instructions that can be:
This example also includes an image understanding configuration (promptfooconfig.image.yaml) that demonstrates:
file:// prefixImages should be placed on separate lines in the prompt. The file:// prefix automatically handles loading and encoding the images for the Gemini API.
promptfoo init --example google-aistudio-gemini
# Basic math puzzle evaluation across multiple Gemini and Gemma models
promptfoo eval
# Image understanding and comparison evaluation
promptfoo eval -c promptfooconfig.image.yaml
promptfoo view