Run big AI models on small hardware. Integer Descent guided model compression.
Project description
TinyPort
Run big AI models on small hardware.
TinyPort compresses AI models from HuggingFace or local files so they can run on phones, Raspberry Pi, laptops — any device with a processor.
It uses Integer Descent — an information-theoretic framework that measures how much real information each layer of a neural network is actually carrying. Layers with low information density (high "carry pressure") get compressed aggressively. Information-dense layers keep their precision. The result: smaller models that behave like larger ones.
Install
pip install tinyport
With HuggingFace support:
pip install tinyport[full]
Quickstart
Python
from tinyport import load_model, compress
# Load from HuggingFace Hub
weights = load_model("openai/whisper-tiny")
# Compress for Raspberry Pi 5
compressed = compress(weights, target="rpi5")
print(compressed.summary())
# Model: openai/whisper-tiny
# Original: 151.0 MB (FP32)
# Compressed: 37.8 MB (4.0x smaller)
# Quality: Good (INT4 quality, ~3-5% accuracy impact with ID-guidance)
CLI
# Analyze a model
tinyport analyze --model openai/whisper-tiny
# Compress for a phone
tinyport compress --model openai/whisper-tiny --target phone
# List all hardware targets
tinyport targets
Hardware Targets
| Target | Device | Bits |
|---|---|---|
server |
Cloud GPU / data center | INT8 |
desktop |
Gaming PC with GPU | INT6 |
laptop |
MacBook / laptop | INT5 |
phone |
Android / iPhone | INT4 |
rpi5 |
Raspberry Pi 5 | INT4 |
rpi4 |
Raspberry Pi 4 | INT4 |
rpi_zero |
Raspberry Pi Zero 2W | INT4 (tiny models only) |
How It Works
Standard quantization (like bitsandbytes, GPTQ) applies the same bit width to every layer. TinyPort profiles each layer individually using Integer Descent:
- Profile: Scan every layer, compute its Integer Descent Compressibility Score (IDCS)
- Allocate: High-IDCS layers (lots of free bits) → compress to INT4. Low-IDCS layers (information-dense) → keep INT6-8
- Quantize: Block-wise quantization preserves local weight distribution
- Export: Output a compressed file with deployment instructions
The result: comparable quality to uniform INT8 at INT4 size.
Running Compressed Models
TinyPort outputs compressed weights. To run them, use these battle-tested runtimes:
- LLMs on CPU/GPU: llama.cpp
- Vision/Audio on mobile: TFLite, MLC-LLM
- iPhone: CoreML
- Universal: ONNX Runtime
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
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 tinyport-0.1.0.tar.gz.
File metadata
- Download URL: tinyport-0.1.0.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0129c7158359f0fe437a2733d55b1e96dfef62752367c12820b9310bf43b0ef
|
|
| MD5 |
9d7ae90ff1d3c24c9c988a01072d6542
|
|
| BLAKE2b-256 |
4bd368ed01caf285adf3c92490133cb03e610e2a51c820f74b46dcaae8c83c80
|
File details
Details for the file tinyport-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tinyport-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3aec95f8e99cf8846eb4595753de9d356209e8fce5cdd008e9b83ba784845850
|
|
| MD5 |
f6635a5c6dfc688376934e05dd199715
|
|
| BLAKE2b-256 |
bafe4751ce52a66722b24c0af3ace0467328a3f1bf05bffc98272539ed11339b
|