This protocol is the official method for validating a custom 8k MLC/WebLLM model against a 4k baseline.
Scope:
- Model family:
Qwen2.5-1.5B-Instruct-q4f16_1-MLC - Runtime: WebLLM in browser (
bench.html) - Output: JSON export + generated markdown report
Record these fields in every report:
- Date/time (ISO)
- Browser + version
- OS + hardware
GPU,Vendor,Platformfrom WebLLM Bench device panel- WebLLM runtime URL
If any of these are missing, do not publish the run.
Goal: prove the 8k model accepts context beyond 4096 while the 4k baseline cannot.
- Use the Compare tab.
- Set:
Temp = 0Max Tok = 128
- Use a retrieval prompt whose tokenized length is >4096 and <8192.
- Recommended source file:
reports/ctx_gt4k_lt8k_retrieval_prompt.txt
- Recommended source file:
- Compare:
- Model A: custom 8k model
- Model B: baseline 4k model
Pass criteria:
- 8k model completes and returns the required keys/values.
- 4k model fails with context overflow (
prompt tokens exceed context window) or truncates context and fails retrieval.
Goal: confirm the 8k build is not materially slower at normal prompt sizes.
- Use the Bench tab with A/B compare.
- Set:
Prompt Tokens = 1024Max Output Tokens = 128Iterations = 10Temp = 0Force full max tokens = ON
- Compare:
- Model A: custom 8k model
- Model B: baseline 4k model
- Export JSON.
Pass criteria:
- Output token parity >=
0.95 - Absolute decode TPS delta <=
10% - No repeated runtime/init failures
Goal: verify no flaky init/runtime behavior.
- Run Gate 2 three times (fresh tab each run).
- Collect three exports.
- Use medians for public claims.
Pass criteria:
- All three runs complete.
- No model init errors.
- Median decode delta still within +/-10%.
Generate a strict markdown report from a compare export:
node scripts/generate_8k_validation_report.mjs --in /absolute/path/to/webllm-bench-<timestamp>.jsonDefault output:
reports/launch_8k_validation_YYYY-MM-DD.md
Use these terms exactly:
VRAM Metadata: value declared by model record (vram_required_MB)JS Heap: browser-observed JavaScript heap (performance.memory, when available)GPU VRAM Live Usage: not available from standard WebGPU browser APIs
Do not publish language that implies exact live GPU VRAM tracking from browser WebGPU.
Use only if all gates pass:
[TESTED]Custom 8k model loads and runs in WebLLM Bench.[TESTED]It handles >4k prompts where baseline 4k does not.[TESTED]At <=4k prompt workloads, decode speed is within parity threshold vs baseline.[LIMITATION]Browser WebGPU does not expose exact live GPU VRAM usage counters.