npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mpt-bench

v1.0.6

Published

MPT - Multi-channel LLM stress testing tool (RPM/TTFT/TPS/P95). Supports OpenAI-compatible APIs, SSE streaming, adaptive scheduling, and multi-model benchmarking.

Readme

MPT (Model Performance Test)

MPT 是一个面向 OpenAI 兼容 API 的 LLM 压测工具,支持:

  • 单模型压测(mpt run
  • 同渠道多模型横评(mpt benchmark
  • 数据集生成(mpt dataset gen
  • HTML 报告(响应/TTFT/TPS/成功率/分位数)

快速开始

npm install
npx mpt --help

若你在仓库内开发,也可以用:node bin/mpt.js --help

场景化专项测试(已实现)

1) 生成短请求数据集

npx mpt dataset gen --preset short -n 100 -o short.json

2) 生成长综述数据集(固定语料随机截断)

npx mpt dataset gen --preset long-summary --target-kb 256 -n 20 -o long-summary.json

可指定外部语料:

npx mpt dataset gen --preset long-summary --corpus ./my-corpus.txt --target-kb 128 -n 10 -o long-custom.json

3) 生成 NSFW 场景数据集(续写/扩写模拟)

约 100 条 的 story 语料池里随机取 短片段,再随机加「续写/扩写」类用户前缀(不加安全拒答类措辞),模拟用户让模型接着写。

语料池 随包内置:由母本 src/dataset/corpus/sources/user-paste-2026-06-15.txt 细拆得到 nsfw-stories-pool.jsonl(约 100 条)。用户无需下载,直接:

npx mpt dataset gen --preset nsfw -n 100 -o nsfw.json
npx mpt run --dataset nsfw.json --scenario nsfw

维护者:从 HF 抽样 node scripts/fetch-nsfw-pool.mjs 100;或粘贴长文后 node scripts/build-nsfw-pool-from-paste.mjs <paste.txt> 细拆并覆盖内置池。

4) 运行场景化压测

npx mpt run --dataset short.json --scenario short
npx mpt run --dataset long-summary.json --scenario long-summary
npx mpt run --dataset nsfw.json --scenario nsfw

run 同时兼容两种数据集格式:

  • 旧格式:["prompt1", "prompt2"]
  • 新格式:{ "meta": {...}, "items": [{"content":"..."}] }

报告增强

HTML 报告已包含:

  • P90 响应
  • P90 TTFT
  • 场景 / 数据集 / 数据集条数 / 语料来源信息

报告文件名包含场景标签:

{model}_{scenario}_{timestamp}_report.html

帮助命令

npx mpt run -h
npx mpt dataset gen -h

开源隐私约定

  • 文档与帮助示例统一使用通用占位符(如 MY_CHANNELmodel-a),不使用组织内部命名。
  • 不在仓库中提交任何真实密钥、账号令牌或本机绝对路径。