GGUF
English
llama.cpp
decision-model
system-one
typed-decisions
calibrated-probabilities
ainode
conversational
Instructions to use frontier-infra/jebadiah-4b-v2-GGUF 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 frontier-infra/jebadiah-4b-v2-GGUF 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 frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
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 frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
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 frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
Use Docker
docker model run hf.co/frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use frontier-infra/jebadiah-4b-v2-GGUF with Ollama:
ollama run hf.co/frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use frontier-infra/jebadiah-4b-v2-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
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:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use frontier-infra/jebadiah-4b-v2-GGUF with Docker Model Runner:
docker model run hf.co/frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
- Lemonade
How to use frontier-infra/jebadiah-4b-v2-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.jebadiah-4b-v2-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use frontier-infra/jebadiah-4b-v2-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
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:8080/v1 hermes config set model.default frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use frontier-infra/jebadiah-4b-v2-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M
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:8080/v1 \ --custom-model-id "frontier-infra/jebadiah-4b-v2-GGUF:Q4_K_M" \ --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"
Download scripts/decide_gguf.py from frontier-infra/jebadiah-4b-v2-GGUF: direct link, hf CLI and curl.
- Browser
- Download file 4.77 kB
-
https://huggingface.co/frontier-infra/jebadiah-4b-v2-GGUF/resolve/main/scripts/decide_gguf.py
- Command line
-
hf download hf://frontier-infra/jebadiah-4b-v2-GGUF/scripts/decide_gguf.py
-
curl -L -o decide_gguf.py https://huggingface.co/frontier-infra/jebadiah-4b-v2-GGUF/resolve/main/scripts/decide_gguf.py
4.77 kB
| """Run a Jebadiah GGUF through llama.cpp's llama-server and print typed answers. | |
| The prompt is rendered in Python exactly as AINode's /v1/systemone does (jebadiah_prompt.py, the chat | |
| template with thinking off) and the rendered text goes to llama-server's raw /completion endpoint, so the | |
| server's own chat template never touches it. Nothing is generated: the answer is read off the log | |
| probabilities of the single-token option labels ("A", "B", ...) at the answer position, renormalised over | |
| those labels, with the model's per-type temperature from temperatures.json applied. | |
| llama-server -m jebadiah-27b-Q4_K_M.gguf -c 4096 -np 1 --port 8080 | |
| python scripts/decide_gguf.py --server http://127.0.0.1:8080 --request scripts/example-request.json | |
| --tokenizer is a folder (or Hub repo id) with tokenizer.json, tokenizer_config.json and chat_template.jinja; | |
| this repository ships them, so the default is the folder above scripts/. Needs `transformers` (the tokenizer | |
| only, no torch) and nothing else outside the standard library. | |
| """ | |
| from __future__ import annotations | |
| import argparse | |
| import json | |
| import math | |
| import os | |
| import sys | |
| import urllib.request | |
| HERE = os.path.dirname(os.path.abspath(__file__)) | |
| sys.path.insert(0, HERE) | |
| from jebadiah_prompt import Renderer, answer_from_probs # noqa: E402 | |
| def load_renderer(tokenizer: str, max_tokens: int = 2048) -> Renderer: | |
| from transformers import AutoTokenizer | |
| tok = AutoTokenizer.from_pretrained(tokenizer) | |
| if tok.pad_token_id is None: | |
| tok.pad_token = tok.eos_token | |
| return Renderer(tok, max_tokens) | |
| def read_temperatures(path: str | None) -> dict: | |
| if not path or not os.path.exists(path): | |
| return {} | |
| return {k: float(v) for k, v in json.load(open(path))["temperatures"].items()} | |
| def post(server: str, path: str, body: dict, timeout: float = 900) -> dict: | |
| req = urllib.request.Request(server.rstrip("/") + path, data=json.dumps(body).encode(), | |
| headers={"Content-Type": "application/json"}) | |
| with urllib.request.urlopen(req, timeout=timeout) as r: | |
| return json.loads(r.read()) | |
| def label_logprobs(server: str, prompt: str, cand_ids: list[int], n_probs: int = 1000) -> tuple[list[float], int]: | |
| """Log probabilities (full-vocab softmax, before any sampling) of each candidate token at the position | |
| right after `prompt`. A label outside the top n_probs gets the smallest returned value, an upper bound | |
| that is already negligible after renormalisation. Returns (logprobs, number of labels not returned).""" | |
| r = post(server, "/completion", {"prompt": prompt, "n_predict": 1, "n_probs": n_probs, | |
| "post_sampling_probs": False, "cache_prompt": False, | |
| "temperature": 0.0}) | |
| top = r["completion_probabilities"][0]["top_logprobs"] | |
| lp = {t["id"]: t["logprob"] for t in top} | |
| floor = min(lp.values()) | |
| return [lp.get(c, floor) for c in cand_ids], sum(1 for c in cand_ids if c not in lp) | |
| def option_probs(logprobs: list[float], temperature: float = 1.0) -> list[float]: | |
| """Softmax over the labels only, after dividing by the temperature. log p = logit - logsumexp(all | |
| logits), and the constant cancels in the softmax, so this equals softmax(logits[labels] / T).""" | |
| z = [x / temperature for x in logprobs] | |
| m = max(z) | |
| e = [math.exp(x - m) for x in z] | |
| s = sum(e) | |
| return [x / s for x in e] | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--server", default="http://127.0.0.1:8080", help="a running llama-server with a Jebadiah GGUF") | |
| ap.add_argument("--request", required=True, help="JSON file: {state, questions: {id: {type, instructions, criteria}}}") | |
| ap.add_argument("--tokenizer", default=os.path.dirname(HERE), help="folder or Hub repo id with the tokenizer and chat template") | |
| ap.add_argument("--temperatures", default=os.path.join(os.path.dirname(HERE), "temperatures.json")) | |
| ap.add_argument("--no-temperatures", action="store_true", help="raw probabilities, as the served route returns today") | |
| ap.add_argument("--n-probs", type=int, default=1000) | |
| a = ap.parse_args() | |
| req = json.load(open(a.request)) | |
| renderer = load_renderer(a.tokenizer) | |
| temps = {} if a.no_temperatures else read_temperatures(a.temperatures) | |
| out = {"temperatures_applied": temps, "answers": {}} | |
| for qid, q in req["questions"].items(): | |
| rd = renderer.render(req["state"], q) | |
| lps, _ = label_logprobs(a.server, rd.prompt, rd.cand_ids, a.n_probs) | |
| probs = option_probs(lps, float(temps.get(q["type"], 1.0))) | |
| out["answers"][qid] = answer_from_probs(q, rd.keys, probs) | |
| print(json.dumps(out, indent=1)) | |
| if __name__ == "__main__": | |
| main() | |