Instructions to use oracomputing/Qwen3-4B-ORA-W3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use oracomputing/Qwen3-4B-ORA-W3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="oracomputing/Qwen3-4B-ORA-W3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("oracomputing/Qwen3-4B-ORA-W3") model = AutoModelForCausalLM.from_pretrained("oracomputing/Qwen3-4B-ORA-W3", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use oracomputing/Qwen3-4B-ORA-W3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "oracomputing/Qwen3-4B-ORA-W3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "oracomputing/Qwen3-4B-ORA-W3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/oracomputing/Qwen3-4B-ORA-W3
- SGLang
How to use oracomputing/Qwen3-4B-ORA-W3 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 "oracomputing/Qwen3-4B-ORA-W3" \ --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": "oracomputing/Qwen3-4B-ORA-W3", "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 "oracomputing/Qwen3-4B-ORA-W3" \ --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": "oracomputing/Qwen3-4B-ORA-W3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use oracomputing/Qwen3-4B-ORA-W3 with Docker Model Runner:
docker model run hf.co/oracomputing/Qwen3-4B-ORA-W3
Qwen3-4B-ORA-W3
~3.7× smaller than the original 16-bit Qwen3-4B, with 96.5% accuracy retention.
3-bit weight-only quantization for Qwen/Qwen3-4B using our propietary Qauntization-Aware-Training pipeline, more information in the dedicated post.
Serve with vLLM ≥ 0.25.0 (Humming WNA16) to keep weights packed. Transformers also works if you pin compressed-tensors>=0.18 but it decompresses the 3-bit weights to bf16 in memory.
Benchmarks
Scores versus the original 16-bit Qwen/Qwen3-4B. Higher is better.
| Model | MMLU-Pro | GSM8K Platinum | IFEval | MBPP+ | BFCL-v3 | Average | Real BPW | Retention |
|---|---|---|---|---|---|---|---|---|
| Qwen3-4B (bf16) | 49.20 | 89.99 | 84.89 | 71.69 | 84.81 | 76.12 | 16.00 | 100.0% |
| ORA-W3 | 44.56 | 85.03 | 82.97 | 72.75 | 81.97 | 73.46 | 4.37 | 96.5% |
Note: The same setup was applied to all models, so scores in this table are comparable.
Usage
Serve with vLLM
Packed 3-bit inference. This is the path that keeps the size win.
pip install "vllm>=0.25.0"
vllm serve oracomputing/Qwen3-4B-ORA-W3
The server speaks the OpenAI chat API on http://localhost:8000:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "oracomputing/Qwen3-4B-ORA-W3",
"messages": [{"role": "user", "content": "Hello"}],
"temperature": 0.6,
"top_p": 0.95,
"top_k": 20,
"max_tokens": 2048
}'
Python:
from vllm import LLM, SamplingParams
llm = LLM(model="oracomputing/Qwen3-4B-ORA-W3")
params = SamplingParams(
temperature=0.6,
top_p=0.95,
top_k=20,
min_p=0.0,
max_tokens=2048,
)
print(llm.generate(["Hello"], params)[0].outputs[0].text)
If Humming fails with failed to open libnvrtc-builtins.so.13.0, point LD_LIBRARY_PATH at your CUDA 13 NVRTC libs (for example .../site-packages/nvidia/cu13/lib from the PyTorch/NVIDIA wheels).
Transformers (decompresses to bf16)
Pin compressed-tensors ≥ 0.18 so the dense 3-bit pack unpacks correctly. Older 0.17.x will mis-decode these weights. Transformers loads the model as bf16 (not packed 3-bit inference).
pip install "transformers>=4.51" "compressed-tensors>=0.18"
from transformers import AutoModelForCausalLM, AutoTokenizer
from transformers.utils.quantization_config import CompressedTensorsConfig
model_id = "oracomputing/Qwen3-4B-ORA-W3"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype="bfloat16",
device_map="auto",
quantization_config=CompressedTensorsConfig(run_compressed=False),
)
messages = [{"role": "user", "content": "Hello"}]
text = tok.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=True,
)
ids = tok(text, return_tensors="pt").to(model.device)
out = model.generate(**ids, max_new_tokens=256, temperature=0.6, top_p=0.95, top_k=20)
print(tok.decode(out[0], skip_special_tokens=True))
Best Practices
Sampling defaults are the same as Qwen/Qwen3-4B. They are already stored in this checkpoint’s generation_config.json for thinking mode.
Sampling parameters
- Thinking (
enable_thinking=True):temperature=0.6,top_p=0.95,top_k=20,min_p=0. Do not use greedy decoding — it degrades quality and can loop forever. These are the defaults ingeneration_config.json. - Non-thinking (
enable_thinking=False):temperature=0.7,top_p=0.8,top_k=20,min_p=0. - If you hit endless repetition, raise
presence_penaltybetween0and2(1.5 is a common starting point). Higher values can mix languages and slightly hurt quality.
- Thinking (
Output length
- Use up to 32,768 new tokens for most queries.
- For hard math / coding contest problems, allow up to 81,920.
Switching thinking on or off
Pass
enable_thinkingthrough the chat template (Transformers and vLLM both honor this):prompt = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True, enable_thinking=True, # or False )Prompt format when you are benchmarking
- Math: append
Please reason step by step, and put your final answer within \boxed{}. - Multiple choice: ask the model to put only the letter in JSON, e.g.
"answer": "C".
- Math: append
Multi-turn history Keep only the final answer in conversation history — drop the
<think>...</think>block from earlier turns.
- Downloads last month
- 364