Instructions to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 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 BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M # Run inference directly in the terminal: llama cli -hf BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M # Run inference directly in the terminal: llama cli -hf BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4: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 BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4: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 BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M
Use Docker
docker model run hf.co/BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M
- SGLang
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 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 "BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4" \ --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": "BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4" \ --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": "BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 with Ollama:
ollama run hf.co/BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M
- Unsloth Studio
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 to start chatting
- Pi
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4: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": "BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 with Docker Model Runner:
docker model run hf.co/BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M
- Lemonade
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3-4b-Z-Image-Engineer-V4-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4: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 BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4: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 "BennyDaBall/Qwen3-4b-Z-Image-Engineer-V4: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"
Qwen3-4b-Z-Image-Engineer-V4: F16 vs Q8_0
Hi, I have a question about these two models when used on LM Studio.
When you listed the description and its capabilities:
F16: Full precision, maximum quality
Q8_0 4.3: Near-lossless
Does this mean that the prompts made using the F16 will be more precise or does this description only refer to during image generations?
Great question!
TL;DR - For production use always use the highest quality (F16, Q8) your VRAM budget can afford! As a CLIP model, quantization will change the resulting image, "quality" here is totally subjective - As a text producing LLM (prompt enhancer) the difference is negligible and until you get lower than Q4_K_M you probably won't notice.
Detailed explanation:
Quantization reduces memory usage and increases inference speed, but it often comes with a trade-off in "intelligence" or accuracy.
1. LLM for Text Generation
When using an LLM (like Qwen3-4B) for text generation, quantization affects the model's ability to maintain nuanced logic and grammatical fluidity.
- Q8 (8-bit): Generally considered "near-lossless." You gain roughly a 50% reduction in VRAM usage with negligible impact on perplexity (the measure of how well a model predicts text). Most users cannot distinguish between and in standard chat.
- Q4 (4-bit): This is the "sweet spot" for consumer hardware, offering a 75% reduction in VRAM. However, you may start to see "quantization artifacts." The model might become slightly more prone to repetition, lose track of complex instructions in long prompts, or show a minor degradation in mathematical reasoning.
2. LLM as a CLIP Model (Z-Image Turbo)
Using an LLM as the text encoder (CLIP) for an image generation pipeline like Z-Image Turbo changes the stakes. Here, the LLM isn't "talking"; it is translating text into high-dimensional vectors (embeddings) that guide the diffusion process.
Sensitivity to Semantic Noise: Image generation is highly sensitive to the relationships between words. In , the "distance" between similar concepts in the embedding space can become distorted. For example, the model might struggle to distinguish between "a cat on a mat" vs. "a mat on a cat" because the fine-grained semantic nuances are blurred during weight compression.
Prompt Adherence: If you use a version of the Z-Engineer model, you might notice lower prompt adherence (CIDER scores). The "Turbo" nature of the model relies on very precise guidance; if the CLIP output is "noisy" due to heavy quantization, the resulting image may ignore specific keywords or lose stylistic consistency.
The Verdict: While is often fine for a chatbot, for a Z-Image architecture, Q8 is usually preferred. It ensures the embeddings remain precise enough to guide the latent space without introducing the "muddiness" that 4-bit compression can cause in cross-attention layers.
Thanks for the quick reply.
I'll continue to compare the two versions for awhile. As for the text encoder part, thanks for the information as well. No wonder it struggled to do some stuff that other encoders easily did.
This is absolutely OUTSTANDING Benny thank you so much for your hard work brigninng this to the community, such great results and on the F16 vs Q8 question its got to be the most miniscure prompt edherance issue, maybe a fingernail 0.2 degrees west. Your not missing tricks. One small Q runing local what folder in models does this need to go when using with Z-Engineer node?, i keeep geting this question pop up. Thanks again mate!
This is absolutely OUTSTANDING Benny thank you so much for your hard work brigninng this to the community, such great results and on the F16 vs Q8 question its got to be the most miniscure prompt edherance issue, maybe a fingernail 0.2 degrees west. Your not missing tricks. One small Q runing local what folder in models does this need to go when using with Z-Engineer node?, i keeep geting this question pop up. Thanks again mate!
i've been running the f16 for a few days now in LM studio and noticed that it can sometimes miss hair or eye colors, deviate from the original input concepts, etc. I also noticed that the prompts it generates ignore shot distances such as close-up, from the shoulders up, etc. interesting thing about z image is that a few sentence can produce amazing results and lots of words can also, but the middle length word counts tend to create the lesser realistic results.
This is absolutely OUTSTANDING Benny thank you so much for your hard work brigninng this to the community, such great results and on the F16 vs Q8 question its got to be the most miniscure prompt edherance issue, maybe a fingernail 0.2 degrees west. Your not missing tricks. One small Q runing local what folder in models does this need to go when using with Z-Engineer node?, i keeep geting this question pop up. Thanks again mate!
i've been running the f16 for a few days now in LM studio and noticed that it can sometimes miss hair or eye colors, deviate from the original input concepts, etc. I also noticed that the prompts it generates ignore shot distances such as close-up, from the shoulders up, etc. interesting thing about z image is that a few sentence can produce amazing results and lots of words can also, but the middle length word counts tend to create the lesser realistic results.
Yeah, I'm working on that π . Much of that behavior can be fixed by engineering your system prompt a bit. Simplest example, if you want longer prompts change 200-250 word count to 300-450, but the model follows instructions well enough that you should be able to prompt it to adhere to any specific shot distances/framing.
Keep in mind when using this as a text-chat model - Z-Engineer is trained for one-shot prompts, it isn't trained specifically on iterative refinement and may get confused or miss details if used that way.
I also made a "thinking" version of this model that has better input prompt adherence, but that can add 25-35 seconds to each generation if it decides to think and nobody wants longer generations. π Plus, on synthetic benchmarks and qualitative analysis with my own peepers the difference in the end between think/no-think is negligible in most other ways.