LLM GPU Toolkit estimates GPU memory (VRAM) and compute for training and running large language models, including quantization and multi-GPU setups. 估算大语言模型训练与推理所需的显存和算力(含量化、多卡)。
Online / 在线使用: https://jammyfu.github.io/llm_gpu_toolkit/ · Install / 安装: see 安装说明
- Project brief: PROJECT_BRIEF.md
- Long-range roadmap: MASTER_PLAN.md
- Current execution entry: CURRENT_PLAN.md
- Candidate backlog: TODO_BACKLOG.md
- Governance log: docs/project-governance/WORKLOG.md
- Automation notes: docs/AUTOMATION_COMMANDS.md
- Long-running autonomy: docs/LONG_RUNNING_AUTONOMY.md
- Verification entry:
python3 tools/verify.py
- Positioning: Mixed Python and web tooling for LLM GPU sizing, model data collection, and resource estimation.
- Stack: Python scripts plus static web assets.
- Current goal: Normalize the mixed-tooling repo into a stable planning loop without changing its data model or calculators.
LLM GPU工具包,专注于大语言模型的GPU资源计算和优化,帮助开发者更好地规划和利用GPU资源。
- 计算LLM模型在不同配置下的GPU显存占用
- 估算模型训练和推理时的GPU算力需求
- 提供多卡并行训练的资源分配建议
- 支持主流LLM模型的显存优化方案分析
- 模型量化对GPU资源影响的评估
- 创建并配置虚拟环境:
python setup.py setup_venv- 激活虚拟环境:
Windows:
.\venv\Scripts\activateLinux/Mac:
source venv/bin/activate- 安装包:
pip install -e .pip install llm-gpu-toolkit- Python >= 3.8
- 依赖包会在安装时自动配置:
- beautifulsoup4 >= 4.12.0
- requests >= 2.31.0
- urllib3 >= 2.0.0
- certifi >= 2023.11.17
- charset-normalizer >= 3.3.0
- idna >= 3.6
- soupsieve >= 2.5
get_model.py 可以从 Ollama 库中获取不同模型的信息,包括模型名称、大小、量化方式等数据。
在运行 get_model.py 前,请确保配置文件 config.json 已正确设置:
{
"output_dirs": {
"cleaned": "modeldata/cleaned"
},
"models": [
{
"name": "deepseek r1",
"key": "deepseek",
"version": "r1",
"description": "DeepSeek R1: 作为一个由 DeepSeek 公司开发的模型...",
"base_url": "https://ollama.com/library/deepseek-r1",
"tags_url": "https://ollama.com/library/deepseek-r1/tags",
"output_file": "deepseek_r1_models.json"
},
// 其他模型配置...
]
}- 确保已安装所有依赖
- 运行脚本获取模型数据:
python get_model.py- 数据将保存在
modeldata/cleaned/目录下,每个模型系列对应一个 JSON 文件
脚本运行后会在控制台输出处理进度,并在指定目录生成 JSON 文件,包含模型的详细信息:
本项目采用 MIT 许可证。详见 LICENSE 文件。
欢迎提交 Issue 和 Pull Request!
- jammyfu
- GitHub: https://github.com/jammyfu/llm-gpu-toolkit
- 初始版本发布
- 基础GPU资源计算功能实现
- 支持主流LLM模型的显存分析
- 进入项目根目录:
cd llm-gpu-toolkit- 启动 HTTP 服务器:
python -m http.server 8000- 在浏览器中访问:
http://localhost:8000/index.html
- 安装 Node.js 依赖:
npm install -g live-server- 启动服务器:
live-server --port=8000- 浏览器会自动打开 index.html
- 在 VSCode 中安装 "Live Server" 扩展
- 右键 index.html,选择 "Open with Live Server"
- 浏览器会自动打开页面