Skip to main content

SageQuant: Open-source inference tradeoff calculator and quantization advisor

Project description

alt text

PyPI version GitHub stars License MIT

SageQuant is a data-driven CLI tool that helps you choose the optimal serving stack. Given your model size, target hardware, workload shape, and tail latency/quality budget, it recommends the best inference engine, quantization algorithm, and bit-width scheme.

It provides choices backed by real benchmark data, not guesswork.


Why SageQuant?

Choosing how to serve an LLM today is usually an ad-hoc decision: defaulting to vLLM, trying AWQ w4a16 because of a blog post, and hoping for the best.

SageQuant replaces this guesswork with a structured lookup across three distinct decisions:

  1. Inference Engine: vLLM vs. SGLang vs. TensorRT-LLM vs. MLX
  2. Quantization Algorithm: GPTQ vs. AWQ vs. FP8 vs. SmoothQuant vs. MLX native
  3. Bit-width Scheme: FP16 vs. 8-bit (W8A8) vs. 4-bit (W4A16)

Tradeoff Visualization

SageQuant maps tradeoffs across engines and algorithms for the same model and hardware:

Engine Quant Algo Scheme TTFT (p50 / p95) Throughput Quality vs. FP16
vLLM none fp16 85 / 140ms 45.0 tok/s baseline
vLLM GPTQ w4a16 145 / 210ms 38.2 tok/s -1.1% (mmlu-5shot, n=200)
vLLM AWQ w4a16 140 / 205ms 39.5 tok/s -0.8% (mmlu-5shot, n=200)
SGLang AWQ w4a16 98 / 165ms 52.0 tok/s -1.4% (mmlu-5shot, n=200)

alt text


Quick Start

1. Install

pip install -e .
# Advanced features (Streamlit dashboard & scikit-learn regression interpolation):
pip install -e ".[advanced]"

2. Get a Recommendation

Find the best stack based on your budget:

sage-quant recommend --model-size 7b --hardware a100-40gb --max-latency 200ms --min-quality 98
Recommended: SGLANG + AWQ (w4a16), prefix caching on
Workload: 128 in / 128 out tokens
Expected: 60ms TTFT (p50) · 105ms TTFT (p95) · 75.0 tok/s · -1.4% quality (mmlu-5shot, n=200)
Confidence: exact (3 matching benchmark runs)

Note (Engine): SGLang features RadixAttention and is highly efficient for high-cache-reuse workloads.
Note (Algo): AWQ generally preserves quality slightly better than GPTQ at 4-bit.

3. Generate Serving Config

Get a copy-pasteable server launch command:

sage-quant serve-config --model-size 7b --hardware a100-40gb --model meta-llama/Meta-Llama-3-8B-Instruct --prefer-engine sglang

Command Reference

  • sage-quant recommend — Find optimal engine, algorithm, and scheme. Supports --prompt-tokens, --output-tokens, and --prefer-engine.
  • sage-quant serve-config — Generate vLLM/SGLang/MLX launch configuration scripts or YAML files.
  • sage-quant list-hardware / list-engines / list-quant-algos — Check what combinations are currently covered in the dataset.
  • sage-quant contribute — Append custom benchmark runs (JSON/CSV) to the local dataset and get instructions to open a PR.

Documentation

For a comprehensive guide, detailed command usage, and real-world example scenarios, see the User Guide.


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sage_quant-0.2.2.tar.gz (18.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sage_quant-0.2.2-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file sage_quant-0.2.2.tar.gz.

File metadata

  • Download URL: sage_quant-0.2.2.tar.gz
  • Upload date:
  • Size: 18.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for sage_quant-0.2.2.tar.gz
Algorithm Hash digest
SHA256 14a053112afc0c6384fd4f50e8fec0c47972f8bdbe40c55d8a201b95814a1a9e
MD5 63087f3ebcbaa6338c8a75ebdde4d808
BLAKE2b-256 fe3c492d0c23b553f3835d04ff7c549f5e6a9acfb0a2c93af29d217dc988c4e8

See more details on using hashes here.

File details

Details for the file sage_quant-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: sage_quant-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.6

File hashes

Hashes for sage_quant-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 69cb5c199acbd2c0c67e420b08f64dfcfa427bc6ce9ba0269d05b3fcbb6be542
MD5 62a04a5f89a84514627c0000e6293f0c
BLAKE2b-256 36b14e120b1907fb440dbb7eb4c9c25d47c59dd25a5d04f760f7d17824c397e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page