Mixed-precision LLM acceleration: faster with same output
Project description
Fast LLM
Run any AI model faster on CPU — same output, zero training.
pip install fastllm-turbo
fast-llm calibrate Qwen/Qwen2.5-0.5B
How it works
Most of a neural network's weights don't need full precision. We use a per-layer reconstruction error metric to identify which layers are sensitive to precision loss and which are robust. Sensitive layers stay FP32. Robust layers use INT8 dynamic quantization.
The result: a mixed-precision model that outputs the same tokens as the original, but runs faster because ~60% of computation uses 4× smaller weights.
| Method | Speed | Output matches original? |
|---|---|---|
| INT8 all layers | ~2× | No (quality degrades on small models) |
| Mixed-precision | ~1.6× | Yes |
| FP32 (original) | 1× | — |
Install
pip
pip install fastllm-turbo
Linux / macOS
curl -sSf https://fast-llm.dev/install.sh | sh
Windows (PowerShell)
powershell -c "iex ((New-Object Net.WebClient).DownloadString('https://fast-llm.dev/install.ps1'))"
Usage
# Step 1: Analyze which layers can be INT8
fast-llm calibrate Qwen/Qwen2.5-0.5B
# Step 2: Save optimized model
fast-llm save Qwen/Qwen2.5-0.5B
# Step 3: Run
fast-llm run Qwen/Qwen2.5-0.5B --benchmark
# Interactive chat
fast-llm chat Qwen/Qwen2.5-0.5B
# Desktop GUI
fast-llm gui
Works with any HuggingFace causal LM: Qwen, Llama 3, Phi-3, Mistral, Gemma, DeepSeek.
Requirements
- Python 3.8+
- PyTorch 2.0+ (CPU)
- 1–4 GB RAM per billion parameters
License
MIT
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
File details
Details for the file fastllm_turbo-2.0.1.tar.gz.
File metadata
- Download URL: fastllm_turbo-2.0.1.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1ef0a4b0f08ca499d3cb22a3f718f2d81279a68e227da196674674c149a73da
|
|
| MD5 |
67044676083b3c2dbee9118f94a9c19f
|
|
| BLAKE2b-256 |
1025c07db5ee2d3990205a33a3c0d942ba26d0a493e21f984bf14f36cf2ef645
|