Repository navigation
tools: bench_image_session plays one image chat session and records cached tokens and first-token time - #1889
Merged
Merged
Conversation
Every turn resends the same PNG, keeps the history and adds a question. Each line records the reply sha256, usage counters and first-token time; the last line summarizes the session. A loopback test checks the history, the image and the fields. Refs #1828
…d records cached tokens and first-token time
ashhart
force-pushed
the
lead/k5-image-session
branch
from
November 2, 2026 06:22
6762607 to
69c10bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A small client for one image chat session, for #1828's check and similar ones: does a server keep and resume an image turn's prompt across a session, and do the replies stay the same?
What it does
tools/bench_image_session.py --base-url URL --image PNGplays one chat of--turnsturns (10 by default) against an OpenAI-compatible/v1/chat/completions. Every turn resends the same picture in the first user message, keeps the whole history, and adds one short new question. For each turn it records:usage.prompt_tokens_details.cached_tokens, or null if not reported);--out FILEwrites one JSON line per turn, then a summary line. Arguments are checked withtools/bench_args.py. Defaults: temperature 0, 64 max tokens.Checks
tools/tests/test_bench_image_session.pyruns a stdlib loopback server with no GPU or network. It checks that the history grows, the image is sent every turn, and every field is recorded, and that bad arguments are refused. Both tests pass.No engine code changes.