canirun
A lightweight CLI to estimate hardware requirements and quantization compatibility for Hugging Face models.
[!NOTE] Currently optimized for standard Transformer architectures (Llama, Mistral, Gemma, BERT). MoE and custom architectures may have experimental support.
Key Features
- Hardware Detection: Automatically detects your CPU/GPU and available VRAM/RAM.
- Memory Estimation: Estimates the memory required to run a given Hugging Face model.
- Quantization Analysis: Checks compatibility for different quantization levels (e.g., 4-bit, 8-bit, 16-bit).
- Simple CLI & API: Easy to use from the command line or integrate into your Python projects.
Installation
You can install canirun using pip:
pip install canirun
CLI Usage
The canirun command allows you to quickly check a model from your terminal.
canirun <model_id> [OPTIONS]
Example
Let's check if meta-llama/Meta-Llama-3-8B can run on the local hardware:
canirun meta-llama/Meta-Llama-3-8B --ctx 4096
This will produce a report like this:
🔍 ANALYSIS REPORT: meta-llama/Meta-Llama-3-8B
Context Length : 4096
Device : NVIDIA GeForce RTX 3090
VRAM / RAM : 24.0 GB / 64.0 GB
╒════════════════╤══════════════╤════════════╤════════════════════════╕
│ Quantization │ Total Est. │ KV Cache │ Compatibility │
╞════════════════╪══════════════╪════════════╪════════════════════════╡
│ FP16 │ 16.96 GB │ 512.00 MB │ ✅ GPU │
├────────────────┼──────────────┼────────────┼────────────────────────┤
│ INT8 │ 9.48 GB │ 512.00 MB │ ✅ GPU │
├────────────────┼──────────────┼────────────┼────────────────────────┤
│ 4-bit │ 6.30 GB │ 512.00 MB │ ✅ GPU │
├────────────────┼──────────────┼────────────┼────────────────────────┤
│ 2-bit │ 4.34 GB │ 512.00 MB │ ✅ GPU │
╘════════════════╧══════════════╧════════════╧════════════════════════╛
API Usage
You can also use canirun programmatically in your Python code.
from canirun import canirun
model_id = "mistralai/Mistral-7B-v0.1"
# Analyze the model
result = canirun(model_id, context_length=2048)
if result and result.is_supported:
print(f"'{model_id}' is supported on your hardware!")
# Get the detailed report
report = result.report()
for quant_result in report:
print(f"- {quant_result['quant']}: {quant_result['status']}")
else:
print(f"'{model_id}' is not supported on your hardware.")
How It Works
canirun works by:
- Fetching the model's configuration from the Hugging Face Hub.
- Calculating the memory required for the model's parameters.
- Estimating the size of the KV cache based on the context length and model architecture.
- Comparing the estimated memory requirements with your system's available VRAM (if a GPU is detected) or RAM.
The tool checks for different levels of quantization to see if a smaller, quantized version of the model could fit.
Development
This project maintains strict code quality standards:
- Formatter: Black
- Linter: Ruff
- Type Checking: MyPy (Strict)
- Docstrings: Google Style
License
This project is licensed under the MIT License - see the LICENSE file for details.
Metadata
Release files for canirun 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| canirun-1.0.1.tar.gz | 13.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| canirun-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.0 kB
Release files / canirun-1.0.1.tar.gz
| Download URL | canirun-1.0.1.tar.gz |
|---|---|
| Size | 13.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
519424ccd28d0c9a5051d745a1e95b7acccc670681cf306b935e63e8eb2ffbbb
|
|
BLAKE2b-256 checksum How to use checksums |
43fd3aa530ca4a0c61bc145b1232bd2d9559cc11089f3131f2e90f4541b4b905
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 24, 2026.
Transparency logRelease files / canirun-1.0.1-py3-none-any.whl
| Download URL | canirun-1.0.1-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fc8cfdc63072781f9a32190f6f5a8274bc94933972011f3864046f01cacbd0df
|
|
BLAKE2b-256 checksum How to use checksums |
7910166438b0e82ec7ff1794d5a190ad5b5f8186575fc50dc4e8cb4a6c5b1d60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 24, 2026.
Transparency log