{ "question": "When an agent sends the same long system prompt on every turn, how much time-to-first-token on an M3 Max goes away if MLX reuses a saved prompt cache (in-memory copy, disk file, or mlx_lm.server's automatic cache), and is the saving smaller on a hybrid MoE model (Qwen3.6-35B-A3B 4-bit) than on a dense sliding-window model (Gemma 3 12B 4-bit)? Prefixes of 2k, 8k and 16k tokens.", "environment": { "machine": { "chip": "unavailable (FileNotFoundError)", "model": "unavailable (FileNotFoundError)", "memory_gb": null, "power_source": "Now drawing from 'AC Power'", "power_mode": [ "powermode 0" ], "metal_device": { "device_name": "Apple M3 Max", "max_recommended_working_set_size": 55662788608, "memory_size": 68719476736, "architecture": "applegpu_g15s", "max_buffer_length": 41747087360, "resource_limit": 499000 } }, "os": { "product": "27.0.1", "build": "26A434", "kernel": "27.0.0" }, "software": { "python": "3.13.5", "mlx": "0.31.2", "mlx-metal": "0.31.2", "mlx-lm": "0.31.3", "numpy": "2.4.2", "httpx": "0.28.1", "transformers": "5.12.1", "tokenizers": "0.22.2" }, "models": { "qwen36_35b_a3b": "mlx-community/Qwen3.6-35B-A3B-4bit", "gemma3_12b": "mlx-community/gemma-3-12b-it-4bit" } }, "runs": 1, "metrics": { "weights_gb.gemma3_12b": { "value": 7.1883, "unit": "GB", "samples": [ 7.1883 ], "note": "MLX active memory after loading weights" }, "model_load_s.gemma3_12b": { "value": 2.7673, "unit": "s", "samples": [ 2.7673 ], "note": "" }, "prefix_tokens.gemma3_12b.2048": { "value": 2005, "unit": "tokens", "samples": [ 2005 ], "note": "shared prefix length, model's own tokenizer + chat template" }, "suffix_tokens.gemma3_12b.2048": { "value": 27, "unit": "tokens", "samples": [ 27 ], "note": "median of n=1, min 27, max 27." }, "ttft_ms.gemma3_12b.2048.cold": { "value": 6543.5688, "unit": "ms", "samples": [ 6543.5688 ], "note": "median of n=1, min 6543.569, max 6543.569. full prompt, no cache" }, "peak_mem_gb.gemma3_12b.2048.cold": { "value": 11.4667, "unit": "GB", "samples": [ 11.4667 ], "note": "median of n=1, min 11.467, max 11.467. mx.get_peak_memory, absolute (includes weights and the in-memory prefix caches held by the harness)" }, "peak_mem_over_start_gb.gemma3_12b.2048.cold": { "value": 1.5269, "unit": "GB", "samples": [ 1.5269 ], "note": "median of n=1, min 1.527, max 1.527. peak minus active memory at run start" }, "ttft_ms.gemma3_12b.2048.mem": { "value": 420.7353, "unit": "ms", "samples": [ 420.7353 ], "note": "median of n=1, min 420.735, max 420.735. includes deepcopy of the prefilled cache" }, "peak_mem_gb.gemma3_12b.2048.mem": { "value": 10.5955, "unit": "GB", "samples": [ 10.5955 ], "note": "median of n=1, min 10.596, max 10.596. mx.get_peak_memory, absolute (includes weights and the in-memory prefix caches held by the harness)" }, "peak_mem_over_start_gb.gemma3_12b.2048.mem": { "value": 0.6558, "unit": "GB", "samples": [ 0.6558 ], "note": "median of n=1, min 0.656, max 0.656. peak minus active memory at run start" }, "suffix_ttft_ms.gemma3_12b.2048.mem": { "value": 420.2884, "unit": "ms", "samples": [ 420.2884 ], "note": "median of n=1, min 420.288, max 420.288. suffix prefill to first token only, excluding copy/load" }, "prefill_tps.gemma3_12b.2048.cold": { "value": 310.5339, "unit": "tokens/s", "samples": [ 310.5339 ], "note": "median of n=1, min 310.534, max 310.534. full prompt tokens / cold TTFT" }, "copy_ms.gemma3_12b.2048": { "value": 0.4469, "unit": "ms", "samples": [ 0.4469 ], "note": "median of n=1, min 0.447, max 0.447. copy.deepcopy + mx.eval" }, "speedup_x.gemma3_12b.2048.mem": { "value": 15.5527, "unit": "x", "samples": [ 15.5527 ], "note": "median cold TTFT / median path TTFT" }, "ttft_saved_pct.gemma3_12b.2048.mem": { "value": 93.5702, "unit": "%", "samples": [ 93.5702 ], "note": "" }, "build_cache_s.gemma3_12b.2048": { "value": 5.4146, "unit": "s", "samples": [ 5.4146 ], "note": "one-time prefill of the prefix into make_prompt_cache (n=1)" }, "build_cache_tps.gemma3_12b.2048": { "value": 370.2951, "unit": "tokens/s", "samples": [ 370.2951 ], "note": "" }, "save_cache_s.gemma3_12b.2048": { "value": 0.2003, "unit": "s", "samples": [ 0.2003 ], "note": "save_prompt_cache" }, "cache_file_gb.gemma3_12b.2048": { "value": 0.467, "unit": "GB", "samples": [ 0.467 ], "note": "safetensors file size" }, "cache_mem_gb.gemma3_12b.2048": { "value": 0.4698, "unit": "GB", "samples": [ 0.4698 ], "note": "sum of cache .nbytes in memory" }, "cache_trimmable.gemma3_12b.2048": { "value": 0.0, "unit": "bool", "samples": [ 0.0 ], "note": "can_trim_prompt_cache; classes: KVCache,RotatingKVCache" }, "greedy64_match_pct.gemma3_12b.2048.mem": { "value": 0.0, "unit": "%", "samples": [ 0.0 ], "note": "1 sequences of up to 64 greedy tokens vs cold run" }, "greedy64_first_divergence.gemma3_12b.2048.mem": { "value": 52, "unit": "token index", "samples": [ 52 ], "note": "median of n=1, min 52, max 52. only sequences that diverged" }, "first_token_match_pct.gemma3_12b.2048.mem": { "value": 100.0, "unit": "%", "samples": [ 100.0 ], "note": "all 1 runs incl. 1-token repeats" }, "server_ttft_ms.gemma3_12b.2048.request1": { "value": 7442.4256, "unit": "ms", "samples": [ 7442.4256 ], "note": "median of n=1, min 7442.426, max 7442.426. client-side, streaming, first request with this system prompt (n=1)" }, "server_ttft_ms.gemma3_12b.2048.requests2_10": { "value": 431.3421, "unit": "ms", "samples": [ 408.2498, 435.9168, 440.3678, 412.52, 427.4653, 431.3421, 425.5481, 492.8011, 514.7734 ], "note": "median of n=9, min 408.25, max 514.773. client-side, streaming" }, "server_speedup_x.gemma3_12b.2048": { "value": 17.2541, "unit": "x", "samples": [ 17.2541 ], "note": "request 1 / median of requests 2-10" }, "server_speedup_vs_inprocess_cold_x.gemma3_12b.2048": { "value": 15.1703, "unit": "x", "samples": [ 15.1703 ], "note": "" }, "server_cached_tokens.gemma3_12b.2048.request1": { "value": 4, "unit": "tokens", "samples": [ 4 ], "note": "median of n=1, min 4, max 4. usage.prompt_tokens_details.cached_tokens" }, "server_cached_tokens.gemma3_12b.2048.requests2_10": { "value": 2005, "unit": "tokens", "samples": [ 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2005 ], "note": "median of n=9, min 2005, max 2005." }, "server_prompt_tokens.gemma3_12b.2048": { "value": 2030.0, "unit": "tokens", "samples": [ 2032, 2028, 2027, 2033, 2028, 2032, 2030, 2029, 2033, 2030 ], "note": "median of n=10, min 2027, max 2033." }, "server_text_match_pct.gemma3_12b.2048": { "value": 0.0, "unit": "%", "samples": [ 0.0 ], "note": "1 server responses vs in-process cold greedy text (64 tokens)" }, "server_ttft_ms.gemma3_12b.8192.request1": { "value": 31498.1078, "unit": "ms", "samples": [ 31498.1078 ], "note": "median of n=1, min 31498.108, max 31498.108. client-side, streaming, first request with this system prompt (n=1)" }, "server_ttft_ms.gemma3_12b.8192.requests2_10": { "value": 524.1498, "unit": "ms", "samples": [ 541.1678, 455.718, 465.0539, 544.1191, 563.2899, 454.1048, 438.1053, 524.1498, 830.1832 ], "note": "median of n=9, min 438.105, max 830.183. client-side, streaming" }, "server_speedup_x.gemma3_12b.8192": { "value": 60.0937, "unit": "x", "samples": [ 60.0937 ], "note": "request 1 / median of requests 2-10" }, "server_cached_tokens.gemma3_12b.8192.request1": { "value": 0, "unit": "tokens", "samples": [ 0 ], "note": "median of n=1, min 0, max 0. usage.prompt_tokens_details.cached_tokens" }, "server_cached_tokens.gemma3_12b.8192.requests2_10": { "value": 8129, "unit": "tokens", "samples": [ 8129, 8129, 8129, 8129, 8129, 8129, 8129, 8129, 8129 ], "note": "median of n=9, min 8129, max 8129." }, "server_prompt_tokens.gemma3_12b.8192": { "value": 8154.0, "unit": "tokens", "samples": [ 8156, 8152, 8151, 8157, 8152, 8156, 8154, 8153, 8157, 8154 ], "note": "median of n=10, min 8151, max 8157." }, "server_ttft_ms.gemma3_12b.16384.request1": { "value": 61523.7743, "unit": "ms", "samples": [ 61523.7743 ], "note": "median of n=1, min 61523.774, max 61523.774. client-side, streaming, first request with this system prompt (n=1)" }, "server_ttft_ms.gemma3_12b.16384.requests2_10": { "value": 533.4615, "unit": "ms", "samples": [ 600.8669, 533.4615, 580.7817, 432.0731, 643.9953, 867.9979, 484.308, 452.9276, 437.5136 ], "note": "median of n=9, min 432.073, max 867.998. client-side, streaming" }, "server_speedup_x.gemma3_12b.16384": { "value": 115.3294, "unit": "x", "samples": [ 115.3294 ], "note": "request 1 / median of requests 2-10" }, "server_cached_tokens.gemma3_12b.16384.request1": { "value": 0, "unit": "tokens", "samples": [ 0 ], "note": "median of n=1, min 0, max 0. usage.prompt_tokens_details.cached_tokens" }, "server_cached_tokens.gemma3_12b.16384.requests2_10": { "value": 16290, "unit": "tokens", "samples": [ 16290, 16290, 16290, 16290, 16290, 16290, 16290, 16290, 16290 ], "note": "median of n=9, min 16290, max 16290." }, "server_prompt_tokens.gemma3_12b.16384": { "value": 16315.0, "unit": "tokens", "samples": [ 16317, 16313, 16312, 16318, 16313, 16317, 16315, 16314, 16318, 16315 ], "note": "median of n=10, min 16312, max 16318." }, "weights_gb.qwen36_35b_a3b": { "value": 19.5088, "unit": "GB", "samples": [ 19.5088 ], "note": "MLX active memory after loading weights" }, "model_load_s.qwen36_35b_a3b": { "value": 6.5813, "unit": "s", "samples": [ 6.5813 ], "note": "" }, "prefix_tokens.qwen36_35b_a3b.2048": { "value": 1991, "unit": "tokens", "samples": [ 1991 ], "note": "shared prefix length, model's own tokenizer + chat template" }, "suffix_tokens.qwen36_35b_a3b.2048": { "value": 31, "unit": "tokens", "samples": [ 31 ], "note": "median of n=1, min 31, max 31." }, "ttft_ms.qwen36_35b_a3b.2048.cold": { "value": 1730.6055, "unit": "ms", "samples": [ 1730.6055 ], "note": "median of n=1, min 1730.605, max 1730.605. full prompt, no cache" }, "peak_mem_gb.qwen36_35b_a3b.2048.cold": { "value": 22.1651, "unit": "GB", "samples": [ 22.1651 ], "note": "median of n=1, min 22.165, max 22.165. mx.get_peak_memory, absolute (includes weights and the in-memory prefix caches held by the harness)" }, "peak_mem_over_start_gb.qwen36_35b_a3b.2048.cold": { "value": 1.9165, "unit": "GB", "samples": [ 1.9165 ], "note": "median of n=1, min 1.916, max 1.916. peak minus active memory at run start" }, "ttft_ms.qwen36_35b_a3b.2048.mem": { "value": 236.2208, "unit": "ms", "samples": [ 236.2208 ], "note": "median of n=1, min 236.221, max 236.221. includes deepcopy of the prefilled cache" }, "peak_mem_gb.qwen36_35b_a3b.2048.mem": { "value": 20.4451, "unit": "GB", "samples": [ 20.4451 ], "note": "median of n=1, min 20.445, max 20.445. mx.get_peak_memory, absolute (includes weights and the in-memory prefix caches held by the harness)" }, "peak_mem_over_start_gb.qwen36_35b_a3b.2048.mem": { "value": 0.1964, "unit": "GB", "samples": [ 0.1964 ], "note": "median of n=1, min 0.196, max 0.196. peak minus active memory at run start" }, "suffix_ttft_ms.qwen36_35b_a3b.2048.mem": { "value": 235.8634, "unit": "ms", "samples": [ 235.8634 ], "note": "median of n=1, min 235.863, max 235.863. suffix prefill to first token only, excluding copy/load" }, "prefill_tps.qwen36_35b_a3b.2048.cold": { "value": 1168.3772, "unit": "tokens/s", "samples": [ 1168.3772 ], "note": "median of n=1, min 1168.377, max 1168.377. full prompt tokens / cold TTFT" }, "copy_ms.qwen36_35b_a3b.2048": { "value": 0.3574, "unit": "ms", "samples": [ 0.3574 ], "note": "median of n=1, min 0.357, max 0.357. copy.deepcopy + mx.eval" }, "speedup_x.qwen36_35b_a3b.2048.mem": { "value": 7.3262, "unit": "x", "samples": [ 7.3262 ], "note": "median cold TTFT / median path TTFT" }, "ttft_saved_pct.qwen36_35b_a3b.2048.mem": { "value": 86.3504, "unit": "%", "samples": [ 86.3504 ], "note": "" }, "build_cache_s.qwen36_35b_a3b.2048": { "value": 1.7574, "unit": "s", "samples": [ 1.7574 ], "note": "one-time prefill of the prefix into make_prompt_cache (n=1)" }, "build_cache_tps.qwen36_35b_a3b.2048": { "value": 1132.8938, "unit": "tokens/s", "samples": [ 1132.8938 ], "note": "" }, "save_cache_s.qwen36_35b_a3b.2048": { "value": 0.0228, "unit": "s", "samples": [ 0.0228 ], "note": "save_prompt_cache" }, "cache_file_gb.qwen36_35b_a3b.2048": { "value": 0.1052, "unit": "GB", "samples": [ 0.1052 ], "note": "safetensors file size" }, "cache_mem_gb.qwen36_35b_a3b.2048": { "value": 0.1063, "unit": "GB", "samples": [ 0.1063 ], "note": "sum of cache .nbytes in memory" }, "cache_trimmable.qwen36_35b_a3b.2048": { "value": 0.0, "unit": "bool", "samples": [ 0.0 ], "note": "can_trim_prompt_cache; classes: ArraysCache,KVCache" }, "greedy64_match_pct.qwen36_35b_a3b.2048.mem": { "value": 0.0, "unit": "%", "samples": [ 0.0 ], "note": "1 sequences of up to 64 greedy tokens vs cold run" }, "greedy64_first_divergence.qwen36_35b_a3b.2048.mem": { "value": 13, "unit": "token index", "samples": [ 13 ], "note": "median of n=1, min 13, max 13. only sequences that diverged" }, "first_token_match_pct.qwen36_35b_a3b.2048.mem": { "value": 100.0, "unit": "%", "samples": [ 100.0 ], "note": "all 1 runs incl. 1-token repeats" }, "prefix_tokens.qwen36_35b_a3b.32768": { "value": 32685, "unit": "tokens", "samples": [ 32685 ], "note": "shared prefix length, model's own tokenizer + chat template" }, "suffix_tokens.qwen36_35b_a3b.32768": { "value": 31, "unit": "tokens", "samples": [ 31 ], "note": "median of n=1, min 31, max 31." }, "ttft_ms.qwen36_35b_a3b.32768.cold": { "value": 32723.7972, "unit": "ms", "samples": [ 32723.7972 ], "note": "median of n=1, min 32723.797, max 32723.797. full prompt, no cache" }, "peak_mem_gb.qwen36_35b_a3b.32768.cold": { "value": 24.634, "unit": "GB", "samples": [ 24.634 ], "note": "median of n=1, min 24.634, max 24.634. mx.get_peak_memory, absolute (includes weights and the in-memory prefix caches held by the harness)" }, "peak_mem_over_start_gb.qwen36_35b_a3b.32768.cold": { "value": 4.3892, "unit": "GB", "samples": [ 4.3892 ], "note": "median of n=1, min 4.389, max 4.389. peak minus active memory at run start" }, "ttft_ms.qwen36_35b_a3b.32768.mem": { "value": 322.9322, "unit": "ms", "samples": [ 322.9322 ], "note": "median of n=1, min 322.932, max 322.932. includes deepcopy of the prefilled cache" }, "peak_mem_gb.qwen36_35b_a3b.32768.mem": { "value": 21.0789, "unit": "GB", "samples": [ 21.0789 ], "note": "median of n=1, min 21.079, max 21.079. mx.get_peak_memory, absolute (includes weights and the in-memory prefix caches held by the harness)" }, "peak_mem_over_start_gb.qwen36_35b_a3b.32768.mem": { "value": 0.8341, "unit": "GB", "samples": [ 0.8341 ], "note": "median of n=1, min 0.834, max 0.834. peak minus active memory at run start" }, "suffix_ttft_ms.qwen36_35b_a3b.32768.mem": { "value": 322.4685, "unit": "ms", "samples": [ 322.4685 ], "note": "median of n=1, min 322.469, max 322.469. suffix prefill to first token only, excluding copy/load" }, "prefill_tps.qwen36_35b_a3b.32768.cold": { "value": 999.7617, "unit": "tokens/s", "samples": [ 999.7617 ], "note": "median of n=1, min 999.762, max 999.762. full prompt tokens / cold TTFT" }, "copy_ms.qwen36_35b_a3b.32768": { "value": 0.4637, "unit": "ms", "samples": [ 0.4637 ], "note": "median of n=1, min 0.464, max 0.464. copy.deepcopy + mx.eval" }, "speedup_x.qwen36_35b_a3b.32768.mem": { "value": 101.3333, "unit": "x", "samples": [ 101.3333 ], "note": "median cold TTFT / median path TTFT" }, "ttft_saved_pct.qwen36_35b_a3b.32768.mem": { "value": 99.0132, "unit": "%", "samples": [ 99.0132 ], "note": "" }, "build_cache_s.qwen36_35b_a3b.32768": { "value": 31.9686, "unit": "s", "samples": [ 31.9686 ], "note": "one-time prefill of the prefix into make_prompt_cache (n=1)" }, "build_cache_tps.qwen36_35b_a3b.32768": { "value": 1022.4102, "unit": "tokens/s", "samples": [ 1022.4102 ], "note": "" }, "save_cache_s.qwen36_35b_a3b.32768": { "value": 0.4163, "unit": "s", "samples": [ 0.4163 ], "note": "save_prompt_cache" }, "cache_file_gb.qwen36_35b_a3b.32768": { "value": 0.7338, "unit": "GB", "samples": [ 0.7338 ], "note": "safetensors file size" }, "cache_mem_gb.qwen36_35b_a3b.32768": { "value": 0.7355, "unit": "GB", "samples": [ 0.7355 ], "note": "sum of cache .nbytes in memory" }, "cache_trimmable.qwen36_35b_a3b.32768": { "value": 0.0, "unit": "bool", "samples": [ 0.0 ], "note": "can_trim_prompt_cache; classes: ArraysCache,KVCache" }, "greedy64_match_pct.qwen36_35b_a3b.32768.mem": { "value": 0.0, "unit": "%", "samples": [ 0.0 ], "note": "1 sequences of up to 64 greedy tokens vs cold run" }, "greedy64_first_divergence.qwen36_35b_a3b.32768.mem": { "value": 7, "unit": "token index", "samples": [ 7 ], "note": "median of n=1, min 7, max 7. only sequences that diverged" }, "first_token_match_pct.qwen36_35b_a3b.32768.mem": { "value": 100.0, "unit": "%", "samples": [ 100.0 ], "note": "all 1 runs incl. 1-token repeats" }, "server_ttft_ms.qwen36_35b_a3b.2048.request1": { "value": 1877.1713, "unit": "ms", "samples": [ 1877.1713 ], "note": "median of n=1, min 1877.171, max 1877.171. client-side, streaming, first request with this system prompt (n=1)" }, "server_ttft_ms.qwen36_35b_a3b.2048.requests2_10": { "value": 243.3897, "unit": "ms", "samples": [ 262.0754, 252.5232, 243.3897, 251.838, 286.2894, 225.2651, 233.4525, 210.3449, 209.0085 ], "note": "median of n=9, min 209.008, max 286.289. client-side, streaming" }, "server_speedup_x.qwen36_35b_a3b.2048": { "value": 7.7126, "unit": "x", "samples": [ 7.7126 ], "note": "request 1 / median of requests 2-10" }, "server_speedup_vs_inprocess_cold_x.qwen36_35b_a3b.2048": { "value": 7.1104, "unit": "x", "samples": [ 7.1104 ], "note": "" }, "server_cached_tokens.qwen36_35b_a3b.2048.request1": { "value": 0, "unit": "tokens", "samples": [ 0 ], "note": "median of n=1, min 0, max 0. usage.prompt_tokens_details.cached_tokens" }, "server_cached_tokens.qwen36_35b_a3b.2048.requests2_10": { "value": 1991, "unit": "tokens", "samples": [ 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991, 1991 ], "note": "median of n=9, min 1991, max 1991." }, "server_prompt_tokens.qwen36_35b_a3b.2048": { "value": 2020.0, "unit": "tokens", "samples": [ 2022, 2019, 2017, 2024, 2018, 2023, 2020, 2020, 2022, 2020 ], "note": "median of n=10, min 2017, max 2024." }, "server_text_match_pct.qwen36_35b_a3b.2048": { "value": 0.0, "unit": "%", "samples": [ 0.0 ], "note": "1 server responses vs in-process cold greedy text (64 tokens)" }, "server_ttft_ms.qwen36_35b_a3b.8192.request1": { "value": 6560.8087, "unit": "ms", "samples": [ 6560.8087 ], "note": "median of n=1, min 6560.809, max 6560.809. client-side, streaming, first request with this system prompt (n=1)" }, "server_ttft_ms.qwen36_35b_a3b.8192.requests2_10": { "value": 284.3405, "unit": "ms", "samples": [ 287.9336, 289.7189, 289.4129, 264.6038, 284.3405, 282.3106, 286.1093, 281.75, 273.2486 ], "note": "median of n=9, min 264.604, max 289.719. client-side, streaming" }, "server_speedup_x.qwen36_35b_a3b.8192": { "value": 23.0738, "unit": "x", "samples": [ 23.0738 ], "note": "request 1 / median of requests 2-10" }, "server_cached_tokens.qwen36_35b_a3b.8192.request1": { "value": 0, "unit": "tokens", "samples": [ 0 ], "note": "median of n=1, min 0, max 0. usage.prompt_tokens_details.cached_tokens" }, "server_cached_tokens.qwen36_35b_a3b.8192.requests2_10": { "value": 8109, "unit": "tokens", "samples": [ 8109, 8109, 8109, 8109, 8109, 8109, 8109, 8109, 8109 ], "note": "median of n=9, min 8109, max 8109." }, "server_prompt_tokens.qwen36_35b_a3b.8192": { "value": 8138.0, "unit": "tokens", "samples": [ 8140, 8137, 8135, 8142, 8136, 8141, 8138, 8138, 8140, 8138 ], "note": "median of n=10, min 8135, max 8142." }, "server_ttft_ms.qwen36_35b_a3b.16384.request1": { "value": 16885.2697, "unit": "ms", "samples": [ 16885.2697 ], "note": "median of n=1, min 16885.27, max 16885.27. client-side, streaming, first request with this system prompt (n=1)" }, "server_ttft_ms.qwen36_35b_a3b.16384.requests2_10": { "value": 334.828, "unit": "ms", "samples": [ 348.9038, 334.828, 341.3287, 333.2528, 341.9608, 343.7496, 328.9479, 334.6127, 331.1519 ], "note": "median of n=9, min 328.948, max 348.904. client-side, streaming" }, "server_speedup_x.qwen36_35b_a3b.16384": { "value": 50.4297, "unit": "x", "samples": [ 50.4297 ], "note": "request 1 / median of requests 2-10" }, "server_cached_tokens.qwen36_35b_a3b.16384.request1": { "value": 0, "unit": "tokens", "samples": [ 0 ], "note": "median of n=1, min 0, max 0. usage.prompt_tokens_details.cached_tokens" }, "server_cached_tokens.qwen36_35b_a3b.16384.requests2_10": { "value": 16371, "unit": "tokens", "samples": [ 16371, 16371, 16371, 16371, 16371, 16371, 16371, 16371, 16371 ], "note": "median of n=9, min 16371, max 16371." }, "server_prompt_tokens.qwen36_35b_a3b.16384": { "value": 16400.0, "unit": "tokens", "samples": [ 16402, 16399, 16397, 16404, 16398, 16403, 16400, 16400, 16402, 16400 ], "note": "median of n=10, min 16397, max 16404." } }, "observations": [ "gemma3_12b @ 2048-token target: cold TTFT 6544 ms; mem 421 ms (15.6x).", "qwen36_35b_a3b @ 2048-token target: cold TTFT 1731 ms; mem 236 ms (7.3x).", "qwen36_35b_a3b @ 32768-token target: cold TTFT 32724 ms; mem 323 ms (101.3x).", "server_cached_tokens.gemma3_12b.2048.requests2_10: median 2005 cached tokens reported by the server.", "server_cached_tokens.gemma3_12b.8192.requests2_10: median 8129 cached tokens reported by the server.", "server_cached_tokens.gemma3_12b.16384.requests2_10: median 16290 cached tokens reported by the server.", "server_cached_tokens.qwen36_35b_a3b.2048.requests2_10: median 1991 cached tokens reported by the server.", "server_cached_tokens.qwen36_35b_a3b.8192.requests2_10: median 8109 cached tokens reported by the server.", "server_cached_tokens.qwen36_35b_a3b.16384.requests2_10: median 16371 cached tokens reported by the server." ], "caveats": [ "gemma3_12b.2048 mem: 1/1 greedy sequences differ from cold (first divergence at token 52). Flagged, not hidden.", "qwen36_35b_a3b.2048 mem: 1/1 greedy sequences differ from cold (first divergence at token 13). Flagged, not hidden.", "qwen36_35b_a3b.32768 mem: 1/1 greedy sequences differ from cold (first divergence at token 7). Flagged, not hidden.", "Cold baseline: 5 runs per cell (one per question); cached paths: 5 questions x 5 repeats (disk split into 5 cold-file + 20 warm-file loads). Cold repeats were capped to fit the 40-minute budget.", "Cache build time is a single sample per cell; the cold TTFT samples measure the same prefill repeatedly.", "'Cold disk' uses a copy written with F_NOCACHE (no sudo purge); residency was checked with mincore().", "Absolute peak memory includes the harness's own in-memory prefix caches for all lengths; use the 'over_start' numbers for per-run cost.", "Server numbers are 'what you get by default' with mlx_lm.server's LRU prompt cache (one series of 10 requests per length), not a ceiling.", "The two models differ in size and architecture; compare how much caching helps each, not which is faster.", "Single machine, single session; thermal state and background load can shift absolute numbers." ] }