Instructions to use LoxleyLabs/Qwen3-4B-Thinking-Concise 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 LoxleyLabs/Qwen3-4B-Thinking-Concise 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 LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M # Run inference directly in the terminal: llama cli -hf LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M # Run inference directly in the terminal: llama cli -hf LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M
Use Docker
docker model run hf.co/LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use LoxleyLabs/Qwen3-4B-Thinking-Concise with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LoxleyLabs/Qwen3-4B-Thinking-Concise" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LoxleyLabs/Qwen3-4B-Thinking-Concise", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M
- Ollama
How to use LoxleyLabs/Qwen3-4B-Thinking-Concise with Ollama:
ollama run hf.co/LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M
- Unsloth Desktop
- Pi
How to use LoxleyLabs/Qwen3-4B-Thinking-Concise with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf LoxleyLabs/Qwen3-4B-Thinking-Concise: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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use LoxleyLabs/Qwen3-4B-Thinking-Concise with Docker Model Runner:
docker model run hf.co/LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M
- Lemonade
How to use LoxleyLabs/Qwen3-4B-Thinking-Concise with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M
Run and chat with the model
lemonade run user.Qwen3-4B-Thinking-Concise-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use LoxleyLabs/Qwen3-4B-Thinking-Concise with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf LoxleyLabs/Qwen3-4B-Thinking-Concise: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:9931/v1 hermes config set model.default LoxleyLabs/Qwen3-4B-Thinking-Concise:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use LoxleyLabs/Qwen3-4B-Thinking-Concise with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf LoxleyLabs/Qwen3-4B-Thinking-Concise: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:9931/v1 \ --custom-model-id "LoxleyLabs/Qwen3-4B-Thinking-Concise: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"
Download code/build_interp.py from LoxleyLabs/Qwen3-4B-Thinking-Concise: direct link, hf CLI and curl.
- Browser
- Download file 2.71 kB
-
https://huggingface.co/LoxleyLabs/Qwen3-4B-Thinking-Concise/resolve/main/code/build_interp.py
- Command line
-
hf download hf://LoxleyLabs/Qwen3-4B-Thinking-Concise/code/build_interp.py
-
curl -L -o build_interp.py https://huggingface.co/LoxleyLabs/Qwen3-4B-Thinking-Concise/resolve/main/code/build_interp.py
2.71 kB
| #!/usr/bin/env python3 | |
| """Plain blends along the cut, no selection: Instruct + alpha * R, with R = Thinking - Instruct (alpha = 1 is the | |
| Thinking model, except for 3,471 of about 4.0 billion elements where float32 cannot hold the difference exactly). | |
| Baseline for the direction-selected cuts: published work on blending thinking and instruct checkpoints reports smooth | |
| behaviour along this line. R is computed on the fly in float32 from the two Hugging Face folders. | |
| Writes models/interpNN.gguf (bf16). | |
| Usage: build_interp.py 25 50 75 | |
| """ | |
| import json | |
| import os | |
| import shutil | |
| import subprocess | |
| import sys | |
| import torch | |
| from safetensors import safe_open | |
| from safetensors.torch import save_file | |
| sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) | |
| from cutconfig import CONVERT_SCRIPT, INSTRUCT_DIR as I_DIR, ROOT, THINKING_DIR as T_DIR # noqa: E402 | |
| def weight_map(d): | |
| with open(f"{d}/model.safetensors.index.json") as fh: | |
| return json.load(fh)["weight_map"] | |
| def blend(alpha, names=None): | |
| """{name: bf16 tensor} of Instruct + alpha * (Thinking - Instruct), float32 arithmetic, for every tensor | |
| (or only for `names`).""" | |
| wi, wt = weight_map(I_DIR), weight_map(T_DIR) | |
| handles, out = {}, {} | |
| def get(d, wm, n): | |
| f = os.path.join(d, wm[n]) | |
| if f not in handles: | |
| handles[f] = safe_open(f, framework="pt", device="cpu") | |
| return handles[f].get_tensor(n).to(torch.float32) | |
| for n in (sorted(wi) if names is None else names): | |
| w_i = get(I_DIR, wi, n) | |
| r = get(T_DIR, wt, n) - w_i # the raw cut for this tensor | |
| out[n] = (w_i + alpha * r).to(torch.bfloat16).contiguous() | |
| return out | |
| def main(): | |
| for pct in (int(a) for a in sys.argv[1:]): | |
| alpha = pct / 100 | |
| hf = f"{ROOT}/step3e/interp{pct}-hf" | |
| os.makedirs(hf, exist_ok=True) | |
| save_file(blend(alpha), f"{hf}/model.safetensors", metadata={"format": "pt"}) | |
| for fname in ("config.json", "generation_config.json", "tokenizer.json", "tokenizer_config.json", | |
| "vocab.json", "merges.txt"): | |
| if os.path.exists(os.path.join(T_DIR, fname)): | |
| shutil.copy(os.path.join(T_DIR, fname), hf) | |
| os.makedirs(f"{ROOT}/models", exist_ok=True) | |
| gguf = f"{ROOT}/models/interp{pct}.gguf" | |
| # the converter imports a sibling package, so do not run it in isolated mode | |
| subprocess.run([sys.executable, CONVERT_SCRIPT, hf, "--outtype", "bf16", "--outfile", gguf], check=True, | |
| stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) | |
| shutil.rmtree(hf) | |
| print(f"built {gguf} (alpha {alpha})", flush=True) | |
| if __name__ == "__main__": | |
| main() | |