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.4.12

Published

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

Readme

LLMPerf

LLMPerf Logo License Node.js OpenAI Compatible

OpenAI 兼容的 LLM 服务实时性能测试工具,配备精美的 Web UI

GitHub stars GitHub forks

✨ 功能特性

  • 🚀 实时监控 - 带有计数器和性能指标的实时进度跟踪
  • 📊 性能指标 - TTFT(首次响应时间)、TPOT(每输出令牌时间)、响应时间
  • 🎯 多任务支持 - 同时运行多个性能测试
  • 💾 任务持久化 - 保存、编辑和重新运行测试配置
  • 📈 历史记录 - 完整的执行历史和详细统计数据
  • 🌊 流式支持 - 测试流式和非流式响应
  • 🔊 音频通知 - 测试完成时的声音提示
  • 🎨 精美界面 - 具有实时更新的现代响应式 Web 界面
  • 📱 移动友好 - 在桌面和移动设备上完美运行

🚀 快速开始

安装

# 克隆仓库
git clone https://github.com/yourusername/llm-perf.git
cd llm-perf

# 安装依赖
npm install

# 启动服务器
npm start

使用方法

  1. 打开 Web 界面:访问 http://localhost:3000
  2. 创建测试任务:填写配置表单
  3. 保存并执行:点击"保存并执行"开始测试
  4. 实时监控:观看实时性能仪表板
  5. 分析结果:查看详细统计和历史数据

📊 支持的指标

核心性能指标

  • TTFT(首次响应时间):从请求到首个令牌响应的时间
  • TPOT(每输出令牌时间):令牌生成之间的平均时间
  • 总响应时间:完整的请求-响应周期时间
  • 令牌数量:生成的令牌数量
  • 成功率:成功请求的百分比

统计分析

  • 平均值:所有测试的平均性能
  • 中位数:性能分布的中间值
  • P95:第95百分位性能
  • P99:第99百分位性能
  • 最小/最大值:最佳和最差性能值

🔧 配置

基本设置

const config = {
  url: "https://api.openai.com",        // 服务端点
  model: "gpt-3.5-turbo",              // 模型名称
  apiKey: "your-api-key",               // 认证密钥
  message: "你好,请介绍一下自己",      // 测试消息
  maxTokens: 1000,                     // 最大输出令牌数
  stream: true,                        // 启用流式输出
  testCount: 10                        // 测试运行次数
};

支持的服务

  • ✅ OpenAI API
  • ✅ Azure OpenAI Service
  • ✅ DeepSeek API
  • ✅ 任何 OpenAI 兼容的服务

📱 Web 界面功能

任务管理

  • 创建:定义新的测试配置
  • 编辑:修改现有测试参数
  • 执行:运行性能测试
  • 监控:实时进度跟踪
  • 历史:查看过去执行结果

实时仪表板

  • 实时进度:令牌计数和进度条
  • 性能指标:实时 TTFT/TPOT 计算
  • 多任务视图:监控并发测试
  • 音频提醒:完成通知
  • 自动刷新:持续状态更新

🛠️ API 参考

任务

POST   /api/tasks          # 创建新任务
GET    /api/tasks          # 列出所有任务
GET    /api/tasks/:id      # 获取任务详情
PUT    /api/tasks/:id      # 更新任务
DELETE /api/tasks/:id      # 删除任务
POST   /api/tasks/:id/execute  # 执行任务

执行记录

GET    /api/executions             # 列出所有执行记录
GET    /api/executions/:id         # 获取执行详情
GET    /api/executions/running     # 获取运行中的执行
GET    /api/tasks/:id/executions   # 获取任务执行记录

📈 使用示例

基本性能测试

curl -X POST http://localhost:3000/api/tasks \
  -H "Content-Type: application/json" \
  -d '{
    "name": "OpenAI GPT-3.5 测试",
    "url": "https://api.openai.com",
    "model": "gpt-3.5-turbo",
    "apiKey": "sk-your-key",
    "message": "请解释量子计算",
    "maxTokens": 500,
    "stream": true,
    "testCount": 10
  }'

执行测试

curl -X POST http://localhost:3000/api/tasks/{taskId}/execute

🎯 使用场景

  • 性能基准测试:比较不同模型和服务
  • 服务监控:跟踪 API 性能随时间变化
  • 负载测试:测量各种负载下的性能
  • 回归测试:确保性能不下降
  • 供应商比较:比较不同的 LLM 提供商
  • 性能优化:微调参数以获得最佳性能

🔍 性能基准

以下是一些典型的性能范围供参考:

| 指标 | 优秀 | 良好 | 一般 | 较差 | |--------|-----------|------|---------|------| | TTFT | < 500ms | 500-1000ms | 1-2s | > 2s | | TPOT | < 50ms/令牌 | 50-100ms/令牌 | 100-200ms/令牌 | > 200ms/令牌 | | 成功率 | > 99% | 95-99% | 90-95% | < 90% |

🤝 贡献

我们欢迎贡献!请查看我们的贡献指南了解详情。

  1. Fork 本仓库
  2. 创建您的功能分支 (git checkout -b feature/AmazingFeature)
  3. 提交您的更改 (git commit -m '添加某个很棒的功能')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 打开 Pull Request

📄 许可证

本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。

🙏 致谢

  • OpenAI 提供了启发此工具的出色 API
  • 所有帮助改进 LLMPerf 的贡献者
  • 为提供宝贵反馈的开源社区

🔗 链接