LLM性能测试工具 - 支持本地和云端大模型性能测试
Go to file
OpenClaw ebbc56fc4a Add LLM performance testing tool with visualization 2026-03-02 23:57:09 +08:00
templates Add LLM performance testing tool with visualization 2026-03-02 23:57:09 +08:00
README.md Add LLM performance testing tool with visualization 2026-03-02 23:57:09 +08:00
app.py Add LLM performance testing tool with visualization 2026-03-02 23:57:09 +08:00
deploy.sh Add LLM performance testing tool with visualization 2026-03-02 23:57:09 +08:00
requirements.txt Add LLM performance testing tool with visualization 2026-03-02 23:57:09 +08:00

README.md

LLM 性能测试工具

一个用于测试本地和云端大模型性能的网页应用,兼容 OpenAI API 格式。

功能特性

  • 🔧 API 配置管理:支持配置多个 LLM API 端点
  • 🤖 模型配置:管理不同模型的参数设置
  • 📝 测试用例管理:创建、编辑、导入/导出测试用例
  • ⚙️ 测试配置:自定义并发数、请求次数等参数
  • 📊 可视化图表:实时显示 TTFT、TPS、延迟等指标
  • 📈 历史记录:保存和对比多次测试结果
  • 🌐 OpenAI API 兼容:支持任何兼容 OpenAI API 的模型服务

性能指标

  • TTFT (Time To First Token):首 token 响应时间
  • TPS (Tokens Per Second):每秒生成 token 数
  • 总延迟:完整响应时间
  • 吞吐量:每分钟请求数

快速开始

1. 安装依赖

pip install -r requirements.txt

2. 启动应用

python app.py

或部署到生产环境:

./deploy.sh

3. 访问应用

打开浏览器访问 http://localhost:8001

使用说明

配置 API

  1. 点击"API 配置"标签
  2. 添加新的 API 配置:

配置模型

  1. 点击"模型配置"标签
  2. 添加模型配置:
    • 选择对应的 API 配置
    • 输入模型名称
    • 设置温度、最大 token 数等参数

管理测试用例

  1. 点击"测试用例"标签
  2. 添加测试提示词
  3. 支持批量导入/导出 JSON 格式

运行测试

  1. 点击"性能测试"标签
  2. 选择要测试的模型
  3. 选择测试用例
  4. 设置并发数和请求次数
  5. 点击"开始测试"

查看结果

  • 实时查看 TTFT、TPS 等指标
  • 查看详细的响应数据
  • 导出结果为 JSON 格式

API 兼容性

本工具兼容任何实现 OpenAI API 格式的服务:

  • OpenAI GPT 系列
  • Ollama (本地模型)
  • vLLM
  • text-generation-inference
  • 其他兼容服务

项目结构

llm_perf_test/
├── app.py              # Flask 主应用
├── requirements.txt    # Python 依赖
├── deploy.sh          # 部署脚本
├── README.md          # 使用说明
└── templates/
    └── index.html     # 前端页面

技术栈

  • 后端: Python + Flask
  • 前端: HTML + JavaScript + Chart.js
  • UI: Tailwind CSS
  • 数据存储: SQLite (JSON 文件)

License

MIT License