Text Generation
GGUF
llama.cpp
pocketpal
on-device
Mixture of Experts
multilingual
quantization
distillation
1-bit
2-bit
3-bit
conversational
Instructions to use RegalInvader/Marco-Nano-Instruct-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 RegalInvader/Marco-Nano-Instruct-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 RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0 # Run inference directly in the terminal: llama cli -hf RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0 # Run inference directly in the terminal: llama cli -hf RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_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 RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0
Use Docker
docker model run hf.co/RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0
- Llama new
- LM Studio
- Jan
- vLLM
How to use RegalInvader/Marco-Nano-Instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RegalInvader/Marco-Nano-Instruct-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RegalInvader/Marco-Nano-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0
- Ollama
How to use RegalInvader/Marco-Nano-Instruct-GGUF with Ollama:
ollama run hf.co/RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0
- Unsloth Desktop
- Pi
How to use RegalInvader/Marco-Nano-Instruct-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_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:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use RegalInvader/Marco-Nano-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0
- Lemonade
How to use RegalInvader/Marco-Nano-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0
Run and chat with the model
lemonade run user.Marco-Nano-Instruct-GGUF-TQ1_0
List all available models
lemonade list
- Hermes Agent
How to use RegalInvader/Marco-Nano-Instruct-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 RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_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:8080/v1 hermes config set model.default RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use RegalInvader/Marco-Nano-Instruct-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_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:8080/v1 \ --custom-model-id "RegalInvader/Marco-Nano-Instruct-GGUF:TQ1_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 code/scripts/sampling_check.py from RegalInvader/Marco-Nano-Instruct-GGUF: direct link, hf CLI and curl.
- Browser
- Download file 5.25 kB
-
https://huggingface.co/RegalInvader/Marco-Nano-Instruct-GGUF/resolve/main/code/scripts/sampling_check.py
- Command line
-
hf download hf://RegalInvader/Marco-Nano-Instruct-GGUF/code/scripts/sampling_check.py
-
curl -L -o sampling_check.py https://huggingface.co/RegalInvader/Marco-Nano-Instruct-GGUF/resolve/main/code/scripts/sampling_check.py
5.25 kB
| #!/usr/bin/env python3 | |
| """Loop check of the release files under candidate chat settings (28 Oct, for the card and a PocketPal Pal). | |
| 72 prompts shaped like the 19 Oct router sweep's (its loop-prone file, fp8check/aya_loopy4.jsonl, is gone, so the | |
| 40 ur/tr/bn/ne prompts are drawn from bench/aya_marco29_prompts.jsonl: same languages, not the same prompts), plus 16 | |
| in other languages and the 16 JSON prompts; each file | |
| through its own llama-server on a spare port (compare_quality.serve: refuses an occupied port and checks /props names | |
| the file; never the router), thinking off, the same seed per prompt. A loop is an output that hit max_tokens with a | |
| 16-gram repeat share >= 0.5 over its last 600 tokens (the sweep's rule). | |
| python scripts/sampling_check.py --model NAME=PATH.gguf ... [--ngl 0] [--port 18196] | |
| """ | |
| from __future__ import annotations | |
| import argparse | |
| import random | |
| import json | |
| import sys | |
| from concurrent.futures import ThreadPoolExecutor | |
| from pathlib import Path | |
| sys.path.insert(0, str(Path(__file__).resolve().parent)) | |
| import compare_quality as cq # noqa: E402 | |
| from fp8_check import loop_score # noqa: E402 | |
| from router_sampling_sweep import CONFIGS, DATA # noqa: E402 | |
| REPO = Path(__file__).resolve().parents[1] | |
| CHECK = ["spec_t0.7_p0.9", "t0.7_rep1.1", "t0.3_p0.9"] # a default-like setting, the candidate, a low temperature | |
| def prompts() -> list[dict]: | |
| pool = [json.loads(line) for line in open(DATA / "bench/aya_marco29_prompts.jsonl")] | |
| rng = random.Random(0) | |
| out = [] | |
| for lang in ("ur", "tr", "bn", "ne"): | |
| out += rng.sample([r for r in pool if r["language"] == lang], 10) | |
| for lang in ("en", "zh", "de", "ar", "ja", "ru", "es", "ko"): | |
| out += rng.sample([r for r in pool if r["language"] == lang], 2) | |
| out += [json.loads(line) for line in open(DATA / "bench/json_prompts.jsonl")] | |
| return out | |
| def group(i: int) -> str: | |
| return "loop-prone" if i < 40 else "json" if i >= 56 else "other" | |
| def main() -> None: | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--server", default="/path/to/llama.cpp/build-ptq/bin/llama-server") | |
| ap.add_argument("--model", action="append", required=True, help="NAME=PATH.gguf") | |
| ap.add_argument("--out-dir", type=Path, default=REPO / "reports" / "sampling_check") | |
| ap.add_argument("--port", type=int, default=18196) | |
| ap.add_argument("--ngl", default="0") | |
| ap.add_argument("--max-tokens", type=int, default=1536) | |
| ap.add_argument("--workers", type=int, default=8) | |
| a = ap.parse_args() | |
| from tokenizers import Tokenizer | |
| tok = Tokenizer.from_file(str(DATA / "models/Marco-Nano-Instruct/tokenizer.json")) | |
| ps = prompts() | |
| a.out_dir.mkdir(parents=True, exist_ok=True) | |
| for spec in a.model: | |
| name, gguf = spec.split("=", 1) | |
| out = a.out_dir / f"{name}.jsonl" | |
| done = {(r["config"], r["i"]) for r in map(json.loads, out.open())} if out.exists() else set() | |
| todo = [(c, i, r) for c in CHECK for i, r in enumerate(ps) if (c, i) not in done] | |
| if todo: | |
| p = cq.serve(a.server, gguf, a.port, a.ngl, a.out_dir / f"{name}.server.log") | |
| try: | |
| def run(t): | |
| c, i, r = t | |
| body = {"messages": [{"role": "user", "content": r["text"]}], "max_tokens": a.max_tokens, | |
| "seed": 1000 + i, "chat_template_kwargs": {"enable_thinking": False}, **CONFIGS[c]} | |
| try: | |
| return t, cq.post(a.port, "/v1/chat/completions", body) | |
| except Exception as e: # noqa: BLE001 — a server error (e.g. a reply cut inside a UTF-8 character) | |
| return t, {"choices": [{"finish_reason": "error", "message": {"content": f"[{e}]"}}]} | |
| with ThreadPoolExecutor(a.workers) as ex, out.open("a") as f: | |
| for (c, i, r), res in ex.map(run, todo): | |
| ch = res["choices"][0] | |
| text = ch["message"].get("content") or "" | |
| ids = tok.encode(text, add_special_tokens=False).ids | |
| f.write(json.dumps({"config": c, "i": i, "lang": r["language"], "finish": ch["finish_reason"], | |
| "n_tokens": len(ids), "loop_score": round(loop_score(ids), 3), "text": text}, | |
| ensure_ascii=False) + "\n") | |
| f.flush() | |
| finally: | |
| p.terminate() | |
| p.wait(60) | |
| rows = [json.loads(line) for line in out.open()] | |
| summ = {} | |
| for c in CHECK: | |
| for g in ("loop-prone", "other", "json"): | |
| rs = [r for r in rows if r["config"] == c and group(r["i"]) == g] | |
| cut = sum(r["finish"] == "length" for r in rs) | |
| loops = sum(r["finish"] == "length" and r["loop_score"] >= 0.5 for r in rs) | |
| summ[f"{c} / {g}"] = {"prompts": len(rs), "cut": cut, "loops": loops} | |
| (a.out_dir / f"{name}.summary.json").write_text(json.dumps(summ, indent=1)) | |
| print(name, json.dumps({k: f"{v['cut']} cut / {v['loops']} loops of {v['prompts']}" for k, v in summ.items()}), | |
| flush=True) | |
| if __name__ == "__main__": | |
| main() | |