Run Gemma 4 locally with Ollama, then give it a structured record of the agent run—not just the agent’s final reply. Include timestamped messages, tool calls and their observed results, errors, and produced or changed files. Ask the model to tie claims to event IDs, distinguish recorded facts from interpretation, and flag gaps. Its summary can describe only what the record contains; it cannot establish unlogged actions.
1. Set up Gemma 4 with Ollama
Google’s Ollama guide describes a basic local setup. Install Ollama for your operating system, then pull and check a Gemma 4 model:
As an Amazon Associate I earn from qualifying purchases.
ollama pull gemma4
ollama list
The Ollama registry lists tags including gemma4:e2b, gemma4:e4b, gemma4:12b, gemma4:26b, and gemma4:31b, as well as MLX variants. Tags and approximate storage requirements can change, so check the registry when choosing a model rather than assuming a tag or download size is permanent.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →Try a one-off summary
For an interactive session, start the model with:
ollama run gemma4
Paste a redacted run record followed by the prompt in the next section. For a local program, Ollama documents the generation endpoint at http://localhost:11434/api/generate; the registry also shows the chat endpoint at /api/chat. Send the trace as a prompt or as messages, then save the returned summary beside the original run ID so you can trace the report back to its source.
#1 Best Overall
2. Give the model evidence of what happened
An agent’s final natural-language answer is not necessarily a complete activity log. It may say that a task was completed without showing every tool call, returned value, error, retry, or file change. A summary based only on that answer can repeat its unsupported claims. Use the agent framework’s trace or event export when available, and include observed tool results—not merely the agent’s description of those results.
If your framework exports OpenTelemetry data, its GenAI example illustrates an invoke_agent parent span with child model-call and tool-execution spans. Such records can distinguish a request the agent sent from a result a tool returned, and may include model identifiers, token counts, finish reason, call duration, and structured prompt, response, or tool content. The exact fields depend on the instrumentation and what content capture is enabled.
Rank #2
A practical run-record format
This runtime-neutral JSON is a suggested format, not a required standard. Keep stable event IDs and timestamps where available; they let a reader audit specific statements in the summary.
{
"run_id": "stable session or trace identifier",
"goal": "the user's requested outcome",
"events": [
{
"event_id": "event reference",
"timestamp": "UTC timestamp if available",
"kind": "assistant_message | tool_call | tool_result | error | artifact",
"tool": "tool name, when applicable",
"input": "redacted input or short description",
"output": "observed result or short description",
"status": "success | error | unknown"
}
],
"final_artifacts": ["file names, links, or output identifiers"],
"known_gaps": ["events unavailable or content intentionally omitted"]
}
OpenTelemetry’s GenAI observability walkthrough demonstrates agent, model-call, and tool spans. Its GenAI semantic conventions describe conversation IDs for correlating work and note that content capture is opt-in; the conventions are evolving. Preserve the original trace as the audit record, not just this compact summary.
Rank #3
3. Ask for a sourced, chronological account
Paste a redacted trace after a prompt such as this. It is a practical prompt pattern based on the trace structure and Gemma’s documented text-generation interface, not a Google-published or performance-tested prompt.
Summarize this agent run for a person who did not watch it.
Use only the supplied run record. For each claim about an action or result,
include its event ID (and timestamp if available).
Report, in order:
1. The user's goal.
2. Actions the agent actually took and the tools it called.
3. What each tool returned, distinguishing request from observed result.
4. Files or other outputs changed or produced.
5. Errors, retries, unresolved work, and anything the record cannot establish.
Separate logged facts from interpretation. Do not claim success unless an event
or artifact supports it. If evidence is missing, say so.
RUN RECORD:
[paste a redacted JSON trace or export]
The key instruction is to use only recorded evidence. A tool call establishes that the agent requested an action; a corresponding result or artifact is stronger evidence of what happened. If the trace does not show a result, the report should say it is unknown rather than infer success.
Rank #4
4. Choose a model and handle long traces
Gemma 4 has multiple sizes and context limits. Google’s model card specifies 128K-token context for small models and 256K for medium models. Those are model specifications, not a promise that every runtime or device can process a trace of that size efficiently. Ollama and llama.cpp variants use quantized GGUF models to reduce compute requirements, with a possible quality tradeoff; quantized weights should not be treated as identical to unquantized weights.
Google’s Gemma 4 12B developer guide describes a local laptop setup targeting 16 GB of dedicated GPU VRAM or unified memory. That is a setup-specific reference, not a guarantee that every laptop with 16 GB will run a given model well. Consider the model’s memory needs, the trace length, the runtime available for your operating system, and the level of speed or quality you need. The published material cited here does not establish a comparative benchmark for summarizing agent runs across variants or runtimes.
Best Value
When the full trace is too large
- Remove repetitive, low-value events, but retain failures, tool results, and state changes.
- Split the remaining record into consecutive chunks. Keep event IDs and timestamps attached to each event.
- Summarize each chunk, preserving references to its underlying events.
- Ask for a final synthesis using the chunk summaries plus important original events, especially errors, tool results, and artifacts.
- Check the synthesis against the original events. Chunking is a way to manage input length, not a guarantee against omissions.
5. Protect sensitive data and verify the result
Local model inference does not prove that the whole agent workflow was offline. The agent may have used remote tools, and an application or trace collector may export data. OpenTelemetry’s walkthrough makes message and tool-content collection configurable, while its semantic-convention guidance says instrumentation should not capture content by default but should offer an opt-in. Check the settings of the model runtime, agent application, telemetry collector, and connected tools before making a privacy claim. Redact credentials, personal data, and sensitive tool outputs before sending a trace for summarization.
Quick Recap
- Check names, timestamps, tool requests, returned values, errors, retries, and file changes against the source events.
- Do not treat the model’s prose as the authoritative audit record; retain the original trace.
- If the log omits an action or outcome, keep it unknown in the report.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

