You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**7. Semantic Response Cache** — Cache responses for similar image+prompt pairs using perceptual image hashing. Repeated or similar queries cost 0 tokens. Effective on repetitive workloads (product classification, document processing).
51
51
52
+
**8. QJL-Compressed Fuzzy Cache** — Similar (not just identical) images hit the cache using Quantized Johnson-Lindenstrauss random projection. Compresses 256-bit perceptual hashes to 128-bit binary signatures, matches via Hamming distance. Inspired by Google's TurboQuant (arXiv 2504.19874). **62% additional token savings** on image variations in benchmarks — similar product photos, re-scanned documents, and slightly different angles all hit cache.
53
+
54
+
**9. Video Optimization** — Automatically extract keyframes from video at 1fps, deduplicate similar consecutive frames using QJL perceptual hashing, detect scene changes via pixel-level diff, and run each keyframe through the full image optimization pipeline. A 60-second video at 30fps (1,800 frames) reduces to ~10 keyframes before being sent to the LLM. **13-45% savings on local models; ~83% projected savings on GPT-4o.** Optional CLIP-based query-frame scoring (Layer 2) ranks frames by relevance to the user's prompt.
55
+
52
56
---
53
57
54
58
## Benchmarks
55
59
56
-
We benchmarked Token0 against **4 vision models** on **5 real-world images** (not synthetic — actual photos, receipts, documents, and screenshots), plus cost projections using OpenAI and Anthropic's published token formulas.
60
+
We benchmarked Token0 against **7 vision models** on **5 real-world images** (not synthetic — actual photos, receipts, documents, and screenshots) and **3 test videos**, plus cost projections using OpenAI and Anthropic's published token formulas.
57
61
58
62
### Real-World Image Test Suite
59
63
@@ -111,16 +115,55 @@ We benchmarked Token0 against **4 vision models** on **5 real-world images** (no
> The 0% savings on llama3.2-vision is expected and correct. This model uses ~8-27 tokens per image natively — far below what OCR text extraction would cost. Token0 detects this and correctly skips all lossy optimizations.
131
+
132
+
### Video Benchmark Results
133
+
134
+
Test setup: 3 videos (product showcase, document montage, mixed content), naive baseline = all frames at 1fps sent raw, Token0 = frame dedup + scene detection + per-frame image optimization.
| Model | Params | Total Direct | Total Token0 | Savings |
117
-
|---|---|---|---|---|
118
-
| minicpm-v | 8B | 10,877 | 6,276 |**42.3%**|
119
-
| moondream | 1.7B | 16,457 | 10,240 |**37.8%**|
120
-
| llava-llama3 | 8B | 13,365 | 8,486 |**36.5%**|
121
-
| llava:7b | 7B | 13,384 | 8,701 |**35.0%**|
144
+
**Why moondream shows less video savings:** moondream uses a very small frame encoder — its per-frame token cost is already low, so frame dedup has less absolute impact than on higher-token models.
145
+
146
+
### GPT-4o Video Extrapolation (ballpark)
147
+
148
+
Using OpenAI's published tile formula (512px tiles, 170 tokens/tile):
> These are linear extrapolations from the token formula + observed dedup ratios (60 frames → ~10 keyframes). Actual savings vary by content type — talking-head video deduplicates more aggressively than action scenes.
165
+
166
+
### GPT-4o Image Cost Projections (v1 vs v2)
124
167
125
168
Using OpenAI's published token formulas on real images:
126
169
@@ -150,11 +193,13 @@ Using OpenAI's published token formulas on real images:
150
193
5.**Prompt-aware detail mode** drops simple queries from 1,105 → 85 tokens (92% savings) on GPT-4o.
151
194
6.**Model cascade** routes simple tasks at 16.7x cheaper rates with equivalent quality.
152
195
7.**Tile-optimized resize** cuts OpenAI costs by 44% on mid-size images (1280x720) with zero quality loss.
153
-
8.**On cloud APIs, total savings reach 98.9%** when all optimizations are combined with model cascading.
196
+
8.**On cloud APIs, total image savings reach 98.9%** when all optimizations are combined with model cascading.
197
+
9.**Video deduplication collapses 60-frame clips to ~10 keyframes** — 13-45% savings on local models, ~83% projected on GPT-4o.
198
+
10.**Model-aware OCR skip is critical** — ultra-efficient encoders like llama3.2-vision use <50 tokens/image; OCR text output would cost more, not less.
154
199
155
200
### Additional Test Coverage
156
201
157
-
Token0 includes **103 unit tests** and benchmarks across multiple suites:
202
+
Token0 includes **148 unit tests** and benchmarks across multiple suites:
158
203
159
204
| Suite | Tests | What It Validates |
160
205
|---|---|---|
@@ -166,6 +211,8 @@ Token0 includes **103 unit tests** and benchmarks across multiple suites:
0 commit comments