Instructions to use ProCreations/BetterWright-K2-Horizon-7B-Uno with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ProCreations/BetterWright-K2-Horizon-7B-Uno with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ProCreations/BetterWright-K2-Horizon-7B-Uno", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ProCreations/BetterWright-K2-Horizon-7B-Uno", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ProCreations/BetterWright-K2-Horizon-7B-Uno with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ProCreations/BetterWright-K2-Horizon-7B-Uno" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ProCreations/BetterWright-K2-Horizon-7B-Uno", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ProCreations/BetterWright-K2-Horizon-7B-Uno
- SGLang
How to use ProCreations/BetterWright-K2-Horizon-7B-Uno 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 "ProCreations/BetterWright-K2-Horizon-7B-Uno" \ --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": "ProCreations/BetterWright-K2-Horizon-7B-Uno", "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 "ProCreations/BetterWright-K2-Horizon-7B-Uno" \ --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": "ProCreations/BetterWright-K2-Horizon-7B-Uno", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ProCreations/BetterWright-K2-Horizon-7B-Uno with Docker Model Runner:
docker model run hf.co/ProCreations/BetterWright-K2-Horizon-7B-Uno
BetterWright-K2-Horizon-7B-Uno
A full-parameter fine-tune of IFM/K2-Horizon-7B for driving a real browser inside the BetterWright harness, shipped together with the Uno diffusion draft adapter from IFM/K2-Horizon-7B-Uno so it keeps Uno's lossless multi-token decoding speedup.
- AR weights (this repo's root): K2-Horizon-7B after one epoch of SFT on 3,840 accepted BetterWright agent trajectories (ProCreations/betterwright-agent-traces): system prompt, tool schemas, interleaved reasoning, XML tool calls and real tool results, all in K2's native chat format.
- Diffusion adapter (
adapter/): the released K2-Horizon-7B-Uno conditional LoRA, unchanged. Uno's Ψ-Spec sampler verifies every drafted block against the AR weights, so generation quality is exactly that of the fine-tuned AR model; the adapter only changes speed. Measured after fine-tuning: 1.85 accepted tokens per sequence forward on BetterWright prompts (base K2 + same adapter: 2.03), throughput within 4% of the base pairing.
Reasoning effort
K2's template supports three thinking modes; this fine-tune adds a fourth so the model can act with no reasoning at all:
reasoning_effort |
generation prefix | trained from |
|---|---|---|
high |
<ifm|think> |
Qwen3.8-Flash-Next xhigh and DeepSeek-V4.1-Flash high traces |
medium |
<ifm|think_fast> |
medium traces of both models |
low |
<ifm|think_faster> |
low traces of both models |
none |
<ifm|think>\n</ifm|think> (pre-filled empty block) |
thinking-disabled traces of both models |
The bundled chat_template.jinja (also applied by the tokenizer) differs from the base template in two ways: reasoning_effort: "none" is accepted, and assistant history messages without any thinking field render an empty think block instead of raising (BetterWright's generic OpenAI adapter does not echo reasoning back). Everything else, including XML tool calls, is K2's own format.
Training
| data | 3,840 traces, 88.0M tokens rendered (34.1M supervised assistant tokens); traces longer than 65,536 tokens cut at the last assistant turn that fits (303 traces, mostly very-long tier) |
| objective | next-token CE on assistant turns only (reasoning + content + tool calls), token-mean per optimizer step |
| schedule | 1 epoch = 159 steps of ~524k tokens; AdamW (β 0.9/0.95), lr 1e-5, 8 warmup steps, cosine to 1e-6, no weight decay, grad-clip 1.0 |
| precision | fp32 master weights, bf16 compute (FSDP2 mixed precision), FlashAttention-2, activation checkpointing, chunked LM-head loss (vocab 250,624) |
| hardware | 4× H200 (vast.ai), 2 h 15 min, ~12k tokens/s |
| held-out loss (80 traces) | 0.764 (base) → 0.675 (step 40) → 0.662 (80) → 0.656 (120) → 0.654 (final) |
Training code, the data-rendering script and the Uno benchmark script are in train/; per-step history in train/history.json; benchmark outputs in train/bench_*.json.
Use
Plain AR (transformers / vLLM / SGLang): load like K2-Horizon-7B (trust_remote_code=True). Pass reasoning_effort (none|low|medium|high) to the chat template.
Uno (fast, lossless):
git clone https://github.com/ifm-ai/uno && cd uno # follow its install steps
python inference.py --model ProCreations/BetterWright-K2-Horizon-7B-Uno --gated-lora-subfolder adapter \
--mask-token-id 250624 --stop-token-ids 250019,1 --attention-backend fa2 \
--prompt "Open https://books.toscrape.com and report the three cheapest books on page 1."
BetterWright: serve the AR weights (or the Uno engine) on an OpenAI-compatible endpoint and run betterwright exec --model <endpoint-model> --base-url http://127.0.0.1:PORT/v1 .... The model expects BetterWright's own system prompt and browser/done/ask tools; that is what it was trained on.
Limitations
- Trained on synthetic, judge-filtered traces from two teacher models on ~190 real websites; no reinforcement learning and no benchmark score is claimed. Expect it to be much better inside BetterWright than as a general assistant.
- Text-only: screenshots were omitted during data generation; the model works from DOM/text observations.
- Context was capped at 64k tokens during training; the base supports longer contexts but long-horizon behaviour beyond that is untested.
- The adapter was not re-fitted to the new AR weights; the measured ~9% drop in tokens-per-forward is the cost of that.
- Downloads last month
- 168
Model tree for ProCreations/BetterWright-K2-Horizon-7B-Uno
Base model
IFM/K2-Horizon-7B