Instructions to use singularity-layer/Singularity-xMESH-0.8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use singularity-layer/Singularity-xMESH-0.8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="singularity-layer/Singularity-xMESH-0.8B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("singularity-layer/Singularity-xMESH-0.8B") model = AutoModelForMultimodalLM.from_pretrained("singularity-layer/Singularity-xMESH-0.8B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use singularity-layer/Singularity-xMESH-0.8B 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 singularity-layer/Singularity-xMESH-0.8B:BF16 # Run inference directly in the terminal: llama cli -hf singularity-layer/Singularity-xMESH-0.8B:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf singularity-layer/Singularity-xMESH-0.8B:BF16 # Run inference directly in the terminal: llama cli -hf singularity-layer/Singularity-xMESH-0.8B:BF16
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 singularity-layer/Singularity-xMESH-0.8B:BF16 # Run inference directly in the terminal: ./llama-cli -hf singularity-layer/Singularity-xMESH-0.8B:BF16
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 singularity-layer/Singularity-xMESH-0.8B:BF16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf singularity-layer/Singularity-xMESH-0.8B:BF16
Use Docker
docker model run hf.co/singularity-layer/Singularity-xMESH-0.8B:BF16
- LM Studio
- Jan
- vLLM
How to use singularity-layer/Singularity-xMESH-0.8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "singularity-layer/Singularity-xMESH-0.8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "singularity-layer/Singularity-xMESH-0.8B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/singularity-layer/Singularity-xMESH-0.8B:BF16
- SGLang
How to use singularity-layer/Singularity-xMESH-0.8B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "singularity-layer/Singularity-xMESH-0.8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "singularity-layer/Singularity-xMESH-0.8B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "singularity-layer/Singularity-xMESH-0.8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "singularity-layer/Singularity-xMESH-0.8B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Ollama
How to use singularity-layer/Singularity-xMESH-0.8B with Ollama:
ollama run hf.co/singularity-layer/Singularity-xMESH-0.8B:BF16
- Unsloth Desktop
- Pi
How to use singularity-layer/Singularity-xMESH-0.8B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf singularity-layer/Singularity-xMESH-0.8B:BF16
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": "singularity-layer/Singularity-xMESH-0.8B:BF16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use singularity-layer/Singularity-xMESH-0.8B with Docker Model Runner:
docker model run hf.co/singularity-layer/Singularity-xMESH-0.8B:BF16
- Lemonade
How to use singularity-layer/Singularity-xMESH-0.8B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull singularity-layer/Singularity-xMESH-0.8B:BF16
Run and chat with the model
lemonade run user.Singularity-xMESH-0.8B-BF16
List all available models
lemonade list
- Hermes Agent
How to use singularity-layer/Singularity-xMESH-0.8B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf singularity-layer/Singularity-xMESH-0.8B:BF16
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 singularity-layer/Singularity-xMESH-0.8B:BF16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use singularity-layer/Singularity-xMESH-0.8B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf singularity-layer/Singularity-xMESH-0.8B:BF16
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 "singularity-layer/Singularity-xMESH-0.8B:BF16" \ --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"
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("singularity-layer/Singularity-xMESH-0.8B")
model = AutoModelForMultimodalLM.from_pretrained("singularity-layer/Singularity-xMESH-0.8B", device_map="auto")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
inputs = processor.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Singularity xMESH 0.8B
x402 Multi-Endpoint Selection Head
Trained and evaluated with Singularity Training Lab.
Release article · Singularity Layer
Singularity xMESH 0.8B is a compact decision model for selecting services and composing constrained multi-step x402 flows. This repository contains the complete standalone model, its calibrated joint decision head, and the deterministic xMESH policy. No separate base-model download is required.
Intended behavior
Input: an intent, hard constraints, and a small candidate set retrieved from a current x402 catalog. The validated runtime contract is 2,048 tokens.
Output: candidate selection or abstention, calibrated confidence, approval requirement, network compatibility, and cost level. Deterministic policy validates stage gates and flow feasibility before any paid request. Service choices remain model decisions.
Training data
The general decision warm-up used licensed rows from MaziyarPanahi/AgentToolDecisions-180K. That dataset retains mixed CC BY 4.0, Apache-2.0, and MIT source terms per row; see THIRD_PARTY_NOTICES.md. Singularity-curated x402 rows supplied the routing specialization. Frozen evaluation cases and resources were excluded from training.
Hardware compatibility
| Hardware | Status |
|---|---|
| Apple silicon MPS | Verified on an M4 with 16 GB unified memory |
| CPU | Verified; portable but slower |
| llama.cpp Metal | Verified with BF16 full offload on an Apple M4: 959/960 frozen-suite decisions match CPU (one near-tie). Q8 also passes 960/960 |
| llama.cpp Windows/Linux x64 CPU | Verified; native canaries passed 9/9 expected decisions on both platforms |
| llama.cpp Vulkan on NVIDIA | Verified on an RTX A4000: 960/960 frozen-suite decisions match CPU, 0.31 s median per request |
| NVIDIA CUDA | PyTorch runtime support; the llama.cpp CUDA build is not yet verified |
| AMD and Intel GPUs | Not verified; Singularity Node runs xMESH on CPU there |
Singularity Node v1.10.4 and later choose the path automatically: full GPU offload on Apple silicon and on NVIDIA with the Vulkan build, CPU everywhere else. Full results: ACCELERATOR_PARITY.json.
The checkpoint contains 873M BF16 parameters. An 8 GB system is the practical minimum; 16 GB is recommended for comfortable local loading and inference.
Portable GGUF runtime
Singularity-xMESH-0.8B-BF16.gguf is the universal Singularity Node artifact. It is 1,571,529,600 bytes with SHA-256 9f4c08f19c4d203059bc74ed2754e800ec472d7276d8ddb2321480e86d392fff and requires llama.cpp b11719 or newer for native Clef /v1/systemone support.
Singularity-xMESH-0.8B-Q8_0.gguf is an optional 841,069,440-byte accelerated artifact with SHA-256 41b36270b67f6c595e98cf4f29d6a0d13f0c19daa37b75741cd8296e2729fd75. It preserved all 960 decisions across the frozen 80-case Metal export-parity run, but llama.cpp b11719 crashes while initializing this quantized Clef architecture on CPU. Singularity Node therefore uses BF16 for its cross-platform contract. Q4_K_M was rejected because it changed 16 decisions and preserved only 65 of 80 complete flows.
Frozen x402 regression evaluation
The standalone export was fixed before one evaluation on the existing frozen 80-case x402 suite. No weights, prompts, or policy rules were changed after seeing these results.
| Evaluation, 80 cases | xMESH standalone | Jev | Laya |
|---|---|---|---|
| Complete-flow exact match | 80.0% | 11.25% | 0.0% |
| Stage-gate accuracy | 96.25% | 86.5% | 78.5% |
| Active-service accuracy | 97.5% | 100.0% | 85.63% |
| Global-decision accuracy | 96.25% | 37.5% | 35.63% |
| Executed cost regret | $0.00175 | $0.00000 | $0.00358 |
| Post-policy violations | 0 | — | — |
Jev is a hosted API and Laya used a different local runtime, so latency is not a hardware-equivalent comparison. The standalone CPU validation measured 6.45 seconds median per full multi-field flow on an Apple M4. Optimized serving runtimes can be substantially faster.
General typed-decision evaluation
This is a boundary test, not the model's specialization. xMESH was evaluated zero-shot on LocalLLaMA/typed-decisions revision 7189f46b02248bd2569df7325c9df8e3b24e90a7, complete all/test split: 400 cases and 2,000 decisions.
| Model | Condition | Accuracy | Soft accuracy | Brier ↓ | ECE ↓ | Score MAE ↓ |
|---|---|---|---|---|---|---|
| xMESH 0.8B | zero-shot Q8 | 0.478 | 0.415 | 0.409 | 0.293 | 0.642 |
| Laya | base checkpoint, published | 0.362 | 0.331 | 0.315 | 0.174 | 0.694 |
| Laya typed-decisions | trained on this benchmark's train split, published | 0.766 | 0.471 | 0.061 | 0.213 | 0.242 |
| Jev 1.13 | published | 0.727 | 0.580 | 0.148 | 0.144 | 0.391 |
xMESH beats base Laya on this suite, but it does not beat Jev or the benchmark-specific Laya fine-tune. Accuracy by xMESH workflow was 0.266 agent-trace observability, 0.578 customer service, 0.492 invoice processing, and 0.574 security incidents.
A seeded option-order permutation changed 0 of 600 choice answers and produced zero probability drift because the Clef runtime canonicalizes option identifiers before inference.
On a short fixed state with identical three-option questions, Q8 llama.cpp on an Apple M4 measured 168 ms p50 for one question, 448 ms for five, and 847 ms for ten. Twenty and fifty questions exceeded this release's validated 2,048-token context; they are not advertised as supported.
Laya and Jev comparison rows above are figures published by the Laya benchmark page. They were not rerun in the xMESH environment.
Run on Apple silicon
Validated with Python 3.12 on an Apple M4 with 16 GB unified memory.
python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python examples/inference.py --request examples/request.json --device mps
Use --device cpu when MPS is unavailable. The request must contain state and questions; examples/request.json shows the typed contract.
Run with llama.cpp
llama-server \
-m Singularity-xMESH-0.8B-BF16.gguf \
--host 127.0.0.1 --port 8081 \
-c 2048 -b 2048 -ub 2048 --parallel 1 -ngl 0
curl http://127.0.0.1:8081/v1/systemone \
-H 'Content-Type: application/json' \
--data-binary @examples/request.json
-ngl 0 is the portable CPU setting. On Apple silicon (Metal) or an NVIDIA GPU with the Vulkan build, -ngl 99 is verified to give the same decisions; see ACCELERATOR_PARITY.json.
Safety boundary
xMESH is an advisory router. It must not receive wallet secrets, construct signed payments, bypass approval, invent endpoints, or execute arbitrary URLs. Runtime code must restrict choices to retrieved candidate IDs and enforce budgets, networks, schemas, and approval rules independently.
Limitations
- Specialized for x402 service routing; it is not a general chat model.
- It does not retrieve services, verify providers, quote payments, or execute requests.
- Service-selection accuracy is strong but not perfect.
- Confidence is advisory and does not replace deterministic policy checks.
- The validated context contract is 2,048 tokens.
License
The model and Singularity runtime files are Apache-2.0. Qwen and Cloudflare Clef attribution is included in THIRD_PARTY_NOTICES.md.
- Downloads last month
- 195
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="singularity-layer/Singularity-xMESH-0.8B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)