Text Generation
Transformers
Safetensors
GGUF
English
granite
formal-logic
reasoning
lora
model-merging
wise-ft
reinforcement-learning
grpo
twil-lm
conversational
Run this model with HF Jobs
Run webAI-Official/TwIL-LM2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/webAI-Official/TwIL-LM2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/webAI-Official/TwIL-LM2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/webAI-Official/TwIL-LM2. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/webAI-Official/TwIL-LM2. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use webAI-Official/TwIL-LM2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use webAI-Official/TwIL-LM2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="webAI-Official/TwIL-LM2") 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-LM2") model = AutoModelForCausalLM.from_pretrained("webAI-Official/TwIL-LM2", 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-LM2 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-LM2:Q4_K_M # Run inference directly in the terminal: llama cli -hf webAI-Official/TwIL-LM2: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-LM2:Q4_K_M # Run inference directly in the terminal: llama cli -hf webAI-Official/TwIL-LM2: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-LM2:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf webAI-Official/TwIL-LM2:Q4_K_M
Use Docker
docker model run hf.co/webAI-Official/TwIL-LM2:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use webAI-Official/TwIL-LM2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "webAI-Official/TwIL-LM2" # 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-LM2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/webAI-Official/TwIL-LM2:Q4_K_M
- SGLang
How to use webAI-Official/TwIL-LM2 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-LM2" \ --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-LM2", "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-LM2" \ --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-LM2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use webAI-Official/TwIL-LM2 with Ollama:
ollama run hf.co/webAI-Official/TwIL-LM2:Q4_K_M
- Unsloth Desktop
- Pi
How to use webAI-Official/TwIL-LM2 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-LM2: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": "webAI-Official/TwIL-LM2:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use webAI-Official/TwIL-LM2 with Docker Model Runner:
docker model run hf.co/webAI-Official/TwIL-LM2:Q4_K_M
- Lemonade
How to use webAI-Official/TwIL-LM2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull webAI-Official/TwIL-LM2:Q4_K_M
Run and chat with the model
lemonade run user.TwIL-LM2-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use webAI-Official/TwIL-LM2 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-LM2: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 webAI-Official/TwIL-LM2:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use webAI-Official/TwIL-LM2 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-LM2: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 "webAI-Official/TwIL-LM2: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"
Updated
Browse files108 unmodified lines109110111112113114115179 unmodified lines2952962972982993003013023033 unmodified lines30730830931031131231331431531614 unmodified lines331332333334335336337338339340341342108 unmodified lines| `lean_critic` accuracy | 0.3100 | 0.6600 | 0.5250 | 0.6500 | 0.4950 | 0.5450 | 0.5900 | 0.5300 | 0.5150 | 0.5500 | **0.7950** | 0.7500 | 0.5550 || `lm_corpus` perplexity ↓ | **1.9808** | 2.8972 | 2.2981 | 3.1818 | 2.5845 | 5.0065 | 4.3815 | 2.8478 | 2.4736 | 4.9472 | 2.5440 | 16.1145 | 912.23 § || `math_corpus` perplexity ↓ | 3.3073 | 3.8229 | **3.0390** | 4.0685 | 3.2670 | 7.7402 | 6.7472 | 4.7531 | 4.1162 | 8.3323 | 4.0083 | 59.7838 | 1045.63 § || average, 6 lanes | 0.3477 | 0.4488 | **0.5410** | 0.3296 | 0.1999 | 0.2886 | 0.2725 | 0.2703 | 0.2872 | 0.3670 | 0.4285 | 0.4982 | 0.5192 || **macro gate** | 0.4178 | 0.4218 | 0.3927 | 0.3466 † | 0.2590 † | 0.3067 | 0.3473 | 0.2925 | 0.3435 | 0.3757 | 0.5336 | **0.6344** | — || **strict-7** | 0.1214 | 0.1971 | **0.2386** | 0.1493 | 0.1071 | 0.1450 | 0.1579 | 0.1229 | 0.1507 | 0.1714 | 0.2093 | 0.2050 | — || macro\_primary | 0.4400 | 0.4475 | 0.3625 | 0.4075 | 0.2900 | 0.3625 | 0.4188 | 0.3450 | 0.3675 | 0.4213 | 0.5750 | **0.6100** | — |179 unmodified linesobjectives (first-order-logic translation, entailment labelling, semantic parsing, Leanformalisation and critique, procedural reasoning, rule induction), using the project's v5SFT recipe.2. **WiSE-FT interpolation** toward the pretrained base,`W = (1 − λ)·W_base + λ·W_finetuned` with **λ = 0.25** — only a quarter of the fine-tuned deltais retained. λ was chosen to keep as much held-out capability as possible while still gainingin-domain.3. **MGPO** — entropy-weighted GRPO reinforcement learning against a programmatic verifier, withpartial credit for loose matches and token-F1 so that all-fail prompt groups still produce3 unmodified lines## Limitations and caveats**Held-out benchmarks.** The 10-dataset Track B macro is 0.6759, eleventh of thirteen and belowevery model of comparable size in the table. No paired base-versus-tuned run is included, so thiscard cannot say whether that is a regression from `granite-3.3-2b-instruct` or the base's level.Four Track B lanes (`ifeval`, `rudas_ood`, `bbh_logic`, `math500`) were not run.**Strict output form.** Strict MCQ accuracy is 0.0000, `procedural` accuracy 0.0100,`fol_translation` primary score 0.0000 and strict-7 0.1214 (eleventh of twelve). The model reasons14 unmodified lineswith vLLM 0.19.1; the two TwIL macros reproduce their published values exactly (0.7339 and 0.4333).Track A figures for this model come from GATE 2 reports at n = 200 per lane and a 2048-token cap.**Truncation in the comparison.** At the 2048-token cap, TwIL-LM3 (4.4%), the SmolLM2-1.7B-basedTwIL-LM2 (6.9%), SmolLM3-3B base (17.4%) and SmolLM2-1.7B base (11.7%) are all above the 2%threshold and formally `rankable: false`. A truncated response scores zero regardless of reasoningquality, so their Track A figures are understated: wherever this model is ahead of them the truemargin is smaller, and wherever it is behind, the true deficit is larger.**Scope.** Tuned for formal logic. The Track B suite reported here does not cover code generationor tool use, and no claim is made about either. Granite's base tool-calling and document-groundedchat-template features are inherited but were not evaluated.108 unmodified lines109110111112113114179 unmodified lines2942952962972982993003013 unmodified lines30530630730830931014 unmodified lines325326327328329330108 unmodified lines| `lean_critic` accuracy | 0.3100 | 0.6600 | 0.5250 | 0.6500 | 0.4950 | 0.5450 | 0.5900 | 0.5300 | 0.5150 | 0.5500 | **0.7950** | 0.7500 | 0.5550 || `lm_corpus` perplexity ↓ | **1.9808** | 2.8972 | 2.2981 | 3.1818 | 2.5845 | 5.0065 | 4.3815 | 2.8478 | 2.4736 | 4.9472 | 2.5440 | 16.1145 | 912.23 § || `math_corpus` perplexity ↓ | 3.3073 | 3.8229 | **3.0390** | 4.0685 | 3.2670 | 7.7402 | 6.7472 | 4.7531 | 4.1162 | 8.3323 | 4.0083 | 59.7838 | 1045.63 § || **macro gate** | 0.4178 | 0.4218 | 0.3927 | 0.3466 † | 0.2590 † | 0.3067 | 0.3473 | 0.2925 | 0.3435 | 0.3757 | 0.5336 | **0.6344** | — || **strict-7** | 0.1214 | 0.1971 | **0.2386** | 0.1493 | 0.1071 | 0.1450 | 0.1579 | 0.1229 | 0.1507 | 0.1714 | 0.2093 | 0.2050 | — || macro\_primary | 0.4400 | 0.4475 | 0.3625 | 0.4075 | 0.2900 | 0.3625 | 0.4188 | 0.3450 | 0.3675 | 0.4213 | 0.5750 | **0.6100** | — |179 unmodified linesobjectives (first-order-logic translation, entailment labelling, semantic parsing, Leanformalisation and critique, procedural reasoning, rule induction), using the project's v5SFT recipe.2. **WiSE-FT interpolation** toward the pretrained base and checkpoint fusion,`W = (1 − λ)·W_base + λ·W_finetuned`. λ was chosen to keep as much held-out capability as possible while still gainingin-domain.3. **MGPO** — entropy-weighted GRPO reinforcement learning against a programmatic verifier, withpartial credit for loose matches and token-F1 so that all-fail prompt groups still produce3 unmodified lines## Limitations and caveats**Strict output form.** Strict MCQ accuracy is 0.0000, `procedural` accuracy 0.0100,`fol_translation` primary score 0.0000 and strict-7 0.1214 (eleventh of twelve). The model reasons14 unmodified lineswith vLLM 0.19.1; the two TwIL macros reproduce their published values exactly (0.7339 and 0.4333).Track A figures for this model come from GATE 2 reports at n = 200 per lane and a 2048-token cap.**Scope.** Tuned for formal logic. The Track B suite reported here does not cover code generationor tool use, and no claim is made about either. Granite's base tool-calling and document-groundedchat-template features are inherited but were not evaluated.
README.md+2-14