Text Generation
GGUF
English
llama.cpp
bitnet
ternary
1.58-bit
quantized
q4_k_m
edge
efficient-inference
cpu
tool-calling
Instructions to use Qapdex/SLM750-Edge-1.58-bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Qapdex/SLM750-Edge-1.58-bit with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Qapdex/SLM750-Edge-1.58-bit", filename="quantized_q4km.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Qapdex/SLM750-Edge-1.58-bit 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 Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT # Run inference directly in the terminal: llama cli -hf Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT # Run inference directly in the terminal: llama cli -hf Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT # Run inference directly in the terminal: ./llama-cli -hf Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT # Run inference directly in the terminal: ./build/bin/llama-cli -hf Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT
Use Docker
docker model run hf.co/Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT
- LM Studio
- Jan
- vLLM
How to use Qapdex/SLM750-Edge-1.58-bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qapdex/SLM750-Edge-1.58-bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qapdex/SLM750-Edge-1.58-bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT
- Ollama
How to use Qapdex/SLM750-Edge-1.58-bit with Ollama:
ollama run hf.co/Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT
- Unsloth Studio
How to use Qapdex/SLM750-Edge-1.58-bit with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Qapdex/SLM750-Edge-1.58-bit to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Qapdex/SLM750-Edge-1.58-bit to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Qapdex/SLM750-Edge-1.58-bit to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Qapdex/SLM750-Edge-1.58-bit with Docker Model Runner:
docker model run hf.co/Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT
- Lemonade
How to use Qapdex/SLM750-Edge-1.58-bit with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Qapdex/SLM750-Edge-1.58-bit:Q4_K_M_QUANT
Run and chat with the model
lemonade run user.SLM750-Edge-1.58-bit-Q4_K_M_QUANT
List all available models
lemonade list
| set -euo pipefail | |
| # | |
| # check-requirements.sh checks all requirements files for each top-level | |
| # convert*.py script. | |
| # | |
| # WARNING: This is quite IO intensive, because a fresh venv is set up for every | |
| # python script. As of 2023-12-22, this writes ~2.7GB of data. An adequately | |
| # sized tmpfs /tmp or ramdisk is recommended if running this frequently. | |
| # | |
| # usage: check-requirements.sh [<working_dir>] | |
| # check-requirements.sh nocleanup [<working_dir>] | |
| # | |
| # where: | |
| # - <working_dir> is a directory that can be used as the base for | |
| # setting up the venvs. Defaults to `/tmp`. | |
| # - 'nocleanup' as the first argument will disable automatic cleanup | |
| # of the files created by this script. | |
| # | |
| # requires: | |
| # - bash >= 3.2.57 | |
| # - shellcheck | |
| # | |
| # For each script, it creates a fresh venv, `pip install`s the requirements, and | |
| # finally imports the python script to check for `ImportError`. | |
| # | |
| log() { | |
| local level=$1 msg=$2 | |
| printf >&2 '%s: %s\n' "$level" "$msg" | |
| } | |
| debug() { | |
| log DEBUG "$@" | |
| } | |
| info() { | |
| log INFO "$@" | |
| } | |
| fatal() { | |
| log FATAL "$@" | |
| exit 1 | |
| } | |
| cleanup() { | |
| if [[ -n ${workdir+x} && -d $workdir && -w $workdir ]]; then | |
| info "Removing $workdir" | |
| local count=0 | |
| rm -rfv -- "$workdir" | while read -r; do | |
| if (( count++ > 750 )); then | |
| printf . | |
| count=0 | |
| fi | |
| done | |
| printf '\n' | |
| info "Removed $workdir" | |
| fi | |
| } | |
| do_cleanup=1 | |
| if [[ ${1-} == nocleanup ]]; then | |
| do_cleanup=0; shift | |
| fi | |
| if (( do_cleanup )); then | |
| trap exit INT TERM | |
| trap cleanup EXIT | |
| fi | |
| this=$(realpath -- "$0"); readonly this | |
| cd "$(dirname "$this")/.." # PWD should stay in llama.cpp project directory | |
| shellcheck "$this" | |
| readonly reqs_dir=requirements | |
| if [[ ${1+x} ]]; then | |
| tmp_dir=$(realpath -- "$1") | |
| if [[ ! ( -d $tmp_dir && -w $tmp_dir ) ]]; then | |
| fatal "$tmp_dir is not a writable directory" | |
| fi | |
| else | |
| tmp_dir=/tmp | |
| fi | |
| workdir=$(mktemp -d "$tmp_dir/check-requirements.XXXX"); readonly workdir | |
| info "Working directory: $workdir" | |
| check_requirements() { | |
| local reqs=$1 | |
| info "$reqs: beginning check" | |
| pip --disable-pip-version-check install -qr "$reqs" | |
| info "$reqs: OK" | |
| } | |
| check_convert_script() { | |
| local py=$1 # e.g. ./convert_hf_to_gguf.py | |
| local pyname=${py##*/} # e.g. convert_hf_to_gguf.py | |
| pyname=${pyname%.py} # e.g. convert_hf_to_gguf | |
| info "$py: beginning check" | |
| local reqs="$reqs_dir/requirements-$pyname.txt" | |
| if [[ ! -r $reqs ]]; then | |
| fatal "$py missing requirements. Expected: $reqs" | |
| fi | |
| # Check that all sub-requirements are added to top-level requirements.txt | |
| if ! grep -qF "$reqs" requirements.txt; then | |
| fatal "$reqs needs to be added to requirements.txt" | |
| fi | |
| local venv="$workdir/$pyname-venv" | |
| python3 -m venv "$venv" | |
| ( | |
| # shellcheck source=/dev/null | |
| source "$venv/bin/activate" | |
| check_requirements "$reqs" | |
| python - "$py" "$pyname" <<'EOF' | |
| import sys | |
| from importlib.machinery import SourceFileLoader | |
| py, pyname = sys.argv[1:] | |
| SourceFileLoader(pyname, py).load_module() | |
| EOF | |
| ) | |
| if (( do_cleanup )); then | |
| rm -rf -- "$venv" | |
| fi | |
| info "$py: imports OK" | |
| } | |
| readonly ignore_eq_eq='check_requirements: ignore "=="' | |
| for req in */**/requirements*.txt; do | |
| # Make sure exact release versions aren't being pinned in the requirements | |
| # Filters out the ignore string | |
| if grep -vF "$ignore_eq_eq" "$req" | grep -q '=='; then | |
| tab=$'\t' | |
| cat >&2 <<EOF | |
| FATAL: Avoid pinning exact package versions. Use '~=' instead. | |
| You can suppress this error by appending the following to the line: | |
| $tab# $ignore_eq_eq | |
| EOF | |
| exit 1 | |
| fi | |
| done | |
| all_venv="$workdir/all-venv" | |
| python3 -m venv "$all_venv" | |
| ( | |
| # shellcheck source=/dev/null | |
| source "$all_venv/bin/activate" | |
| check_requirements requirements.txt | |
| ) | |
| if (( do_cleanup )); then | |
| rm -rf -- "$all_venv" | |
| fi | |
| check_convert_script examples/convert_legacy_llama.py | |
| for py in convert_*.py; do | |
| # skip convert_hf_to_gguf_update.py | |
| # TODO: the check is failing for some reason: | |
| # https://github.com/ggerganov/llama.cpp/actions/runs/8875330981/job/24364557177?pr=6920 | |
| [[ $py == convert_hf_to_gguf_update.py ]] && continue | |
| check_convert_script "$py" | |
| done | |
| info 'Done! No issues found.' | |