No matches. Try a model format, tool name or error.
On this page
Run a verified GGUF with the OpenAI client
Download a 522 MB Qwen2.5 model, have hbay check its SHA-256, and ask it a question on your machine. Allow about 1 GB of free disk space.
Install
Apple silicon Mac or Linux
Activate a Python 3.9 or later virtual environment. You also need curl and OpenSSL 3.
curl -fsSL 'https://huggingbay.xyz/cli/install.sh' | RELEASE_BASE_URL='https://storage.googleapis.com/hb-desktop-releases-barneyserver/hbay/hbay-0.2.8-native-c49a56a58-20261128' sh
export PATH="${HBAY_BIN_DIR:-$HOME/.local/bin}:$PATH"
hbay --version
python -m pip install openai==3.60.0
Windows x86-64
Download the Windows ZIP and check this SHA-256 before extracting it. Add the extracted folder containing hbay.exe to PATH and run hbay --version. Use Python 3.9 or later.
Download hbay 0.2.8 for Windows
(Get-FileHash .\hbay-windows-x86_64.zip -Algorithm SHA256).Hash
# Expected: 60D250FE2C26622948939FD19F2A83EC7C9A3085913F26A1827AC61F159E93D0
py -3 -m pip install openai==3.60.0Download, serve and ask
Save these five lines as first_model.py and run python first_model.py (Windows: py -3 first_model.py).
import json, subprocess as sp; from pathlib import Path; from openai import OpenAI
model = json.loads(sp.check_output(["hbay", "--data-dir", ".hbay-demo", "download", "hf-model-qwen-qwen2-5-0-5b-instruct-gguf", "qwen2.5-0.5b-instruct-q5_k_m.gguf", "--max-size", "550MB", "--json"]))
server = sp.Popen(["hbay", "--data-dir", ".hbay-demo", "serve", model["path"], "--sha256", model["sha256"], "--port", "18080", "--json"], stdout=sp.PIPE, text=True)
try: ready = json.loads(server.stdout.readline()); client = OpenAI(base_url=f"http://127.0.0.1:{ready['port']}/v1", api_key=Path(ready["tokenFile"]).read_text().strip(), timeout=60); print(client.chat.completions.create(model=ready["model"], messages=[{"role": "user", "content": "What is 2 + 2? Give a short answer."}], max_completion_tokens=64).choices[0].message.content)
finally: server.terminate(); server.wait(timeout=10)hbay keeps the model in .hbay-demo. It binds to 127.0.0.1, and the script reads the local token from hbay’s private file. You can remove the demo directory when you finish.