Instructions to use schneewolflabs/B4-27B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use schneewolflabs/B4-27B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="schneewolflabs/B4-27B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("schneewolflabs/B4-27B") model = AutoModelForMultimodalLM.from_pretrained("schneewolflabs/B4-27B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use schneewolflabs/B4-27B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "schneewolflabs/B4-27B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "schneewolflabs/B4-27B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/schneewolflabs/B4-27B
- SGLang
How to use schneewolflabs/B4-27B 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 "schneewolflabs/B4-27B" \ --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": "schneewolflabs/B4-27B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "schneewolflabs/B4-27B" \ --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": "schneewolflabs/B4-27B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use schneewolflabs/B4-27B with Docker Model Runner:
docker model run hf.co/schneewolflabs/B4-27B
Schneewolf Labs B4-27B
B2-27B taught to check before it answers, with thinking off.
Behind egirl's OpenAI-compatible API the model has web_search,
web_research and calculate. B2-27B already reached for the calculator, but with thinking off, the fast mode a
chat product wants, it answered half of the current-info questions (who holds a role, the latest version) from
memory. B4-27B searches them, still answers what it knows directly, and does it with thinking off: about half
the time per answer of thinking low.
B2-27B
+ ORPO Nachschlagen: 165 first-turn pairs on egirl's own API context, thinking off, 2 epochs
63 current-info questions chosen: web_search / web_research rejected: answer from memory
36 arithmetic and dates chosen: calculate rejected: mental math
16 look-up-then-compute chosen: search first rejected: answer from memory
50 controls chosen: direct answer rejected: an unneeded web_search
The pairs were generated with B2-9B (B4-9B's data) and used unchanged. The chosen turns are B2-9B's own thinking-on first moves (thinking stripped), kept only when the whole run's answer was right. Rejected turns are its thinking-off answers. Pairs cut at the first assistant turn, so the model learns the decision, not a new voice. The data is public: schneewolflabs/Nachschlagen.
The 50 controls (trivia, coding, rewriting text the user supplied, historical facts) keep the trigger on staleness and arithmetic rather than "any question".
Numbers
Held-out sets share no question with training; the second one uses indirect phrasing ("is it worth upgrading to the latest Python?", "what's 18% tip on $47.80 split three ways?") and traps such as past-dated questions and data the user already supplied. Thinking off, egirl, Q8_0 + bf16 adapter.
| B2-27B | B4-27B | |
|---|---|---|
| held-out (41): right first move | 34/41 | 41/41 |
| current-info questions searched | 5/10 | 10/10 |
| arithmetic sent to the calculator | 9/10 | 10/10 |
| easy questions answered directly | 10/10 | 10/10 |
| harder set (37): right first move | 31/37 | 37/37 |
| current-info questions searched | 5/10 | 10/10 |
| no-tool questions answered directly | 15/15 | 15/15 |
| keyed answers correct (32) | 32/32 | 32/32 |
| ARC / ARC-Easy / TruthfulQA | 64.5 / 86.3 / 39.9 | 63.5 / 86.1 / 39.5 |
With thinking low: 40/41 (B2-27B 38/41). The ARC difference is 3 of 299 items, inside its error.
Known residuals
- B2-27B already calculated well and answered correctly; its gap was answering current-info questions from memory, and that is what moved.
- It sometimes writes math in LaTeX (
\(x^2\)) where B2-27B wrote x². Render accordingly. - The control pairs' chosen answers were written by B2-9B, not B2-27B. Length and voice of direct answers didn't measurably change (mean 97 vs 104 characters on the no-tool set).
Notes
- Built for egirl, used through its OpenAI API with server-side tools. Other harnesses weren't a goal and weren't tested.
- Date math (
days_between,add_days,weekday,today()insidecalculate) needs an egirl with the calculate date functions (PR #194); 12 training calls use them. - Trained with Merlina, ORPO β 0.1, LoRA r16/α32 on all attention and MLP projections, lr 2e-5 cosine, batch 8, on a DGX Spark (GB10). Stronger runs (lr 5e-5, 3 epochs, r32) scored the same, so the lightest shipped.
- The adapter was baked into the weights with Kessel. The
mtp.*and vision tensors are byte-identical to B2-27B.
No GGUF is published. Convert with llama.cpp's convert_hf_to_gguf.py; B2-27B's mmproj works.
- Downloads last month
- -
Model tree for schneewolflabs/B4-27B
Base model
hemlang/Hemlock-Qwen3.8-27B