demo · v148

Fast vs Quality

Same input, two runs, two performance hints. Compare how the on-device summariser balances speed and depth.

performance hint

fast

duration: length:

performance hint

quality

duration: length:

the code

const fast = await Summarizer.create({ performance: "fast", type: "key-points" });
const quality = await Summarizer.create({ performance: "quality", type: "key-points" });

const t0 = performance.now();
const a = await fast.summarize(text);
const t1 = performance.now();
const b = await quality.summarize(text);
const t2 = performance.now();
console.log(t1 - t0, t2 - t1);

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗