Instructions to use andyz321/bio-expert 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 andyz321/bio-expert 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 andyz321/bio-expert:Q8_0 # Run inference directly in the terminal: llama cli -hf andyz321/bio-expert:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf andyz321/bio-expert:Q8_0 # Run inference directly in the terminal: llama cli -hf andyz321/bio-expert:Q8_0
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 andyz321/bio-expert:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf andyz321/bio-expert:Q8_0
Use Docker
docker model run hf.co/andyz321/bio-expert:Q8_0
- Llama new
- LM Studio
- Jan
- Ollama
How to use andyz321/bio-expert with Ollama:
ollama run hf.co/andyz321/bio-expert:Q8_0
- Unsloth Desktop
- Pi
How to use andyz321/bio-expert with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf andyz321/bio-expert:Q8_0
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "andyz321/bio-expert:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use andyz321/bio-expert with Docker Model Runner:
docker model run hf.co/andyz321/bio-expert:Q8_0
- Lemonade
How to use andyz321/bio-expert with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull andyz321/bio-expert:Q8_0
Run and chat with the model
lemonade run user.bio-expert-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use andyz321/bio-expert with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf andyz321/bio-expert:Q8_0
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default andyz321/bio-expert:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use andyz321/bio-expert with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf andyz321/bio-expert:Q8_0
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "andyz321/bio-expert:Q8_0" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload scripts/write_modelfile.py with huggingface_hub
Browse files- scripts/write_modelfile.py +86 -0
scripts/write_modelfile.py
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -*- coding: utf-8 -*-
|
| 2 |
+
"""Write Modelfile as UTF-8 without BOM (PS 5.1 Set-Content corrupts CJK).
|
| 3 |
+
|
| 4 |
+
Single source of truth for the ollama model definition.
|
| 5 |
+
|
| 6 |
+
ollama 0.40 has no `DESCRIPTION` Modelfile command (only: from, license,
|
| 7 |
+
template, system, adapter, draft, renderer, parser, parameter, message,
|
| 8 |
+
requires, capability). The manifest's only free-text slot is the
|
| 9 |
+
`ollama.image.license` layer, so --license-mode decides what goes in it:
|
| 10 |
+
|
| 11 |
+
apache : license text only -> Modelfile
|
| 12 |
+
card : full model card -> Modelfile.card
|
| 13 |
+
|
| 14 |
+
Usage:
|
| 15 |
+
py -3 scripts/write_modelfile.py [--license-mode apache|card]
|
| 16 |
+
"""
|
| 17 |
+
import argparse
|
| 18 |
+
import sys
|
| 19 |
+
from pathlib import Path
|
| 20 |
+
|
| 21 |
+
ROOT = Path(r"E:\AI edge\bio-enhance")
|
| 22 |
+
sys.path.insert(0, str(ROOT / "scripts"))
|
| 23 |
+
from prompt import SYSTEM_PROMPT # noqa: E402
|
| 24 |
+
|
| 25 |
+
Q = '"' * 3
|
| 26 |
+
|
| 27 |
+
# Preferred GGUF (round3 / r3). It may be a symlink into a detached volume,
|
| 28 |
+
# so fall back to the byte-identical blob in the ollama blob store.
|
| 29 |
+
CANDIDATES = [
|
| 30 |
+
ROOT / "output" / "bio-expert-q8-r3.gguf",
|
| 31 |
+
Path(r"D:\ollama_data\blobs\sha256-569155cf3edc5c144201fb78352380dfa9a6b3904c4609bb48ade1a16c7920bd"),
|
| 32 |
+
]
|
| 33 |
+
|
| 34 |
+
APACHE = "Apache-2.0"
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def pick_gguf():
|
| 38 |
+
for c in CANDIDATES:
|
| 39 |
+
try:
|
| 40 |
+
if c.exists() and c.stat().st_size > 1_000_000_000:
|
| 41 |
+
with open(c, "rb") as fh:
|
| 42 |
+
if fh.read(4) == b"GGUF":
|
| 43 |
+
return c
|
| 44 |
+
except OSError:
|
| 45 |
+
continue
|
| 46 |
+
raise SystemExit("no usable GGUF found in: "
|
| 47 |
+
+ ", ".join(str(c) for c in CANDIDATES))
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def build(gguf, license_text, out_path):
|
| 51 |
+
card = (ROOT / "model_card.md").read_text(encoding="utf-8").strip()
|
| 52 |
+
mf = "\n".join([
|
| 53 |
+
"FROM " + str(gguf),
|
| 54 |
+
"",
|
| 55 |
+
"SYSTEM " + Q + SYSTEM_PROMPT + Q,
|
| 56 |
+
"",
|
| 57 |
+
"LICENSE " + Q + license_text + Q,
|
| 58 |
+
"",
|
| 59 |
+
"PARAMETER temperature 0.7",
|
| 60 |
+
"PARAMETER top_p 0.9",
|
| 61 |
+
"PARAMETER num_ctx 32768",
|
| 62 |
+
"PARAMETER repeat_penalty 1.1",
|
| 63 |
+
"",
|
| 64 |
+
])
|
| 65 |
+
out_path.write_text(mf, encoding="utf-8") # no BOM
|
| 66 |
+
raw = out_path.read_bytes()
|
| 67 |
+
print(f"wrote {out_path}")
|
| 68 |
+
print(" bytes:", len(raw), " BOM:", raw[:3] == b"\xef\xbb\xbf")
|
| 69 |
+
print(" FROM:", gguf)
|
| 70 |
+
print(" license chars:", len(license_text))
|
| 71 |
+
print(" CJK ok:", "合曜生物" in raw.decode("utf-8"))
|
| 72 |
+
return card
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
if __name__ == "__main__":
|
| 76 |
+
ap = argparse.ArgumentParser()
|
| 77 |
+
ap.add_argument("--license-mode", choices=["apache", "card"], default="apache")
|
| 78 |
+
args = ap.parse_args()
|
| 79 |
+
|
| 80 |
+
gguf = pick_gguf()
|
| 81 |
+
card = (ROOT / "model_card.md").read_text(encoding="utf-8").strip()
|
| 82 |
+
|
| 83 |
+
if args.license_mode == "card":
|
| 84 |
+
build(gguf, card, ROOT / "Modelfile.card")
|
| 85 |
+
else:
|
| 86 |
+
build(gguf, APACHE, ROOT / "Modelfile")
|