feat: add av bench — cost/accuracy frontier harness and DeepSeek-V4.1-Flash provider - #1
Merged
Conversation
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.
Verdict: the harness is built and honest, but it has not been pointed at DeepSeek-V4.1-Flash — so this PR contains zero measured claims about that model.
Adds
av bench, a cost/accuracy frontier harness, plus a DeepSeek-V4.1-Flash provider. Headline axes are tokens per query and accuracy, with a third axis a per-token API vendor cannot report: dollars per query on hardware you own.What's here
src/av/bench/— cost models, deterministic ffmpeg fixtures, pinned frame extraction, receipts with labelled evidence, noise floor, dataset adapterssrc/av/cli/bench.py—probe,gate,plan,prepare,run,sweep,noise,costsrc/av/providers/deepseek.py— endpoint resolution from config/env, capability probe, and the vision token modelsamples/bench-receipts/— real receipts from the runs quoted belowTwo arms, not one
densesamples the whole window at a fixed rate and asks once.agentictakes a cheap coarse look, decides which moments it needs, fetches only those — and is charged for both requests. Same questions, same prompt, same scorer; the only difference is which frames the model got.Is tokens-per-frame tunable?
Yes, but not via
detail.detailis parsed by SGLang and no multimodal processor reads it back, so it is inert against a self-hosted server. The real lever is the resolution you upload, and the client owns it.av bench planpredicts the cost offline from the published preprocessor algorithm — it reproduces every published worked example below the token ceiling — and shows two walls worth knowing: an upscale floor below which shrinking frames buys nothing, and a ceiling above which extra resolution is discarded.Measured against the endpoint that was actually available (Gemini 2.5 Flash, OpenAI-compat), the verdict came back fixed: 258 tokens/frame across every
detailsetting and every width from 256 to 1536. That is a capability result, recorded as such rather than faked.The gate
Runs first, costs cents, and can save the whole exercise: a model that cannot order eight flat colours is not being measured on temporal understanding. Scores exact order and, crucially,
correct_prefix— which is what distinguishes "wrong order" from "reported only the first frame".Real frontier, on real footage
av bench sweepover the shipped CCTV sample, 8 windows per probe, zero unparseable replies:Door activity falls off a cliff between 1/2s and 1/5s. Person-entry holds 0.50 all the way out to 1/10s — a 9x cost reduction for that task at the same accuracy. That per-task difference is the whole point: there is no single safe sampling rate, and picking one globally either overpays or misses events.
Dollar figures use
--cost token:0.30:2.50as an illustrative rate, not a quote.Caveats, stated in the receipt and in the metric's name: the reference windows were produced by a vision model, not by humans, so this is
reference_recall— agreement with a dense reference run — never recall against ground truth. n is 8. Precision was not measured at all.Honesty machinery
measured/derived/documented/community-reported/untested; a non-measured claim without a source raises.$/hrand$/tokenare separate model classes and are never conflated.<private>.Not verified
av bench prepareis tested against both annotation formats.Test plan:
uv run pytest tests/ -v(143 pass),uv build, and each subcommand exercised end to end — the committed receipts are the output.