Google Gemini¶
Gemini models through the Gemini API (Google AI Studio). Has a free tier that needs no card, and embeddings. Official docs: models · pricing · API keys.
Setup¶
- Sign in to Google AI Studio and create an API key. The free tier needs no billing; adding billing moves the project to paid limits and paid data terms.
- From the ai-learning folder:
uv pip install -e '.[hosted]', thencp .env.example .env(if you haven't) and set:LLM_MODEL=gemini/gemini-3.6-flash GEMINI_API_KEY=... # optional: EMBED_MODEL=gemini/gemini-embedding-001 - Check:
python -c "import door; print(door.describe())", thencd llm-api && python tools.py.
Models for the labs¶
| Use | LLM_MODEL |
Note |
|---|---|---|
| Start here | gemini/gemini-3.6-flash |
On the free tier; good at tools and JSON |
| Cheapest, fastest | gemini/gemini-3.5-flash-lite |
Fine for moderation and routing |
| Embeddings | gemini/gemini-embedding-001 |
Set as EMBED_MODEL; a new index is built |
Names checked November 2026; take current ones from the model list.
What's different¶
- Free tier data terms: Google may use free-tier prompts and answers to improve its products, and people may review them. Fine for the synthetic labs; never for real company data. Paid projects are under different terms.
- Free-tier limits are per project and model, shown at ai.dev/rate-limit: 5 requests a minute and 20 a day on gemini-3.6-flash in November 2026: less than two labs. Fine for embeddings; for chat on a free plan use Groq.
- Some Flash models reason by default, which shows up as more output tokens even with
think=False. - Structured output supports a subset of JSON Schema; LiteLLM converts the labs' Pydantic schemas.
Troubleshooting¶
| Symptom | Fix |
|---|---|
400 API key not valid |
Wrong or missing GEMINI_API_KEY |
429 RESOURCE_EXHAUSTED |
Free-tier limit: wait a minute, use --n 20, or add billing |
| Schema error on one lab | That schema uses a feature Gemini doesn't accept: try the lab on Ollama to compare |
Shared rules for data, keys, cost and evals: README.md.