Google Gemini
Ingest Gemini traces into AITracer via the SDK or API.
Agent Lab: Run local Ollama agents in the dashboard — no SDK required (Quick Start). This guide is for ingesting traces from this provider via the SDK or API.
Use the SDK or API to store Google Gemini runs in AITracer alongside Agent Lab traces.
Each ingested record typically includes:
- prompt and response text
- model id (e.g.
gemini-2.0-flash) - token counts from
usageMetadata - latency and finish reason
Gemini integration workflow
Connecting Gemini (coach / cloud execution)
To run Gemini from the dashboard (e.g. coach mode):
- Go to Settings → Provider Connections
- Select Google Gemini
- Enter your API key from Google AI Studio
Supported models include gemini-2.0-flash, gemini-2.0-pro, and other models exposed by the Gemini API.
For production ingest, you only need an API key on the server and SDK calls from your app — no dashboard connection required.
What is captured
| Field | Source |
|---|---|
| Prompt | Input text and system instructions |
| Response | Generated output |
| Tokens | promptTokenCount, candidatesTokenCount, totalTokenCount |
| Latency | Measured client-side or server-side |
| Finish reason | STOP, MAX_TOKENS, SAFETY, etc. |
Cost tracking
When token counts are present, AITracer estimates spend using model price tables. View rollups under Cost Intelligence (optional; not required for Agent Lab).
Optional advanced
Compliance scanning, integrity hashing, and audit export are documented under Governance Engine, Verification Layer, and Audit Vault.