Add Live API Race tab with January 2026 results
Browse files
app.py
CHANGED
|
@@ -29,6 +29,29 @@ SPEED_DATA = {
|
|
| 29 |
},
|
| 30 |
}
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
QUALITY_DATA = {
|
| 33 |
"Visual Narrator 3B": {"adj_density": 2.0, "semantic_accuracy": 71.6},
|
| 34 |
"Claude Sonnet 4.5": {"adj_density": 2.0, "semantic_accuracy": 64.2},
|
|
@@ -171,6 +194,46 @@ def create_sample_output():
|
|
| 171 |
- Suitable for audio description / accessibility
|
| 172 |
"""
|
| 173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 174 |
# =============================================================================
|
| 175 |
# GRADIO INTERFACE
|
| 176 |
# =============================================================================
|
|
@@ -203,6 +266,9 @@ with gr.Blocks(
|
|
| 203 |
""")
|
| 204 |
|
| 205 |
with gr.Tabs():
|
|
|
|
|
|
|
|
|
|
| 206 |
with gr.Tab("Speed Benchmark"):
|
| 207 |
gr.Markdown(create_speed_comparison())
|
| 208 |
|
|
|
|
| 29 |
},
|
| 30 |
}
|
| 31 |
|
| 32 |
+
# =============================================================================
|
| 33 |
+
# LIVE API RACE DATA (January 2026 - Real API calls, not simulated)
|
| 34 |
+
# =============================================================================
|
| 35 |
+
|
| 36 |
+
LIVE_API_DATA = {
|
| 37 |
+
"Visual Narrator": {
|
| 38 |
+
"latency_ms": 429,
|
| 39 |
+
"relative": 1.0,
|
| 40 |
+
},
|
| 41 |
+
"Claude Sonnet 4": {
|
| 42 |
+
"latency_ms": 4559,
|
| 43 |
+
"relative": 10.6,
|
| 44 |
+
},
|
| 45 |
+
"Gemini 2.0 Flash": {
|
| 46 |
+
"latency_ms": 8048,
|
| 47 |
+
"relative": 18.8,
|
| 48 |
+
},
|
| 49 |
+
"GPT-4o": {
|
| 50 |
+
"latency_ms": 11873,
|
| 51 |
+
"relative": 27.7,
|
| 52 |
+
},
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
QUALITY_DATA = {
|
| 56 |
"Visual Narrator 3B": {"adj_density": 2.0, "semantic_accuracy": 71.6},
|
| 57 |
"Claude Sonnet 4.5": {"adj_density": 2.0, "semantic_accuracy": 64.2},
|
|
|
|
| 194 |
- Suitable for audio description / accessibility
|
| 195 |
"""
|
| 196 |
|
| 197 |
+
def create_live_api_race():
|
| 198 |
+
"""Generate live API race results."""
|
| 199 |
+
vn = LIVE_API_DATA["Visual Narrator"]
|
| 200 |
+
claude = LIVE_API_DATA["Claude Sonnet 4"]
|
| 201 |
+
gemini = LIVE_API_DATA["Gemini 2.0 Flash"]
|
| 202 |
+
gpt4 = LIVE_API_DATA["GPT-4o"]
|
| 203 |
+
|
| 204 |
+
return f"""
|
| 205 |
+
## Live API Race Results (January 2026)
|
| 206 |
+
|
| 207 |
+
**What's measured:** Real API calls to OpenAI, Anthropic, and Google—executed in parallel at the exact same millisecond. No simulation.
|
| 208 |
+
|
| 209 |
+
| Model | Live Latency | vs Visual Narrator |
|
| 210 |
+
|-------|-------------|-------------------|
|
| 211 |
+
| **Visual Narrator** | **{vn['latency_ms']}ms** | — |
|
| 212 |
+
| Claude Sonnet 4 | {claude['latency_ms']:,}ms | {claude['relative']}x slower |
|
| 213 |
+
| Gemini 2.0 Flash | {gemini['latency_ms']:,}ms | {gemini['relative']}x slower |
|
| 214 |
+
| GPT-4o | {gpt4['latency_ms']:,}ms | {gpt4['relative']}x slower |
|
| 215 |
+
|
| 216 |
+
### Why This Matters
|
| 217 |
+
|
| 218 |
+
The **1-second threshold** is critical for real-time accessibility. Delays over 1 second break the connection between narration and on-screen action.
|
| 219 |
+
|
| 220 |
+
- **Visual Narrator at 429ms:** Well under the threshold. Enables true real-time narration.
|
| 221 |
+
- **Frontier models at 4-12 seconds:** Fundamentally incompatible with live video.
|
| 222 |
+
|
| 223 |
+
### Verification
|
| 224 |
+
|
| 225 |
+
These results come from a live WebSocket demo that makes actual API calls:
|
| 226 |
+
- All 4 models receive the same input at the same moment
|
| 227 |
+
- Latency is measured from request to response
|
| 228 |
+
- No artificial delays or handicapping
|
| 229 |
+
- Reproducible by anyone with API access
|
| 230 |
+
|
| 231 |
+
### Try It Yourself
|
| 232 |
+
|
| 233 |
+
The live demo WebSocket endpoint is available for verification:
|
| 234 |
+
`wss://egqm8ecka4.execute-api.us-east-1.amazonaws.com/prod`
|
| 235 |
+
"""
|
| 236 |
+
|
| 237 |
# =============================================================================
|
| 238 |
# GRADIO INTERFACE
|
| 239 |
# =============================================================================
|
|
|
|
| 266 |
""")
|
| 267 |
|
| 268 |
with gr.Tabs():
|
| 269 |
+
with gr.Tab("Live API Race"):
|
| 270 |
+
gr.Markdown(create_live_api_race())
|
| 271 |
+
|
| 272 |
with gr.Tab("Speed Benchmark"):
|
| 273 |
gr.Markdown(create_speed_comparison())
|
| 274 |
|