Skip to content

Instantly share code, notes, and snippets.

@gnomefin
Created April 25, 2026 15:11
Show Gist options
  • Select an option

  • Save gnomefin/07aab23e02a9c20b64c7324867daf0e3 to your computer and use it in GitHub Desktop.

Select an option

Save gnomefin/07aab23e02a9c20b64c7324867daf0e3 to your computer and use it in GitHub Desktop.
ClauseTokenizer vs blingfire — live-pod TTFB simulation for levers-agent PR #138
========================================================================
TURN: طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم من اليوم، بس لازم تلتزم بالسداد خلال هالمده. مناسبك هذا الحل؟
LLM pacing: 30.0 tokens/sec, ~3.5 chars/token
=> 9.5 ms/char (102 chars total)
========================================================================
--- blingfire (current default) ---
first chunk gate: 0.911s (LLM-first-token to first-flush)
total chunks: 2
[ 0] t= 0.911s 'طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم من اليوم، بس لازم تلتزم بالسداد خلال هالمده.'
[ 1] t= 1.104s ' مناسبك هذا الحل؟'
--- ClauseTokenizer (this PR, min_clause_len=10) ---
first chunk gate: 0.548s (LLM-first-token to first-flush)
total chunks: 3
[ 0] t= 0.548s 'طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم من اليوم،'
[ 1] t= 0.918s 'بس لازم تلتزم بالسداد خلال هالمده.'
[ 2] t= 1.076s 'مناسبك هذا الحل؟'
========================================================================
TTS prefill latency (live pod, 3 trials each)
========================================================================
[blingfire-1st-chunk] trial 1: 1.111s (input: 'طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم...')
[blingfire-1st-chunk] trial 2: 1.410s (input: 'طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم...')
[blingfire-1st-chunk] trial 3: 1.120s (input: 'طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم...')
[clause-1st-chunk] trial 1: 1.098s (input: 'طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم...')
[clause-1st-chunk] trial 2: 1.048s (input: 'طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم...')
[clause-1st-chunk] trial 3: 1.039s (input: 'طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم...')
========================================================================
End-to-end TTFB (gate + TTS prefill)
========================================================================
blingfire (current): gate 0.911s + tts 1.120s = 2.030s
ClauseTokenizer (this PR): gate 0.548s + tts 1.048s = 1.596s
Improvement: -0.434s (21% TTFB reduction)
First-chunk text length:
blingfire: 85 chars 'طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم من اليوم، بس لازم تلتزم بالسداد خلال هالمده.'
ClauseTokenizer: 50 chars 'طيب، نقدر نرتب على سداد كامل خلال ٤٥ يوم من اليوم،'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment