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

@chenpu17/llm-perf

v0.6.2

Published

LLMPerf - Real-time performance testing tool for OpenAI-compatible LLM services with beautiful web UI

Readme

LLMPerf

LLMPerf 是一个以浏览器界面为核心的 OpenAI 兼容 LLM 接口性能测试工具。你可以保存可复用的测试任务、重复执行同一组请求、观察流式输出表现,并在历史记录里对比不同结果。

English guide: README.md

可以测什么

  • TTFT:首个 token 返回时间
  • TPOT:流式输出下每个 token 的平均耗时
  • 总响应时间
  • 输出 token 数
  • 吞吐量
  • 多轮重复测试后的成功率和失败次数

安装

环境要求

  • Node.js 16+

在项目目录里安装

npm install

从 npm 全局安装

npm install -g @chenpu17/llm-perf

启动

默认端口是 3100

在项目目录里启动

npm start

打开 http://localhost:3100

指定端口启动

npm start -- --port 8080
node server.js --port 8080

全局安装后启动

llm-perf
llm-perf --port 8080

查看 CLI 帮助

node server.js --help

首次使用流程

1. 打开仪表盘

启动服务后,在浏览器里进入任务页。第一次启动时通常是空白状态。

空白仪表盘

2. 创建测试任务

点击 Create Task 或界面中的“新建任务”,右侧会弹出抽屉表单。

创建任务抽屉

这些字段怎么填:

| 字段 | 应该填写什么 | | --- | --- | | Task Name | 你自己容易识别的名字,例如 MiniMax 流式测试 | | Service URL | 完整的 OpenAI 兼容 chat/completions 地址 | | Model | 需要发送给服务端的精确模型名 | | API Key | 对应服务商的密钥 | | Test Count | 同一个提示词要重复执行多少次 | | Max Tokens | 发给服务商的最大输出长度限制 | | Stream Output | 如果你要看 TTFT 和 TPOT,建议开启 | | Test Message | 每一轮基准测试都会发送的提示词 |

常见 URL 例子:

  • OpenAI:https://api.openai.com/v1/chat/completions
  • DeepSeek:https://api.deepseek.com/v1/chat/completions
  • Azure OpenAI:https://<resource>.openai.azure.com/openai/deployments/<deployment>/chat/completions?api-version=2023-12-01-preview

3. 保存并确认任务卡片

保存后,任务会立刻出现在任务页里。

任务卡片

4. 执行测试并查看监控

点击任务卡片上的 Execute,然后切到 Monitor 页面查看实时进度。

监控页面

你会看到:

  • 当前重复测试执行到了第几轮
  • 平均 TTFT 和 TPOT 会随着测试推进逐步出现
  • 所有轮次结束后,这张监控卡片会自动消失

5. 在历史页查看最终结果

测试结束后,结果会进入 History 页面,最新执行会排在最上面。

历史页面

在这里你可以:

  • 按任务和状态筛选
  • 多选执行记录做对比
  • 导出 JSON 或 CSV

6. 用 Chat 观察单次真实响应

每个任务卡片还有一个 Chat 按钮。它适合拿来观察一次真实的流式对话过程,确认 TTFT、TPOT 和 token usage 的处理是否符合预期。

聊天指标

指标怎么看

TTFT

TTFT 是从请求发出到收到第一个 token 的耗时。数值越低,通常代表模型开始响应越快。

TPOT

TPOT 是第一个 token 之后,平均每个输出 token 需要多少毫秒。数值越低,通常代表流式输出越顺畅。

Chat 面板里的 Tokens

聊天面板不仅显示 token 数,还会显示这个数字来自哪里:

  • 等待最终 usage:流还没结束,最终 usage 还没回来
  • 流中估算:正在流式输出,界面显示的是临时估算值
  • 最终 provider usage:最终 token 数直接来自服务商响应
  • 最终本地估算:服务商没返回最终 usage,LLMPerf 用本地方式做了估算

这很重要,因为流中看到的数字可能只是中间态,真正应该拿来分析的是结束后的最终值。

结果可信度说明

执行结果页也会标注 token 来源:

  • 模型 usage
  • 本地分词
  • 混合模式

这样你在跨服务商对比时,可以直接判断 token 指标到底是服务商原始数据,还是本地估算。

数据存储

默认情况下,任务和历史执行记录保存在:

~/.llm-perf/tasks.json

如果你想改存储目录:

LLMPERF_DATA_DIR=/custom/path npm start

使用建议

  • 一定要填完整的 chat/completions 地址,不要只填域名。
  • 如果你要看 TTFT 和 TPOT,请开启 Stream Output
  • 有些服务商会返回最终 usage,有些不会,LLMPerf 会明确告诉你来源。
  • 如果回复特别短,TPOT 的统计会更容易波动。适当提高 Max Tokens,更利于横向比较。

开发

运行测试:

npm test -- --runInBand

常用命令:

node server.js --help
npm run docs:screenshots

许可证

MIT,详见 LICENSE