Spaces:
Running
Running
File size: 688 Bytes
96d0b8e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | """Tests for local token/cache mode benchmark harness."""
from benchmarks.proxy_mode_benchmark import run_local_benchmark
def test_local_mode_benchmark_shows_compression_and_cache_tradeoff() -> None:
results = run_local_benchmark(turns=6)
baseline = results["baseline"]
token = results["token"]
cache = results["cache"]
assert token.total_tokens_saved > 0
assert cache.total_tokens_saved > 0
assert token.total_sent_tokens < baseline.total_sent_tokens
assert cache.total_sent_tokens < baseline.total_sent_tokens
# Cache mode should preserve prefix better than token mode.
assert cache.total_cache_read_tokens >= token.total_cache_read_tokens
|