Instructions to use InferForge/Qwen3.5-4B-Q4_K_M 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 InferForge/Qwen3.5-4B-Q4_K_M 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 InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M # Run inference directly in the terminal: llama cli -hf InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M # Run inference directly in the terminal: llama cli -hf InferForge/Qwen3.5-4B-Q4_K_M: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 InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf InferForge/Qwen3.5-4B-Q4_K_M: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 InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M
Use Docker
docker model run hf.co/InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use InferForge/Qwen3.5-4B-Q4_K_M with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "InferForge/Qwen3.5-4B-Q4_K_M" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "InferForge/Qwen3.5-4B-Q4_K_M", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M
- Ollama
How to use InferForge/Qwen3.5-4B-Q4_K_M with Ollama:
ollama run hf.co/InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M
- Unsloth Desktop
- Pi
How to use InferForge/Qwen3.5-4B-Q4_K_M with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf InferForge/Qwen3.5-4B-Q4_K_M: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": "InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use InferForge/Qwen3.5-4B-Q4_K_M with Docker Model Runner:
docker model run hf.co/InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M
- Lemonade
How to use InferForge/Qwen3.5-4B-Q4_K_M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3.5-4B-Q4_K_M-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use InferForge/Qwen3.5-4B-Q4_K_M with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf InferForge/Qwen3.5-4B-Q4_K_M: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 InferForge/Qwen3.5-4B-Q4_K_M:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use InferForge/Qwen3.5-4B-Q4_K_M with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf InferForge/Qwen3.5-4B-Q4_K_M: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 "InferForge/Qwen3.5-4B-Q4_K_M: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"
InferForge — Qwen3.5-4B-Q4_K_M
A Q4_K_M GGUF quantization of Qwen3.5-4B, prepared by InferForge for efficient local inference with llama.cpp.
This build focuses on practical local inference on consumer hardware, with an emphasis on:
- Coding
- Technical analysis
- DevOps and infrastructure
- Kubernetes troubleshooting
- Distributed systems
- Agent and worker workloads
- Long-context inference
- Efficient GPU/CPU inference
Model Information
| Property | Value |
|---|---|
| Base model | Qwen/Qwen3.5-4B |
| Parameters | ~4B |
| Format | GGUF |
| Quantization | Q4_K_M |
| Inference engine | llama.cpp |
| Tested context | 131,072 tokens (128K) |
| Primary target | Local inference |
| Maintainer | InferForge |
Quantization
The original Qwen3.5-4B model was converted to GGUF and quantized locally using llama.cpp.
The resulting file is:
Qwen3.5-4B-Q4_K_M.gguf
The Q4_K_M format was selected as a practical balance between:
- Model quality
- Memory usage
- Generation speed
- Consumer GPU compatibility
Usage with llama.cpp
Interactive CLI
Run the model directly with llama-cli:
llama-cli \
-m Qwen3.5-4B-Q4_K_M.gguf \
-ngl 99 \
-c 131072 \
-n 1024
Docker
docker run --rm -it \
--gpus all \
--entrypoint /app/llama-cli \
-v "$PWD:/models" \
ghcr.io/ggml-org/llama.cpp:full-cuda \
-m /models/Qwen3.5-4B-Q4_K_M.gguf \
-ngl 99 \
-c 131072 \
-n 1024
Usage with llama-server
The model can also be exposed through an OpenAI-compatible API.
Native
llama-server \
-m Qwen3.5-4B-Q4_K_M.gguf \
-ngl 99 \
-c 131072 \
-n 1024 \
--host 0.0.0.0 \
--port 8080
Docker
docker run --rm -d \
--name qwen35-4b \
--gpus all \
--entrypoint /app/llama-server \
-p 30000:8080 \
-v "$PWD:/models" \
ghcr.io/ggml-org/llama.cpp:full-cuda \
-m /models/Qwen3.5-4B-Q4_K_M.gguf \
-ngl 99 \
-c 131072 \
-n 1024 \
--host 0.0.0.0 \
--port 8080
The OpenAI-compatible API is available at:
http://localhost:30000/v1
Example API Request
curl http://localhost:30000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen3.5-4B-Q4_K_M.gguf",
"messages": [
{
"role": "user",
"content": "Explain how Kubernetes Pods differ from Docker containers."
}
],
"temperature": 0.2,
"max_tokens": 512
}'
Context Length
This build has been tested with:
131072 tokens
or approximately:
128K context
Large context windows substantially increase memory requirements.
On GPUs with limited VRAM, llama.cpp may offload part of the workload to system RAM.
Users should benchmark different context sizes on their own hardware to determine the best performance/memory trade-off.
Limitations
- Performance varies across hardware and inference backends.
- Large context sizes require significantly more memory.
- Q4_K_M trades some numerical precision for lower memory usage and higher inference speed.
- Quantization may introduce quality differences compared with higher-precision versions.
- This repository contains a quantized derivative of the original model and is not a new base model.
File Integrity
SHA256:
025d2cb46dc4cb13b54b8d5c44c3cb7c46fc2cc6a0728b69762c9465ca4c03d2
Generate the checksum with:
sha256sum Qwen3.5-4B-Q4_K_M.gguf
Credits
This repository contains a GGUF quantization derived from:
Qwen3.5-4B
Please refer to the original Qwen model repository for the original model, architecture, training information, and licensing terms.
This is an independent InferForge quantization project and is not affiliated with or endorsed by Qwen.
About InferForge
InferForge is an independent model experimentation and inference project focused on practical and reproducible local AI infrastructure.
Areas of interest include:
- GGUF quantization
- Local LLM inference
- Consumer GPU optimization
- Inference benchmarking
- Long-context experimentation
- Efficient model serving
- Agent-oriented workloads
- Reproducible AI infrastructure
Additional models, quantizations, and benchmark results may be added to the InferForge collection over time.
- Downloads last month
- 68
4-bit