Instructions to use compilade/quant-tests with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use compilade/quant-tests with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf compilade/quant-tests:F16 # Run inference directly in the terminal: llama cli -hf compilade/quant-tests:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf compilade/quant-tests:F16 # Run inference directly in the terminal: llama cli -hf compilade/quant-tests:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf compilade/quant-tests:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf compilade/quant-tests:F16
Use Docker
docker model run hf.co/compilade/quant-tests:F16
- Llama new
- LM Studio
- Jan
- Ollama
How to use compilade/quant-tests with Ollama:
ollama run hf.co/compilade/quant-tests:F16
- Unsloth Desktop
- Docker Model Runner
How to use compilade/quant-tests with Docker Model Runner:
docker model run hf.co/compilade/quant-tests:F16
- Lemonade
How to use compilade/quant-tests with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull compilade/quant-tests:F16
Run and chat with the model
lemonade run user.quant-tests-F16
List all available models
lemonade list
- Atomic Chat
Download bench-TriLMs.sh from compilade/quant-tests: direct link, hf CLI and curl.
- Browser
- Download file 2.22 kB
-
https://huggingface.co/compilade/quant-tests/resolve/main/bench-TriLMs.sh
- Command line
-
hf download hf://compilade/quant-tests/bench-TriLMs.sh
-
curl -L -o bench-TriLMs.sh https://huggingface.co/compilade/quant-tests/resolve/main/bench-TriLMs.sh
2.22 kB
| set -eux | |
| cd "$(dirname "$0")" | |
| MODEL_DIR="bench-TriLMs-models" | |
| LLAMA_CPP_PATH="." | |
| sizes=("1.5" "2.4" "3.9") | |
| types=("TQ1_0" "TQ2_0" "Q4_K_M" "Q8_0" "F16" "BF16") | |
| gputypes=("TQ2_0" "Q4_K_M" "Q8_0" "F16") | |
| function gather_models() { | |
| echo Gather the models | |
| if [ ! -d "$MODEL_DIR" ]; then | |
| mkdir -p -- "$MODEL_DIR" | |
| fi | |
| ( | |
| cd "$MODEL_DIR" | |
| for sz in "${sizes[@]}"; do | |
| filename="TriLM_${sz}B_Unpacked-TQ1_0-F16.gguf" | |
| if [ ! -f "$filename" ]; then | |
| wget "https://huggingface.co/compilade/quant-tests/resolve/main/${filename}" | |
| fi | |
| done | |
| ) | |
| } | |
| function build_llama_cpp() { | |
| echo Build llama.cpp for CPU | |
| ( | |
| cd -- "$LLAMA_CPP_PATH" | |
| if [ -d build ]; then | |
| pwd | |
| rm -rf build | |
| fi | |
| mkdir build | |
| cd build | |
| cmake .. "$@" | |
| make -j llama-bench llama-quantize | |
| ) | |
| } | |
| function quantize() { | |
| echo "Make all model types we'll test" | |
| ( | |
| for sz in "${sizes[@]}"; do | |
| for ty in "${types[@]}"; do | |
| filenames=("$MODEL_DIR"/TriLM_"${sz}"B_Unpacked-{TQ1_0-F16,"$ty"}.gguf) | |
| if [ ! -f "${filenames[1]}" ]; then | |
| "$LLAMA_CPP_PATH"/build/bin/llama-quantize --allow-requantize "${filenames[@]}" "$ty" | |
| fi | |
| done | |
| done | |
| ) | |
| } | |
| function bench() { | |
| echo Test each model one by one for different numbers of threads | |
| for sz in "${sizes[@]}"; do | |
| for ty in "$@"; do | |
| for th in 1 2 4 8; do | |
| { | |
| "$LLAMA_CPP_PATH"/build/bin/llama-bench -v -m "${MODEL_DIR}/TriLM_${sz}B_Unpacked-${ty}.gguf" -t "${th}" -p 512 -n 128 -r 4 -o json | |
| printf "%s\n" "," | |
| } | |
| done | |
| done | |
| done | |
| } | |
| function bench_cpu() { | |
| bench "${types[@]}" >> "$1" | |
| } | |
| function bench_gpu() { | |
| bench "${gputypes[@]}" >> "$1" | |
| } | |
| currentTime="$(date +'%s')" | |
| resultFile="results-${currentTime}.json" | |
| infoFile="results-${currentTime}-info.txt" | |
| lscpu > "$infoFile" | |
| gather_models | |
| build_llama_cpp -DGGML_NATIVE=ON -DGGML_CPU=ON | |
| quantize | |
| echo "---" >> "$infoFile" | |
| ls -go "$MODEL_DIR" >> "$infoFile" | |
| bench_cpu "$resultFile" | |
| if [ -x "$(command -v nvidia-smi)" ]; then | |
| echo GPU detected, benchark with that too. | |
| build_llama_cpp -DGGML_NATIVE=ON -DGGML_CUDA=ON -DGGML_CUDA_F16=ON | |
| bench_gpu "$resultFile" | |
| fi | |