Estimate VRAM requirements for HuggingFace LLMs without downloading model weights
Project description
🧠 LLM Resource Planner
The LLM Resource Planner is a high-performance Python CLI tool for estimating VRAM and memory requirements for Large Language Models (LLMs). By performing static analysis on Hugging Face model configurations, it helps developers perform AI infrastructure planning and deployment validation without needing to download massive model weights.
⚡ The Problem
Deploying LLMs is a guessing game. Downloading 50GB of weights only to hit a "CUDA Out of Memory" error is a waste of bandwidth and time. LLM Resource Planner eliminates the guesswork by performing static analysis on model configurations.
🛠 How it Works
Instead of downloading model weights, this tool fetches the config.json via the Hugging Face API to mathematically derive:
- Weight Footprint: Based on your chosen quantization (FP16, INT8, INT4).
- KV Cache Requirements: Estimating overhead at specific sequence lengths.
- Operational Buffer: Factoring in activation memory and system overhead.
🚀 Quick Start
# Clone the repository
git clone https://github.com/yourusername/llm-resource-planner.git
cd llm-resource-planner
# Install dependencies
pip install -r requirements.txt
# Execute
python main.py microsoft/Phi-3.5-mini-instruct
🔐 Authentication
For gated models (e.g., Llama-3), set your environment variable:
export HUGGINGFACE_TOKEN='your_hf_token_here'
📊 Performance Output
--- Analyzing microsoft/Phi-3.5-mini-instruct ---
Estimated Parameters: ~3.82B
Memory (Weights): 7.64 GB
Memory (KV Cache @ 4k): 2.00 GB
Total Recommended VRAM: 9.77 GB
🛡 Responsible Usage Policy
This tool is built for developer research and infrastructure planning. To maintain the health of the Hugging Face API:
- Respect Rate Limits: This script is for on-demand use, not for high-frequency automated scraping.
- Compliance: All usage must adhere to the Hugging Face Terms of Service.
- Non-Abusive Intent: Do not integrate this into services intended for mass data harvesting.
⚠️ Disclaimer
Estimates are theoretical. Actual VRAM utilization varies significantly based on the inference engine (e.g., vLLM, Ollama, TensorRT-LLM) and system-specific optimizations. We recommend a 10–20% safety margin in your infrastructure provisioning.
🤝 Contributing
Found a model architecture that behaves unexpectedly? Open an Issue. We welcome PRs that refine our heuristic memory models.
Built with ❤️ for the open-source AI community.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_resource_planner-0.1.0.tar.gz.
File metadata
- Download URL: llm_resource_planner-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68e4701d154c7e7f32da4789802daa4d99a9244ab593c62dd3c2d71a9877b146
|
|
| MD5 |
0c3f8076c3b4e7d7ad0da56aaef78256
|
|
| BLAKE2b-256 |
3709e7e1de5c52b4db387e9d7ae9ac0d96f33b03ca6ed41287d47fe5cc772068
|
File details
Details for the file llm_resource_planner-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llm_resource_planner-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
caea583d2034380b7475ba057585ebae0257b53ddeeae4b51f0bfec9e68874e2
|
|
| MD5 |
3844e1841575cba9d87770f215aac03a
|
|
| BLAKE2b-256 |
77ba41aabfddf8b6f359f69fee2966c37b32a82ff7b080f815747b355e955399
|