Instructions to use MrScratchcat/Aurelis-2B 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 MrScratchcat/Aurelis-2B 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 MrScratchcat/Aurelis-2B:Q8_0 # Run inference directly in the terminal: llama cli -hf MrScratchcat/Aurelis-2B:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf MrScratchcat/Aurelis-2B:Q8_0 # Run inference directly in the terminal: llama cli -hf MrScratchcat/Aurelis-2B: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 MrScratchcat/Aurelis-2B:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf MrScratchcat/Aurelis-2B:Q8_0
Use Docker
docker model run hf.co/MrScratchcat/Aurelis-2B:Q8_0
- Llama new
- LM Studio
- Jan
- Ollama
How to use MrScratchcat/Aurelis-2B with Ollama:
ollama run hf.co/MrScratchcat/Aurelis-2B:Q8_0
- Unsloth Desktop
- Pi
How to use MrScratchcat/Aurelis-2B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MrScratchcat/Aurelis-2B: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": "MrScratchcat/Aurelis-2B:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use MrScratchcat/Aurelis-2B with Docker Model Runner:
docker model run hf.co/MrScratchcat/Aurelis-2B:Q8_0
- Lemonade
How to use MrScratchcat/Aurelis-2B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MrScratchcat/Aurelis-2B:Q8_0
Run and chat with the model
lemonade run user.Aurelis-2B-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use MrScratchcat/Aurelis-2B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MrScratchcat/Aurelis-2B: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 MrScratchcat/Aurelis-2B:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use MrScratchcat/Aurelis-2B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf MrScratchcat/Aurelis-2B: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 "MrScratchcat/Aurelis-2B: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"
Download aurelis.py from MrScratchcat/Aurelis-2B: direct link, hf CLI and curl.
- Browser
- Download file 3.76 kB
-
https://huggingface.co/MrScratchcat/Aurelis-2B/resolve/main/aurelis.py
- Command line
-
hf download hf://MrScratchcat/Aurelis-2B/aurelis.py
-
curl -L -o aurelis.py https://huggingface.co/MrScratchcat/Aurelis-2B/resolve/main/aurelis.py
3.76 kB
| """Aurelis 2B with transformers: the same prompt and probabilities as Ollama's /v1/systemone endpoint. | |
| from aurelis import Aurelis | |
| decide = Aurelis("MrScratchcat/Aurelis-2B") | |
| decide("Customer: my card was charged twice for one order.", | |
| {"route": {"type": "choice", "instructions": "Which team handles this?", | |
| "criteria": {"billing": "Billing", "technical": "Technical support", "account": "Account"}}, | |
| "urgent": {"type": "noul", "instructions": "Is this urgent?"}}) | |
| # {"route": {"type": "choice", "choice": "billing", "probabilities": {...}}, "urgent": {"type": "noul", "noul": 0.71}} | |
| Each question is its own forward pass over one JSON prompt {"state", "question", "options"}, answered with the option's | |
| letter; the probability of an option is the softmax over the option letters at the answer position. A `noul` question | |
| is No (A) / Yes (B) and returns the probability of yes. At most 24 options per question, as in Ollama. | |
| """ | |
| import json | |
| import torch | |
| LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
| PREFIX, SUFFIX = "<|im_start|>user\n", "<|im_end|>\n<|im_start|>assistant\n<think>\n\n</think>\n\n" | |
| def _text(x): | |
| return x if isinstance(x, str) else json.dumps(x, separators=(",", ":"), ensure_ascii=False) | |
| class Aurelis: | |
| def __init__(self, repo="MrScratchcat/Aurelis-2B", device=None, dtype=torch.bfloat16): | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| self.tok = AutoTokenizer.from_pretrained(repo) | |
| device = device or ("cuda" if torch.cuda.is_available() else "cpu") | |
| self.model = AutoModelForCausalLM.from_pretrained(repo, dtype=dtype).to(device).eval() | |
| enc = lambda t: self.tok(t, add_special_tokens=False)["input_ids"] | |
| base = enc(PREFIX + "x" + SUFFIX) | |
| self.letters = [] | |
| for L in LETTERS: # the token each letter becomes right after the assistant prefix | |
| ids = enc(PREFIX + "x" + SUFFIX + L) | |
| if len(ids) != len(base) + 1 or ids[:len(base)] != base: raise RuntimeError(f"letter {L} is not one token after the prompt") | |
| self.letters.append(ids[-1]) | |
| def prompt(state, question, pairs): | |
| state = "(no state)" if state is None or (isinstance(state, str) and not state.strip()) or state in ({}, []) else _text(state) | |
| options = [{"label": LETTERS[i], "key": k, "description": d} for i, (k, d) in enumerate(pairs)] | |
| return PREFIX + json.dumps({"state": state, "question": _text(question), "options": options}, ensure_ascii=False) + SUFFIX | |
| def __call__(self, state, questions): | |
| out = {} | |
| for name, q in questions.items(): | |
| if q["type"] == "noul": pairs = [("false", "No"), ("true", "Yes")] | |
| else: pairs = [(k, k if d is None or (isinstance(d, str) and not d.strip()) else _text(d)) for k, d in q["criteria"].items()] | |
| if len(pairs) > 24: raise ValueError(f"{name}: at most 24 options per question") | |
| question = q.get("instructions") | |
| question = name if question is None or (isinstance(question, str) and not question.strip()) else question | |
| ids = self.tok(self.prompt(state, question, pairs), return_tensors="pt", add_special_tokens=False)["input_ids"].to(self.model.device) | |
| logits = self.model(input_ids=ids, logits_to_keep=1).logits[0, -1, self.letters[:len(pairs)]].float() | |
| p = torch.softmax(logits, -1).tolist() | |
| if q["type"] == "noul": out[name] = {"type": "noul", "noul": p[1]} | |
| else: | |
| probs = {k: v for (k, _), v in zip(pairs, p)} | |
| out[name] = {"type": "choice", "choice": max(probs, key=probs.get), "probabilities": probs} | |
| return out | |