Text Generation
Transformers
Safetensors
GGUF
English
granite
granite-4.2
formal-logic
reasoning
lora
model-merging
wise-ft
reinforcement-learning
grpo
conversational
Instructions to use webAI-Official/TwIL-LM3-Pro with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use webAI-Official/TwIL-LM3-Pro with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="webAI-Official/TwIL-LM3-Pro") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("webAI-Official/TwIL-LM3-Pro") model = AutoModelForCausalLM.from_pretrained("webAI-Official/TwIL-LM3-Pro", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use webAI-Official/TwIL-LM3-Pro 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 webAI-Official/TwIL-LM3-Pro:Q4_K_M # Run inference directly in the terminal: llama cli -hf webAI-Official/TwIL-LM3-Pro:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf webAI-Official/TwIL-LM3-Pro:Q4_K_M # Run inference directly in the terminal: llama cli -hf webAI-Official/TwIL-LM3-Pro: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 webAI-Official/TwIL-LM3-Pro:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf webAI-Official/TwIL-LM3-Pro:Q4_K_M
Use Docker
docker model run hf.co/webAI-Official/TwIL-LM3-Pro:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use webAI-Official/TwIL-LM3-Pro with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "webAI-Official/TwIL-LM3-Pro" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "webAI-Official/TwIL-LM3-Pro", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/webAI-Official/TwIL-LM3-Pro:Q4_K_M
- SGLang
How to use webAI-Official/TwIL-LM3-Pro 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 "webAI-Official/TwIL-LM3-Pro" \ --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": "webAI-Official/TwIL-LM3-Pro", "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 "webAI-Official/TwIL-LM3-Pro" \ --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": "webAI-Official/TwIL-LM3-Pro", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use webAI-Official/TwIL-LM3-Pro with Ollama:
ollama run hf.co/webAI-Official/TwIL-LM3-Pro:Q4_K_M
- Unsloth Desktop
- Pi
How to use webAI-Official/TwIL-LM3-Pro with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf webAI-Official/TwIL-LM3-Pro: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": "webAI-Official/TwIL-LM3-Pro:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use webAI-Official/TwIL-LM3-Pro with Docker Model Runner:
docker model run hf.co/webAI-Official/TwIL-LM3-Pro:Q4_K_M
- Lemonade
How to use webAI-Official/TwIL-LM3-Pro with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull webAI-Official/TwIL-LM3-Pro:Q4_K_M
Run and chat with the model
lemonade run user.TwIL-LM3-Pro-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use webAI-Official/TwIL-LM3-Pro with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf webAI-Official/TwIL-LM3-Pro: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 webAI-Official/TwIL-LM3-Pro:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use webAI-Official/TwIL-LM3-Pro with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf webAI-Official/TwIL-LM3-Pro: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 "webAI-Official/TwIL-LM3-Pro: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"
feat: add Q4_0 GGUF for Snapdragon NPU (GenieX)
Browse filesAdds a Q4_0 build quantized from the F16 GGUF with llama-quantize (no imatrix), and documents it in the model card with GenieX usage and context-window guidance.
- .gitattributes +1 -0
- README.md +30 -5
- TwIL-LM3-Pro-Q4_0.gguf +3 -0
.gitattributes
CHANGED
|
@@ -44,3 +44,4 @@ TwIL-LM3-Pro-Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
|
| 44 |
TwIL-LM3-Pro-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 45 |
TwIL-LM3-Pro-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 46 |
TwIL-LM3-Pro-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 44 |
TwIL-LM3-Pro-Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
|
| 45 |
TwIL-LM3-Pro-Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
|
| 46 |
TwIL-LM3-Pro-Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
TwIL-LM3-Pro-Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -92,7 +92,7 @@ assistant — there is no safety or preference tuning here beyond what Granite 4
|
|
| 92 |
| Language | English |
|
| 93 |
| Tokenizer vocabulary size | 100,352 |
|
| 94 |
| Context window | 131,072 tokens |
|
| 95 |
-
| Checkpoint precision | bfloat16 (6.82 GiB), plus Q4\_K\_M / Q5\_K\_M / Q6\_K / Q8\_0 / F16 GGUF builds
|
| 96 |
| Post-training | LoRA SFT → checkpoint fusion → WiSE-FT (α = 0.15) → MGPO reinforcement learning (β = 0.02, step 2580) |
|
| 97 |
| Reasoning format | Emits a `<think>…</think>` block before the answer (default chat template) |
|
| 98 |
| Evaluated decoding | Greedy, 2048 new tokens (one retry at 4096), `max_seq_len` 8192 |
|
|
@@ -423,6 +423,7 @@ as EOS, so run it in conversation mode (`-cnv`).
|
|
| 423 |
|
| 424 |
| file | quant | size | bits/weight | notes |
|
| 425 |
|---|---|---:|---:|---|
|
|
|
|
| 426 |
| `TwIL-LM3-Pro-Q4_K_M.gguf` | Q4_K_M | 2.09 GiB | 4.91 | recommended default; runs on CPU or 4 GB of VRAM |
|
| 427 |
| `TwIL-LM3-Pro-Q5_K_M.gguf` | Q5_K_M | 2.43 GiB | 5.71 | a little more headroom than Q4_K_M |
|
| 428 |
| `TwIL-LM3-Pro-Q6_K.gguf` | Q6_K | 2.80 GiB | 6.57 | close to Q8_0 quality at about three-quarters the size |
|
|
@@ -439,14 +440,38 @@ budget large — 2048 tokens or more — since the model emits a `<think>` block
|
|
| 439 |
and a short budget truncates it, which costs far more accuracy than the quantization does.
|
| 440 |
|
| 441 |
F16 and Q8_0 were produced directly by `convert_hf_to_gguf.py` from the released bf16 weights; the
|
| 442 |
-
K-quants (Q4_K_M, Q5_K_M, Q6_K) were quantized from the F16 build with `llama-quantize`,
|
| 443 |
-
an importance matrix. F16 is not bit-identical to the released weights: bf16 and f16 carry the
|
| 444 |
same 16 bits but trade exponent range against mantissa precision, so the conversion is a
|
| 445 |
narrowing one, in practice negligible for inference.
|
| 446 |
|
| 447 |
The published Track A and Track B numbers were measured on the **bf16** weights through vLLM, not
|
| 448 |
-
on any of these GGUF builds, so expect small deviations — most likely at Q4_K_M
|
| 449 |
-
been quantified here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 450 |
|
| 451 |
## How it was built
|
| 452 |
|
|
|
|
| 92 |
| Language | English |
|
| 93 |
| Tokenizer vocabulary size | 100,352 |
|
| 94 |
| Context window | 131,072 tokens |
|
| 95 |
+
| Checkpoint precision | bfloat16 (6.82 GiB), plus Q4\_0 / Q4\_K\_M / Q5\_K\_M / Q6\_K / Q8\_0 / F16 GGUF builds |
|
| 96 |
| Post-training | LoRA SFT → checkpoint fusion → WiSE-FT (α = 0.15) → MGPO reinforcement learning (β = 0.02, step 2580) |
|
| 97 |
| Reasoning format | Emits a `<think>…</think>` block before the answer (default chat template) |
|
| 98 |
| Evaluated decoding | Greedy, 2048 new tokens (one retry at 4096), `max_seq_len` 8192 |
|
|
|
|
| 423 |
|
| 424 |
| file | quant | size | bits/weight | notes |
|
| 425 |
|---|---|---:|---:|---|
|
| 426 |
+
| `TwIL-LM3-Pro-Q4_0.gguf` | Q4_0 | 1.98 GiB | 4.65 | for the Snapdragon Hexagon NPU via GenieX (see below) |
|
| 427 |
| `TwIL-LM3-Pro-Q4_K_M.gguf` | Q4_K_M | 2.09 GiB | 4.91 | recommended default; runs on CPU or 4 GB of VRAM |
|
| 428 |
| `TwIL-LM3-Pro-Q5_K_M.gguf` | Q5_K_M | 2.43 GiB | 5.71 | a little more headroom than Q4_K_M |
|
| 429 |
| `TwIL-LM3-Pro-Q6_K.gguf` | Q6_K | 2.80 GiB | 6.57 | close to Q8_0 quality at about three-quarters the size |
|
|
|
|
| 440 |
and a short budget truncates it, which costs far more accuracy than the quantization does.
|
| 441 |
|
| 442 |
F16 and Q8_0 were produced directly by `convert_hf_to_gguf.py` from the released bf16 weights; the
|
| 443 |
+
K-quants (Q4_K_M, Q5_K_M, Q6_K) and Q4_0 were quantized from the F16 build with `llama-quantize`,
|
| 444 |
+
without an importance matrix. F16 is not bit-identical to the released weights: bf16 and f16 carry the
|
| 445 |
same 16 bits but trade exponent range against mantissa precision, so the conversion is a
|
| 446 |
narrowing one, in practice negligible for inference.
|
| 447 |
|
| 448 |
The published Track A and Track B numbers were measured on the **bf16** weights through vLLM, not
|
| 449 |
+
on any of these GGUF builds, so expect small deviations — most likely at Q4_K_M and Q4_0 — that
|
| 450 |
+
have not been quantified here.
|
| 451 |
+
|
| 452 |
+
### Snapdragon NPU / GenieX
|
| 453 |
+
|
| 454 |
+
The Q4_0 build is the one to use with [GenieX](https://github.com/qualcomm/GenieX) on Snapdragon
|
| 455 |
+
devices (for example Snapdragon X Elite / X2 Elite), since Q4_0 has the best Hexagon NPU support in
|
| 456 |
+
its llama.cpp runtime.
|
| 457 |
+
|
| 458 |
+
```bash
|
| 459 |
+
geniex infer webAI-Official/TwIL-LM3-Pro:Q4_0 --nctx 16384
|
| 460 |
+
```
|
| 461 |
+
|
| 462 |
+
```python
|
| 463 |
+
from geniex import AutoModelForCausalLM
|
| 464 |
+
|
| 465 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 466 |
+
"webAI-Official/TwIL-LM3-Pro", precision="Q4_0", n_ctx=16384
|
| 467 |
+
)
|
| 468 |
+
```
|
| 469 |
+
|
| 470 |
+
Set the context explicitly: GenieX defaults to a 4,096-token window for GGUF models, which is too
|
| 471 |
+
short for this model's `<think>` blocks (1,902 tokens on average on Track A). The GGUF carries the
|
| 472 |
+
full 131,072-token context, and on the NPU GenieX stores the KV cache in Q8_0, at about 42 KiB per
|
| 473 |
+
token — roughly 0.7 GiB at 16k and 1.3 GiB at 32k on top of the weights. As above, scores were
|
| 474 |
+
measured inside an 8,192-token window, and this build has not yet been benchmarked on device.
|
| 475 |
|
| 476 |
## How it was built
|
| 477 |
|
TwIL-LM3-Pro-Q4_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db09635d997275fc07d0df12ea3ab43aa7fe03fa612e061d904581583e9dbbcf
|
| 3 |
+
size 2129118656
|