Instructions to use Avifenesh/k2h-c2-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Avifenesh/k2h-c2-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Avifenesh/k2h-c2-sft", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Avifenesh/k2h-c2-sft", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Avifenesh/k2h-c2-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Avifenesh/k2h-c2-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Avifenesh/k2h-c2-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Avifenesh/k2h-c2-sft
- SGLang
How to use Avifenesh/k2h-c2-sft 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 "Avifenesh/k2h-c2-sft" \ --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": "Avifenesh/k2h-c2-sft", "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 "Avifenesh/k2h-c2-sft" \ --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": "Avifenesh/k2h-c2-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Avifenesh/k2h-c2-sft with Docker Model Runner:
docker model run hf.co/Avifenesh/k2h-c2-sft
K2H c2-sft
Arm 2 of a continued-pretraining study on IFM/K2-Horizon-MoVA-36B-A4B: clean domain data plus verified replay plus verified SFT-format chat and reasoning.
Research checkpoint, published 2026-11-03. It is not a release candidate. Compare it with the release, not in isolation.
Model
- Base: IFM/K2-Horizon-MoVA-36B-A4B (36B total, about 4B active, MoE). Same architecture, tokenizer and chat template.
- Weights: bf16 safetensors. The custom modeling code ships with the weights, so load with
trust_remote_code=True. - Sampling as the base model card recommends: temperature 1.0, top_p 0.95.
Training
- Trainer: xLLM, FSDP2, bf16, 3 GPUs.
- Start: the released weights of IFM/K2-Horizon-MoVA-36B-A4B.
- 100 steps. Sequence length 65,536, batch 1 per GPU, gradient accumulation 4: about 786k tokens per step, about 79M tokens in total.
- AdamW, beta1 0.9, beta2 0.95, weight decay 0.06, gradient clip 1.0.
- Learning rate 1.5e-5, 20 warmup steps, then constant.
- Chat records, where present, are trained on assistant tokens only.
Data mix (sampling weights):
- 66%: domain slices from Avifenesh/k2h-corpus-domain-clean (inference, framework, general and Linux code bundles, commits) plus pull-request text and a small slice of tuning notes that are not published, plus converted arXiv papers (not published).
- 10%:
replay-synth-verified(7%) andreplay-math-verified(3%) from Avifenesh/k2h-replay-verified. - 24%: chat records from an early snapshot of Avifenesh/k2h-chat-reasoning-verified: reasoning 15% (3,159 records, one review pass), TxT360 instruct 6% (3,015 records), Stack Exchange 3% (4,043 records).
Evaluation
All numbers come from the same harness as the release column (lm-evaluation-harness against a vLLM server). IFEval and chat GSM8K use the chat template with reasoning on, temperature 1.0, top_p 0.95, 14,336 new tokens, and score only the text after the reasoning block. The PR NLL is the mean token NLL on 150 held-out pull requests (530k tokens).
| Task | Release | This model | Change |
|---|---|---|---|
| GSM8K, 5-shot, strict | 90.1 | 87.6 | -2.5 |
| GSM8K, chat zero-shot (reasoning on) | 96.6 | 87.4 | -9.2 |
| IFEval, prompt-strict (reasoning on) | 84.3 | 68.6 | -15.7 |
| MMLU | 77.3 | 77.4 | +0.1 |
| ARC-Challenge | 57.6 | 57.7 | +0.1 |
| ARC-Easy | 85.6 | 85.6 | +0.0 |
| BoolQ | 88.4 | 88.3 | -0.1 |
| HellaSwag (norm) | 67.6 | 68.0 | +0.4 |
| PIQA | 80.5 | 80.3 | -0.2 |
| WinoGrande | 69.1 | 70.1 | +1.0 |
| MBPP pass@1 | 65.2 | 71.8 | +6.6 |
| HumanEval pass@1 (4 samples) | 53.0 | 69.5 | +16.5 |
| Held-out PR NLL (lower is better) | 1.519 | 1.323 | -0.196 |
What the numbers say:
- Best coding of the arms (HumanEval +16.5, MBPP +6.6). MMLU, ARC and BoolQ are level.
- IFEval drops 15.7 points (p=1e-13). 46 replies never close their reasoning within 14k tokens.
- Chat-format GSM8K drops 9.2 points: 8.4% of replies never close reasoning. The DeepSeek and Kimi reasoning slice lengthens the model's own reasoning; it does not restore instruction following.
- The SFT snapshot still held about 16% defective chat records (single review pass).
License
Apache-2.0, the license of the base model.
- Downloads last month
- 356
Model tree for Avifenesh/k2h-c2-sft
Base model
IFM/K2-Horizon-MoVA-36B-A4B