Image-Text-to-Text
Transformers
Safetensors
GGUF
PyTorch
English
qwen3_5
singularity-layer
xmesh
decision-model
x402
tool-selection
llama.cpp
cpu
apple-silicon
windows
linux
mps
cuda
conversational
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"
Download sgl_systemone.py from singularity-layer/Singularity-xMESH-0.8B: direct link, hf CLI and curl.
- Browser
- Download file 5.01 kB
-
https://huggingface.co/singularity-layer/Singularity-xMESH-0.8B/resolve/main/sgl_systemone.py
- Command line
-
hf download hf://singularity-layer/Singularity-xMESH-0.8B/sgl_systemone.py
-
curl -L -o sgl_systemone.py https://huggingface.co/singularity-layer/Singularity-xMESH-0.8B/resolve/main/sgl_systemone.py
5.01 kB
| """System One response adapter for SGL Clef artifacts, including calibration.""" | |
| from __future__ import annotations | |
| from typing import Any | |
| def load_artifact(path: str, device: str = "cuda", dtype=None): | |
| """Load either an SGL adapter/head folder or a merged Clef release folder.""" | |
| import json | |
| from pathlib import Path | |
| import torch | |
| from safetensors.torch import load_file | |
| from transformers import AutoModelForMultimodalLM, AutoProcessor | |
| try: | |
| from joint_schema_model import ClefModel, JointSchemaHead, load_release_model | |
| except ImportError: | |
| from ._vendor.cloudflare_clef.joint_schema_model import ( | |
| ClefModel, | |
| JointSchemaHead, | |
| load_release_model, | |
| ) | |
| root = Path(path) | |
| runtime = json.loads((root / "sgl_decision_config.json").read_text(encoding="utf-8")) | |
| dtype = dtype or torch.bfloat16 | |
| if (root / "adapter_config.json").is_file(): | |
| from peft import PeftModel | |
| processor = AutoProcessor.from_pretrained(root) | |
| base = AutoModelForMultimodalLM.from_pretrained( | |
| runtime["base_model"], | |
| revision=runtime["base_revision"], | |
| dtype=dtype, | |
| device_map={"": device}, | |
| ) | |
| backbone = PeftModel.from_pretrained(base, root).eval() | |
| head_config = json.loads((root / "joint_head_config.json").read_text(encoding="utf-8")) | |
| head = JointSchemaHead(**head_config) | |
| head.load_state_dict(load_file(str(root / "joint_head.safetensors")), strict=True) | |
| model = ClefModel(backbone, head.to(device=device, dtype=dtype)).eval() | |
| else: | |
| if str(device) == "mps": | |
| # Accelerate's direct MPS device-map load can crash before the first | |
| # tensor is materialized. Load on CPU, then transfer explicitly. | |
| from transformers import Qwen3_5ForConditionalGeneration | |
| processor = AutoProcessor.from_pretrained(root) | |
| backbone = Qwen3_5ForConditionalGeneration.from_pretrained( | |
| root, dtype=dtype) | |
| backbone = backbone.to(device) | |
| backbone.config.use_cache = False | |
| head_config = json.loads( | |
| (root / "joint_head_config.json").read_text(encoding="utf-8")) | |
| head = JointSchemaHead(**head_config) | |
| head.load_state_dict( | |
| load_file(str(root / "joint_head.safetensors")), strict=True) | |
| model = ClefModel( | |
| backbone, head.to(device=device, dtype=dtype)).eval() | |
| else: | |
| model, processor = load_release_model(root, device=device, dtype=dtype) | |
| temperature = runtime.get("temperature_by_type", runtime.get("temperature", 1.0)) | |
| return model, processor, temperature | |
| def _temperature_for(question: dict, temperature: Any) -> float: | |
| if isinstance(temperature, dict): | |
| value = temperature.get(question.get("type"), 1.0) | |
| elif isinstance(temperature, (list, tuple)): | |
| order = {"choice": 0, "score": 1, "noul": 2} | |
| index = order.get(question.get("type")) | |
| value = temperature[index] if index is not None and index < len(temperature) else 1.0 | |
| else: | |
| value = temperature | |
| if isinstance(value, bool) or not isinstance(value, (int, float)) or value <= 0: | |
| raise ValueError("temperature must be positive") | |
| return float(value) | |
| def systemone(model: Any, processor: Any, request: dict, temperature: Any = 1.0, | |
| max_length: int = 16384) -> dict: | |
| import torch | |
| try: # artifact folder | |
| from joint_schema_model import collate_records, encode_record, systemone_answer | |
| except ImportError: # repository package | |
| from ._vendor.cloudflare_clef.joint_schema_model import ( | |
| collate_records, | |
| encode_record, | |
| systemone_answer, | |
| ) | |
| questions = request.get("questions") | |
| if not isinstance(request.get("model"), str) or "state" not in request: | |
| raise ValueError("model and state are required") | |
| if not isinstance(questions, dict) or not questions: | |
| raise ValueError("at least one question is required") | |
| encoded = encode_record( | |
| processor.tokenizer, request, max_length=max_length, processor=processor) | |
| device = next(model.parameters()).device | |
| with torch.inference_mode(): | |
| logits = model(collate_records( | |
| [encoded], processor.tokenizer.pad_token_id, device))[0] | |
| answers = {} | |
| for question, values in zip(encoded.questions, logits): | |
| question_temperature = _temperature_for( | |
| questions[question.question_id], temperature) | |
| probabilities = (values.float() / question_temperature).softmax(-1).tolist() | |
| answers[question.question_id] = systemone_answer( | |
| questions[question.question_id], dict(zip(question.option_ids, probabilities))) | |
| return { | |
| "model": request["model"], | |
| "answers": answers, | |
| "usage": {"input_tokens": len(encoded.input_ids), "output_tokens": 0}, | |
| } | |