Instructions to use Singularity87/Cityscapes-Qwen3.5-4B-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 Singularity87/Cityscapes-Qwen3.5-4B-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 Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Singularity87/Cityscapes-Qwen3.5-4B-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 Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Singularity87/Cityscapes-Qwen3.5-4B-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 Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Singularity87/Cityscapes-Qwen3.5-4B-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 Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Singularity87/Cityscapes-Qwen3.5-4B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Singularity87/Cityscapes-Qwen3.5-4B-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": "Singularity87/Cityscapes-Qwen3.5-4B-GGUF", "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/Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M
- Ollama
How to use Singularity87/Cityscapes-Qwen3.5-4B-GGUF with Ollama:
ollama run hf.co/Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use Singularity87/Cityscapes-Qwen3.5-4B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Singularity87/Cityscapes-Qwen3.5-4B-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": "Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Singularity87/Cityscapes-Qwen3.5-4B-GGUF with Docker Model Runner:
docker model run hf.co/Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M
- Lemonade
How to use Singularity87/Cityscapes-Qwen3.5-4B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Cityscapes-Qwen3.5-4B-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Singularity87/Cityscapes-Qwen3.5-4B-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 Singularity87/Cityscapes-Qwen3.5-4B-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 Singularity87/Cityscapes-Qwen3.5-4B-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Singularity87/Cityscapes-Qwen3.5-4B-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Singularity87/Cityscapes-Qwen3.5-4B-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 "Singularity87/Cityscapes-Qwen3.5-4B-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"
Cityscapes Qwen3.5 4B GGUF
llama.cpp exports of a Qwen3.5-4B vision-language model fine-tuned for a fixed Cityscapes structured JSON task. The release includes five text-model precisions and three multimodal projector precisions.
This is a full language-and-vision LoRA merge. Do not add the original adapter
with --lora: its language and vision changes are already in these files.
llama.cpp quick start
Example using the recommended Q4_K_M text model and BF16 mmproj:
llama-server \
-m Cityscapes-Qwen3.5-4B-Q4_K_M.gguf \
--mmproj mmproj-Cityscapes-Qwen3.5-4B-BF16.gguf \
--ctx-size 4096 \
--parallel 1 \
-ngl 99 \
--jinja \
--no-webui \
--host 127.0.0.1 \
--port 8080
For the exact precision used in the reported benchmark, replace the text model
with Cityscapes-Qwen3.5-4B-BF16.gguf.
The server accepts OpenAI-compatible multimodal requests at
/v1/chat/completions. Put the image before the text and use a schema-explicit
prompt:
import base64
import mimetypes
import requests
image_path = "frankfurt_000000_000294_leftImg8bit.png"
mime = mimetypes.guess_type(image_path)[0] or "image/png"
with open(image_path, "rb") as handle:
image_url = f"data:{mime};base64,{base64.b64encode(handle.read()).decode()}"
system_prompt = """You extract structured Cityscapes facts from an image.
Return raw JSON only with exactly the top-level keys surfaces, objects, relations.
surfaces contains exactly road and sidewalk with present and zones.
objects contains exactly person, rider, car, truck, bus, train, motorcycle,
bicycle, traffic_light, traffic_sign, pole with present, count, zones.
Zones use a 3x3 grid: upper|middle|lower combined with left|center|right.
Counts are 0, 1, 2-3, 4-7, 8+, or unknown. An absent object uses false, 0, [].
Relations contain subject, relation=on, and object=road|sidewalk."""
response = requests.post(
"http://127.0.0.1:8080/v1/chat/completions",
json={
"messages": [
{"role": "system", "content": system_prompt},
{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": image_url}},
{
"type": "text",
"text": (
"Analyze this urban road image and return only one "
"completed JSON object in the required schema."
),
},
],
},
],
"temperature": 0,
"seed": 3407,
"max_tokens": 1024,
"chat_template_kwargs": {"enable_thinking": False},
},
timeout=600,
)
response.raise_for_status()
print(response.json()["choices"][0]["message"]["content"])
What was trained
- Base:
unsloth/Qwen3.5-4B, revision3764fa359b9082ea5a1e4a5e3ac3aaf6e9671636. - Data: 2,975 Cityscapes training images and 500 validation images.
- Objective: image-first supervised generation of a strict JSON structure.
- Classes: 2 surfaces and 11 objects.
- Predictions: presence, object count bucket, 3×3 zones, and conservative
instance on surfacerelations. - Training: one epoch / 372 optimizer steps, BF16 16-bit LoRA SFT, assistant tokens only.
- Effective train/eval batch: 8/4.
- LoRA: rank 16, alpha 16, dropout 0, language and vision attention/MLP layers.
- Optimizer: AdamW Torch, learning rate
1e-4, cosine schedule, 5% warmup, weight decay0.001. - Context: 4,096; seed: 3,407.
- Hardware: NVIDIA RTX 6000 Ada Generation 48 GB.
- Final training loss: 0.06588; final validation loss: 0.04468.
Cityscapes source images and annotations are not included in this repository.
BF16 base-vs-tuned evaluation
The formal quality comparison used BF16 text + BF16 mmproj for both the untouched base and this tuned model. All 500 validation images used identical llama.cpp requests:
- explicit schema system prompt plus one text-only format example;
- image-first messages;
temperature=0,seed=3407,max_tokens=1024;- thinking disabled;
- no grammar and no
response_format; - 10,000 paired bootstrap resamples.
Strict all-sample results:
| Metric | Base BF16 | Tuned BF16 | Delta |
|---|---|---|---|
| JSON valid rate | 0.292 | 1.000 | +0.708 |
| Strict schema valid rate | 0.214 | 1.000 | +0.786 |
| Task score | 0.1840 | 0.8054 | +0.6214 |
task_score equally weights presence macro F1, per-class count accuracy, zone
micro F1, and relation micro F1.
A formatting-controlled semantic diagnostic removed only a single whole-response Markdown JSON fence and selected the 402/500 rows where both models passed the strict schema:
| Metric | Base BF16 | Tuned BF16 | Delta | Paired-bootstrap 95% CI |
|---|---|---|---|---|
| Presence macro F1 | 0.8110 | 0.8989 | +0.0879 | [0.0619, 0.1156] |
| Count macro accuracy | 0.7280 | 0.8211 | +0.0932 | [0.0821, 0.1043] |
| Zone micro F1 | 0.3495 | 0.8447 | +0.4953 | [0.4857, 0.5046] |
| Relation micro F1 | 0.5711 | 0.6513 | +0.0802 | [0.0606, 0.1001] |
| Task score | 0.6149 | 0.8040 | +0.1891 | [0.1790, 0.2000] |
The predefined paired comparison gate passed. The largest semantic improvement was zone localization, so the measured benefit was not only JSON formatting.
The exact evaluation prompt SHA-256 was
b7b80a3b18578acb8406af229392f9d5585563ecbace3aac724145f2d8187a3f.
Artifact validation
Every GGUF in this directory was checked for:
- GGUF V3 magic and readable metadata;
- expected architecture (
qwen35text orclipmmproj); - expected component type (
modelormmproj); - expected tensor count (441 text, 298 mmproj);
- actual tensor types matching the named precision;
- complete SHA-256 checksum.
The BF16 pair was used successfully by llama.cpp for the full 500-image evaluation. The quantized text files and alternate mmproj precisions passed format, metadata, and load checks, but were not each rerun over all 500 images. Do not assume Q2_K has the same task score as BF16.
Limitations
- The result is task-specific and does not establish a general VLM gain.
- Quantization can reduce task quality, especially at Q2_K.
- Count output is bucketed and relations cover only direct road/sidewalk support.
- Small or occluded objects can be missed.
- Use of these files is restricted to non-commercial purposes, and citing the Cityscapes Dataset is a condition of that use. See License and Citation.
License
The effective terms for these GGUF files are the intersection of two licenses, and that intersection is non-commercial.
- The base model
unsloth/Qwen3.5-4Bis Apache-2.0. - The Cityscapes Dataset License also applies, because these fine-tuned weights are a derivative work of the dataset. It states that you may not use the dataset or any derivative work for commercial purposes, such as licensing or selling the data, or using the data with a purpose to procure a commercial gain.
This repository is therefore not labelled Apache-2.0. Apache-2.0 on its own would grant commercial rights that the Cityscapes terms withhold. If you need commercial use, take that up with the Cityscapes authors rather than relying on the base model's license.
The Cityscapes license does permit distributing abstract derivative works such as trained models, provided they do not allow the dataset to be recovered, which is what makes publishing these exports possible. It does not permit redistributing the dataset itself, so no Cityscapes images or annotations are included here.
Citation
Referencing the Cityscapes Dataset in any work that uses these files is a condition of the dataset license, not a courtesy.
@inproceedings{Cordts2016Cityscapes,
title = {The Cityscapes Dataset for Semantic Urban Scene Understanding},
author = {Cordts, Marius and Omran, Mohamed and Ramos, Sebastian and
Rehfeld, Timo and Enzweiler, Markus and Benenson, Rodrigo and
Franke, Uwe and Roth, Stefan and Schiele, Bernt},
booktitle = {Proc. of the IEEE Conference on Computer Vision and Pattern
Recognition (CVPR)},
year = {2016}
}
- Downloads last month
- 164
2-bit
4-bit
6-bit
8-bit
16-bit