---
pipeline_tag: text-generation
library_name: transformers
model_name: K2-Horizon-7B
language:
- en
license: apache-2.0
datasets:
- IFM/K2-Horizon-Pretrain-Data
- IFM/K2-Horizon-Midtrain-Data
tags:
- k2-horizon
- 7b
- dense
- open-weights
- ifm
---
# K2-Horizon-7B
[Training Code](https://github.com/LLM360/xllm) - [Evaluation Code](https://github.com/LLM360/Eval360-V2) - [Pretraining Data](https://huggingface.co/datasets/IFM/K2-Horizon-Pretrain-Data) - [Midtraining Data](https://huggingface.co/datasets/IFM/K2-Horizon-Midtrain-Data)
K2-Horizon-7B is a mid-scale dense base model in the IFM K2-Horizon family.
K2-Horizon is an open-weight IFM model family built for transparent foundation-model research, staged checkpoint analysis, and practical deployment. The series spans compact dense models for local experimentation, dense mid-size and large models for high-quality research workloads, and sparse expert models for higher-capacity serving.
All model cards in this family intentionally share the same structure and family-level reference material. Each repository focuses on one model size, but the card also describes the full release series so users can compare architectures, context length, serving requirements, and benchmark behavior before selecting a model.
The repositories provide base/pretraining and staged midtraining revisions, making it possible to study capability changes across training phases instead of evaluating only one checkpoint. The `main` branch contains the default checkpoint, while stable stage tags such as `base_final`, `mid_1_final`, and `mid_4_final` identify specific model states for reproducible use.
## Model Series Overview
K2-Horizon is released as a family of checkpoints that share the same post-training recipe, release process, and user-facing deployment guidance while covering dense, MoE, and MoVA configurations. The table below summarizes the public family view; individual repositories contain the files and branches for one model size.
| Model | Architecture | Stored parameters | Active parameters/token | Context length | Vocab size | Intended use |
| --- | --- | --- | --- | --- | --- | --- |
| K2-Horizon-0.9B | K2HorizonForCausalLM; dense decoder-only | 0.9B | 0.9B | 8,192 | 64,256 | Lightweight experimentation, local development, evaluation dry runs |
| K2-Horizon-3.7B | XllmForCausalLM; dense decoder-only | 5.06B | 5.06B | 524,288 | 250,624 | Efficient research, evaluation, and single-node serving |
| K2-Horizon-7B | XllmForCausalLM; dense decoder-only | 9.00B | 9.00B | 524,288 | 250,624 | General research, fine-tuning, and cost-conscious deployment |
| K2-Horizon-32B | K2HorizonForCausalLM; dense decoder-only | 34.78B | 34.78B | 524,288 | 250,624 | Stronger long-context and reasoning experiments |
| K2-Horizon-36B | K2HorizonForCausalLM; MoVA + MoE | 37.44B | 5.95B | 524,288 | 250,624 | Multistage research and production-style serving experiments |
| K2-Horizon-375B | XllmForCausalLM; sparse MoE | 379.17B | 26.67B | 524,288 | 250,624 | Frontier-scale open research, long-context evaluation, and high-capacity serving |
Tokenizer files are distributed with each model repository. The compact K2-Horizon-0.9B model comes from the IFM Mobile line and uses a 64,256-token vocabulary. The 3.7B, 7B, 32B, 36B, and 375B models use a 250,624-token vocabulary.
The native 0.9B `main`, 32B `mid_4`, and 36B `main`/`mid_4` revisions publish `K2HorizonForCausalLM`, `model_type: k2_horizon`, and matching `configuration_k2_horizon.py` and `modeling_k2_horizon.py` modules. The deployment preflights below validate that public contract before loading weights.
## This Repository
| Field | Value |
| --- | --- |
| Model name | K2-Horizon-7B |
| Repository | IFM/K2-Horizon-7B |
| Model family | K2-Horizon |
| Architecture class | XllmForCausalLM |
| Classification | Dense |
| Stored parameters | 6.95B core; 9.00B including embeddings |
| Active parameters per token | 6.95B core; 9.00B including embeddings |
| Context length | 512K tokens |
| Transformer layers | 36 |
| Hidden size | 4,096 |
| Dense / expert intermediate size | 12,288 / 0 |
| Attention heads / KV heads | 32 / 8 |
| Dense attention / sparse attention blocks | 36 / 0 |
| Dense FFN / sparse FFN blocks | 36 / 0 |
| MoE experts / active experts | 0 / 0 |
| MoVA count / active values | 0 / 0 |
| Vocab size | 250,624 |
| Tokenizer metadata | Hugging Face tokenizer files; vocab size 250,624 |
| Checkpoint storage dtype | float32 (FP32) |
| Checkpoint config dtype metadata | float32 |
| Evaluation and sample dtype | bfloat16 (BF16) |
| Shard/index summary | 36 shards |
## Checkpoint Revisions
Each repository uses branches for model stages and stable tags for specific checkpoints. Pin a revision tag when reproducibility matters; use `main` for the default model checkpoint.
| Stage | Branch | Revision tag | Max context | Description |
| --- | --- | --- | --- | --- |
| Base / pretraining | `pretrain` | `base_final` | 8K tokens | Base model checkpoint |
| Midtraining 1 | `mid_1` | `mid_1_final` | 32K tokens | Midtraining 1 checkpoint |
| Midtraining 2 | `mid_2` | `mid_2_final` | 128K tokens | Midtraining 2 checkpoint |
| Midtraining 3 | `mid_3` | `mid_3_final` | 512K tokens | Midtraining 3 checkpoint |
| Midtraining 4 | `mid_4` | `mid_4_final` | 512K tokens | Midtraining 4 checkpoint |
| Default | `main` | `main` | 512K tokens | Default release view of `mid_4_final` |
Example revision pinning:
Show revision pinning example
```python
# Validated with Python 3.14,
# Transformers 4.57.6, and
# Safetensors 0.8.0.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "IFM/K2-Horizon-7B"
revision = "mid_4_final"
tokenizer = AutoTokenizer.from_pretrained(model_id, revision=revision, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
revision=revision,
device_map="auto",
dtype="bfloat16",
low_cpu_mem_usage=True,
trust_remote_code=True,
)
```
## Training Provenance
Each row identifies the last W&B process record associated with the selected checkpoint, together with its Slurm job and exact xLLM source revision. A training stage can span multiple W&B process records when checkpointed training is resumed.
| Stage | Revision | Checkpoint context | xLLM source | W&B last run | Slurm job | Training nodes |
| --- | --- | --- | --- | --- | --- | --- |
| Base / pretraining | `base_final` | 8K tokens | [`be048371`](https://github.com/LLM360/xllm/commit/be04837103a3347fc9df3a0cca97f67a9f3ed7d1) | [`k2v3-7b/9bor93lb`](https://wandb.ai/mbzuai-llm/k2v3-7b/runs/9bor93lb) | `424532` | 76 |
| Midtraining 1 | `mid_1_final` | 32K tokens | [`b69a6b2e`](https://github.com/LLM360/xllm/commit/b69a6b2ed17091dfee8af68a570f78816f765bad) | [`k2v3_midtrain/ai10n1zg`](https://wandb.ai/mbzuai-llm/k2v3_midtrain/runs/ai10n1zg) | `498821` | 76 |
| Midtraining 2 | `mid_2_final` | 128K tokens | [`b69a6b2e`](https://github.com/LLM360/xllm/commit/b69a6b2ed17091dfee8af68a570f78816f765bad) | [`k2v3_midtrain/zzmsg78q`](https://wandb.ai/mbzuai-llm/k2v3_midtrain/runs/zzmsg78q) | `504321` | 76 |
| Midtraining 3 | `mid_3_final` | 512K tokens | [`9ab31836`](https://github.com/LLM360/xllm/commit/9ab3183694cbf36cf77a5c60761576435f550433) | [`k2v3_midtrain/9b0xsnys`](https://wandb.ai/mbzuai-llm/k2v3_midtrain/runs/9b0xsnys) | `504699` | 76 |
| Midtraining 4 | `mid_4_final` | 512K tokens | [`5494c84c`](https://github.com/LLM360/xllm/commit/5494c84cc7a2a66e5d6439bf9aa07454097ce9be) | [`k2v3_midtrain/yv8etz2i`](https://wandb.ai/mbzuai-llm/k2v3_midtrain/runs/yv8etz2i) | `980414` | 76 |
## Training Loss
The chart reconstructs the release checkpoint lineage for Pretraining, Midtraining 1, Midtraining 2, Midtraining 3, Midtraining 4. Training loss is the next-token prediction objective; lower values indicate that the model assigns greater probability to the observed next token. Training loss is not a validation score and should not be compared across different tokenizers or data mixtures without additional controls.

Each panel combines the W&B process records that contribute to the release checkpoint. Faint lines show sampled raw training loss; bold lines show an unpadded centered moving average with a raised-cosine taper over the final half-window. The final sample retains 20% of its base weight, limiting right-edge bias without hiding the raw tail. Checkpoint restart overlap is replaced by the later process record.
## Deployment Guide
These are base checkpoints. They can be served for research, evaluation, retrieval-augmented generation experiments, tool-use research, and downstream adaptation. They are not instruction-aligned assistants by default, so production deployments should add application-level safety filters, system prompting, and task-specific validation.
All reported K2-Horizon evaluation used BF16. Some released checkpoint shards and configuration metadata remain FP32; the examples below explicitly load or serve them as BF16 to match the evaluation runtime and reduce accelerator memory usage.
### Validated Independent Dependency Versions
Use a separate Python environment for every workflow. Direct Transformers loading, xLLM conversion, vLLM, and the pinned SGLang production revision have independent dependency contracts. Do not install one row into another row's environment. Versions intentionally differ when a framework or remote-model contract requires them.
| Workflow | Python | PyTorch | CUDA | Transformers | Safetensors | Attention kernel | Framework revision |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Direct Transformers loading | 3.14 | 2.13.0 | 12.6 | 4.57.6 | 0.8.0 | PyTorch SDPA 2.13.0 | Transformers 4.57.6 remote code |
| xLLM checkpoint conversion | 3.12 | 2.8.0 | 12.8 | 4.57.3 | 0.8.0 | FlashAttention 2.8.3.post1 | xLLM `7cfa3b2c` |
| vLLM serving | 3.12 | 2.13.0 | 12.9 | 5.16.1 | 0.8.0 | FlashInfer 0.6.17 | vLLM 0.26.1rc1.dev1212 source `d9fd5f11` (PR #53806) |
| SGLang serving | 3.12 | 2.9.1 | 12.8 (CUDA Python 12.9) | 5.3.0 | 0.8.0 | FA3 (sglang-kernel 0.4.1); FlashInfer 0.6.7.post2 available | SGLang `ffb41d77` (stable-only metadata) |
### Inference Parameter Starting Points
K2-Horizon does not use one family-wide sampling preset. The values below are operational baselines: temperature 0 is the validated deterministic serving comparison, while sampled settings are conservative starting points that should be tuned on application prompts. Benchmark reproduction must use the decoding configuration attached to that benchmark.
| Use case | Temperature | Top-p | Max new tokens | Notes |
| --- | --- | --- | --- | --- |
| Checkpoint smoke test and deterministic evaluation | 0.0 | 1.0 | 512-4,096 | Greedy decoding is the reproducible baseline used by serving comparisons. |
| Base-model continuation | 0.6 | 0.95 | 1,024-4,096 | A conservative sampling baseline; tune on a held-out prompt set. |
| Long-context continuation or summarization | 0.2 | 0.9 | 2,048-8,192 | Start with one request and increase context only after KV-cache capacity checks. |
| Reasoning and tool-call validation | 0.0 | 1.0 | 4,096 | Use a compatible chat template and the K2Horizon parser stack below. |
### Transformers
The selected default checkpoint is loaded with Transformers 4.57.6 and PyTorch 2.13.0 on CUDA 12.6. Select the corresponding PyTorch build for your accelerator when that CUDA runtime is unavailable. The selected checkpoint uses the self-contained legacy `XllmForCausalLM` remote implementation. Its saved Transformers 4.57.3 contract is compatible with stable 4.57.6, PyTorch SDPA, and no external xLLM or FlashAttention package. xLLM conversion remains isolated below because its native build has a different runtime contract.
Show Transformers installation commands
```bash
python -m pip install "torch==2.13.0" \
--index-url "https://download.pytorch.org/whl/cu126"
python -m pip install \
"transformers==4.57.6" \
"safetensors==0.8.0" \
"accelerate==1.14.0"
```
Show Transformers inference example
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "IFM/K2-Horizon-7B"
REVISION = "mid_4"
tokenizer = AutoTokenizer.from_pretrained(
MODEL_ID,
revision=REVISION,
trust_remote_code=True,
)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
revision=REVISION,
device_map="auto",
dtype="bfloat16",
low_cpu_mem_usage=True,
trust_remote_code=True,
)
prompt = "Explain why long-context evaluation is difficult."
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
inputs.pop("token_type_ids", None)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.7,
top_p=0.9,
do_sample=True,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
### xLLM
xLLM provides the training framework, checkpoint converter, serving bridges, and runtime kernels used by the XLLM-based K2-Horizon repositories. For checkpoint conversion, parity work, or loading a legacy 36B `XllmForCausalLM` stage that imports xLLM MoVA kernels, use the isolated legacy contract and reviewed bridge revision [`7cfa3b2c`](https://github.com/LLM360/xllm/commit/7cfa3b2c61fad3b2ef48f7f7b497ef360087c72f):
Show xLLM setup and conversion commands
```bash
git clone https://github.com/LLM360/xllm.git
cd xllm
git checkout 7cfa3b2c61fad3b2ef48f7f7b497ef360087c72f
python -m pip install "torch==2.8.0" \
--index-url "https://download.pytorch.org/whl/cu128"
export XLLM_BUILD_ROOT="${XLLM_BUILD_ROOT:-$PWD/.xllm-build}"
export TMPDIR="$XLLM_BUILD_ROOT/tmp"
export PIP_CACHE_DIR="$XLLM_BUILD_ROOT/pip-cache"
mkdir -p "$TMPDIR" "$PIP_CACHE_DIR"
python -m pip install packaging ninja
python -m pip install "https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3.post1/flash_attn-2.8.3.post1+cu12torch2.8cxx11abiTRUE-cp312-cp312-linux_x86_64.whl"
python -m pip install -r requirements.txt
python -m pip install -e . --no-build-isolation \
--config-settings editable_mode=compat
python -m pip install \
"transformers==4.57.3" \
"safetensors==0.8.0" \
accelerate fire
python xllm_bridges/huggingface/xllm_to_hf_main.py --help
```
The converter requires an original xLLM distributed checkpoint and tokenizer. Released Hugging Face revisions are already converted and use the pure direct Transformers/SDPA contract above. Install xLLM only for conversion, parity work, or a model-specific native-kernel dependency. Pinning a revision does not make runtime contracts interchangeable.
### vLLM
The example pins [vLLM PR #53806](https://github.com/vllm-project/vllm/pull/53806) at [`d9fd5f11`](https://github.com/vllm-project/vllm/commit/d9fd5f11423a1a5628fe29e7296ceb9de91aac3c). That source registers `K2HorizonForCausalLM` plus the built-in `k2_horizon` reasoning and tool parsers. The command uses vLLM's `transformers` model implementation for this checkpoint contract.
Show vLLM setup and serving commands
```bash
git clone --filter=blob:none --no-checkout \
https://github.com/vllm-project/vllm.git
cd vllm
git fetch origin \
pull/53806/head:refs/remotes/origin/pr-53806
git checkout --detach d9fd5f11423a1a5628fe29e7296ceb9de91aac3c
test "$(git rev-parse HEAD)" = "d9fd5f11423a1a5628fe29e7296ceb9de91aac3c"
python3.12 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip uv
export UV_LINK_MODE=copy
VLLM_USE_PRECOMPILED=1 uv pip install --upgrade --editable . \
--torch-backend=auto
uv pip install \
"transformers==5.16.1" \
"safetensors==0.8.0"
python -m pip check
python - <<'PY'
from vllm import ModelRegistry
from vllm.reasoning import ReasoningParserManager
from vllm.tool_parsers import ToolParserManager
assert "K2HorizonForCausalLM" in ModelRegistry.get_supported_archs()
assert ReasoningParserManager.get_reasoning_parser("k2_horizon") is not None
assert ToolParserManager.get_tool_parser("k2_horizon") is not None
PY
export MODEL_ID="IFM/K2-Horizon-7B"
export MODEL_REVISION="mid_4"
export TENSOR_PARALLEL_SIZE=1
export MAX_MODEL_LEN=131072
vllm serve "$MODEL_ID" \
--revision "$MODEL_REVISION" \
--model-impl transformers \
--tensor-parallel-size "$TENSOR_PARALLEL_SIZE" \
--trust-remote-code \
--dtype bfloat16 \
--served-model-name "$MODEL_ID" \
--max-model-len "$MAX_MODEL_LEN" \
--reasoning-parser k2_horizon \
--enable-auto-tool-choice \
--tool-call-parser k2_horizon
```
The source checkout is immutable at `d9fd5f11423a1a5628fe29e7296ceb9de91aac3c`. The command serves `mid_4`; the repository's longest checkpoint configuration reports 524,288 tokens, while this example starts at 131,072 tokens. Increase context and concurrency only after measuring KV-cache capacity. The preflight fails immediately if the native architecture or either Horizon parser registration is absent.
### SGLang
The SGLang stack is pinned to public commit [`ffb41d77`](https://github.com/LLM360/sglang/commit/ffb41d77d8b96b8a953351cb4d66d6bf4ed061a7). The setup applies a hash-guarded namespace migration to expose the public `K2Horizon` classes and `k2_horizon` parser identifiers, then verifies both registries before launch. That source locks PyTorch 2.9.1, CUDA Python 12.9, Transformers 5.3.0, sglang-kernel 0.4.1, and FlashInfer 0.6.7.post2; the PyTorch wheel uses CUDA 12.8, and Safetensors 0.8.0 is selected independently. Its declared `flash-attn-4` dependency has only beta candidates, so the reproducible install removes exactly that unused metadata line, assigns the stable local version `0.5.10+ffb41d77.stableonly`, and explicitly selects stable FA3 from sglang-kernel. Keep this source-patched stack in its own environment.
Show SGLang setup and serving commands
```bash
git clone https://github.com/LLM360/sglang.git
cd sglang
git checkout ffb41d77d8b96b8a953351cb4d66d6bf4ed061a7
python - <<'PY'
from hashlib import sha256
from pathlib import Path
path = Path("python/pyproject.toml")
source = path.read_text(encoding="utf-8")
if sha256(source.encode()).hexdigest() != "b3c46337e6852f4febc45087e96c26543bab7a1cc835276246290de152a1f532":
raise RuntimeError("unexpected pinned SGLang pyproject hash")
unstable = ' "flash-attn-4>=4.0.0b4",\n'
if source.count(unstable) != 1:
raise RuntimeError(f"unexpected flash-attn-4 metadata in {path}")
patched = source.replace(unstable, "")
if sha256(patched.encode()).hexdigest() != "69a86d23327737ad8cb16e0bb81dde8a1c530d93af997e7af32248a43a2efa1d":
raise RuntimeError("unexpected stable-only SGLang pyproject hash")
path.write_text(patched, encoding="utf-8")
old_class = "K2" + "V3"
old_id = "k2" + "_v3"
old_label = "K2-" + "v3"
contracts = (
(
Path("python/sglang/srt/parser/reasoning_parser.py"),
"8bd1894b7d8c2935d4800e44616ba18c8eebaedde9d7c95c5d270864e928a25c",
"e448c562fd5a994dec67a3ebf5d6539a4acbac0bbc2204d67ba801dd502ca7f5",
),
(
Path("python/sglang/srt/function_call/function_call_parser.py"),
"0957d87b0e5dbcf761dc4871f4e48a7cc1f8c7e0a7badbfb5d3982b10f4d10eb",
"177dabfc3c73461ecbb7da14c4009e4b6c109502a1d6bed65de0dfba6f9e7785",
),
(
Path("python/sglang/srt/function_call/multi_format_detector.py"),
"306d310748ba84d3c2084d111a23fb6e2dead2e316bd0bdf69356b3c6e6eeab1",
"b6e5650366afe8f7abf878172e70bdde527df1e1484514625e49178606ba847e",
),
)
replacements = (
(old_class, "K2Horizon"),
(old_id, "k2_horizon"),
(old_label, "K2-Horizon"),
)
for source_path, original_hash, migrated_hash in contracts:
text = source_path.read_text(encoding="utf-8")
if sha256(text.encode()).hexdigest() != original_hash:
raise RuntimeError(f"unexpected pinned SGLang parser source: {source_path}")
for old, new in replacements:
text = text.replace(old, new)
if sha256(text.encode()).hexdigest() != migrated_hash:
raise RuntimeError(f"unexpected Horizon parser migration: {source_path}")
source_path.write_text(text, encoding="utf-8")
PY
export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SGLANG="0.5.10+ffb41d77.stableonly"
python -m pip install ./python "safetensors==0.8.0"
python -m pip check
python - <<'PY'
from importlib.metadata import metadata, version
from packaging.version import Version
from sglang.srt.function_call.function_call_parser import FunctionCallParser
from sglang.srt.parser.reasoning_parser import ReasoningParser
assert not Version(version("sglang")).is_prerelease
requirements = metadata("sglang").get_all("Requires-Dist") or []
assert not any(requirement.lower().startswith("flash-attn-4") for requirement in requirements)
assert "k2_horizon" in ReasoningParser.DetectorMap
assert "k2_horizon_legacy" in ReasoningParser.DetectorMap
assert "k2_horizon" in FunctionCallParser.ToolCallParserEnum
PY
export MODEL_ID="IFM/K2-Horizon-7B"
export MODEL_REVISION="mid_4"
export TP_SIZE=1
export CONTEXT_LENGTH=131072
python -m sglang.launch_server \
--model-path "$MODEL_ID" \
--revision "$MODEL_REVISION" \
--model-impl transformers \
--tp "$TP_SIZE" \
--trust-remote-code \
--dtype bfloat16 \
--context-length "$CONTEXT_LENGTH" \
--attention-backend fa3 \
--reasoning-parser k2_horizon \
--tool-call-parser k2_horizon \
--mem-fraction-static 0.85 \
--disable-piecewise-cuda-graph
```
The example starts at 131,072 tokens and explicitly selects stable FA3 from sglang-kernel 0.4.1; FlashInfer 0.6.7.post2 remains installed for compatible alternate paths. The source is launched through SGLang's Transformers backend so the repository's self-contained remote code remains the architecture source of truth. Piecewise CUDA graphs are disabled because this experimental path can trigger an illegal-memory-access failure while warming up XLLM MoVA layers; ordinary serving remains available. The installation preflight verifies the migrated `k2_horizon`, `k2_horizon_legacy`, and tool-parser registrations before the server starts.
### Reasoning and Tool Parsers
Parser configuration is part of the deployment contract. The canonical K2-Horizon format uses `` reasoning and tool tokens; test streaming and non-streaming responses before exposing an OpenAI-compatible endpoint.
| Goal | vLLM guidance | SGLang guidance | When to use |
| --- | --- | --- | --- |
| Plain text generation | Do not enable a reasoning or tool parser. | Do not enable a reasoning or tool parser. | Base-model evaluation, completion-style generation, and checkpoint smoke tests. |
| Canonical K2-Horizon reasoning | Use the built-in `--reasoning-parser k2_horizon`. | Use `--reasoning-parser k2_horizon`. | Checkpoints and chat templates using ``, ``, or ``. |
| Canonical K2-Horizon tool calls | Use `--enable-auto-tool-choice --tool-call-parser k2_horizon`. | Use `--tool-call-parser k2_horizon`. | XML, typed-XML, or JSON calls wrapped in ``. |
| Legacy K2 reasoning traces | Use the legacy parser only in a compatibility image that registers it. | Use `--reasoning-parser k2_horizon_legacy`. | Older traces using ``, ``, or `` instead of canonical IFM tokens. |
| Mixed tool-call corpora | Use `multi_format` only in a build that includes and tests that parser. | Use `--tool-call-parser multi_format`. | Evaluation corpora that intentionally mix K2, GLM, or JSON tool-call dialects. |
PR #53806 registers both Horizon parsers in-tree; no external parser plugin is required.
For OpenAI-compatible requests, select reasoning effort through chat-template kwargs:
Show OpenAI-compatible request example
```python
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="unused")
response = client.chat.completions.create(
model="IFM/K2-Horizon-7B",
messages=[{"role": "user", "content": "Explain the result step by step."}],
temperature=0,
max_tokens=4096,
extra_body={"chat_template_kwargs": {"reasoning_effort": "high"}},
)
print(response.choices[0].message)
```
### Other Serving Frameworks
Text Generation Inference, TensorRT-LLM, llama.cpp, Ollama, and LM Studio may require model-specific conversion, quantization, or custom architecture support. Validate tokenizer behavior, remote-code requirements, attention implementation, and long-context behavior before publishing service results.
## Hardware Planning
The table below gives capacity-planning starting points for self-hosted inference. Weight memory uses the parameter count including input and output embeddings. On-disk FP32 shards and dtype conversion can require substantially more host RAM during loading than the final BF16 GPU footprint. KV-cache estimates use BF16 keys and values for one request at the smaller of the model maximum and 128K tokens; batching, allocator overhead, activations, CUDA graphs, and framework workspaces require additional memory.
| Model | Stored params | Active params/token | BF16 weight memory | FP32 weight memory | BF16 KV cache / request | Starting TP | Recommended starting point |
| --- | --- | --- | --- | --- | --- | --- | --- |
| K2-Horizon-0.9B | 0.9B | 0.9B | 2.0 GiB | 4.0 GiB | 0.4 GiB @ 8K tokens | 1 | 1 GPU with 16 GiB is a practical starting point for the model's 8K context; allow additional memory for batching. |
| K2-Horizon-3.7B | 5.06B | 5.06B | 9.4 GiB | 18.8 GiB | 18.0 GiB @ 128K tokens | 1 | 1 GPU with 24 GiB can serve short contexts in BF16; use 48-80 GiB for larger KV caches and 128K-class requests. |
| K2-Horizon-7B | 9.00B | 9.00B | 16.8 GiB | 33.5 GiB | 18.0 GiB @ 128K tokens | 1 | 1 GPU with 40-48 GiB is suitable for short-context BF16 serving; 80 GiB is the practical starting point for 128K-class requests. |
| K2-Horizon-32B | 34.78B | 34.78B | 64.8 GiB | 129.6 GiB | 32.0 GiB @ 128K tokens | 2-4 | 1x 80 GiB fits BF16 weights only at short context; start with 2x 80 GiB for 128K requests and 4x 80 GiB for larger context or throughput. |
| K2-Horizon-36B | 37.44B | 5.95B | 69.7 GiB | 139.5 GiB | 24.0 GiB @ 128K tokens | 2-4 | Use at least 256 GiB of host RAM to load the current 139.5 GiB FP32 shard set. Start with 2x 80 GiB GPUs for BF16 weight sharding, or 1x H200 141 GiB for short single-request validation; use 4x 80 GiB for 128K-class requests. |
| K2-Horizon-375B | 379.17B | 26.67B | 706.3 GiB | 1.38 TiB | 30.5 GiB @ 128K tokens | 8 H200 or 16x 80 GiB | The full 512K profile is validated on 8x H200 141 GiB GPUs at TP=8 and 0.92 memory utilization; use at least 16x 80 GiB GPUs on lower-memory hardware. |
## Evaluation
Benchmark values are reported as percentages unless otherwise noted. A dash means the metric was not reported for that model or revision in the release evaluation records. The family tables below use each model's latest listed midtraining release checkpoint.
### Family Evaluation: Knowledge and Instruction Following
| Model | Revision | IFEval | MMLU-Pro | MMLU | BBH |
| --- | --- | --- | --- | --- | --- |
| K2-Horizon-0.9B | `mid_2_final` | 43.1 | 40.3 | 44.4 | 43.8 |
| K2-Horizon-3.7B | `mid_4_final` | 85.7 | 73.0 | 80.7 | 84.4 |
| K2-Horizon-7B | `mid_4_final` | 89.9 | 75.7 | 83.3 | 87.8 |
| K2-Horizon-32B | `mid_4_final` | 88.0 | 79.5 | 87.5 | 89.1 |
| K2-Horizon-36B | `mid_4_final` | 89.6 | 79.2 | 87.3 | 88.6 |
| K2-Horizon-375B | `mid_4_final` | 92.1 | 82.6 | 89.5 | 87.5 |
### Family Evaluation: STEM, Reasoning, and Coding
| Model | Revision | AIME26 | GPQA-Diamond | GSM8K | MBPP |
| --- | --- | --- | --- | --- | --- |
| K2-Horizon-0.9B | `mid_2_final` | 12.3 | 27.8 | 53.1 | 53.2 |
| K2-Horizon-3.7B | `mid_4_final` | 88.2 | 73.3 | 92.3 | 86.4 |
| K2-Horizon-7B | `mid_4_final` | 87.6 | 73.9 | 95.1 | 91.0 |
| K2-Horizon-32B | `mid_4_final` | 91.7 | 75.4 | 95.5 | 87.8 |
| K2-Horizon-36B | `mid_4_final` | 92.7 | 75.4 | 95.2 | 87.2 |
| K2-Horizon-375B | `mid_4_final` | 92.5 | 84.9 | 95.1 | 93.8 |
### Family Evaluation: Agentic and Long-Context Tasks
| Model | Revision | SWE-Bench Verified (avg@3) | Terminal-Bench 2.1 (avg@3) | GDPval (acc@75%) | Tau3 Banking | BrowseComp+ (acc@1) | Apex Agents (pass@1) | WildClawBench | LCR |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| K2-Horizon-7B | `mid_4_final` | 57.5 | 28.1 | 34.5 | 10.4 | 52.2 | 6.0 | 23.9 | - |
| K2-Horizon-375B | `mid_4_final` | 67.8 | 38.2 | 39.6 | 11.4 | 58.1 | 13.8 | 34.8 | 56.0 |
Agentic results are joined only to exact selected release checkpoints. SWE-Bench Verified and Terminal-Bench 2.1 report three-run averages where available; GDPval reports accuracy at 75 percent; BrowseComp+ reports accuracy at one; Apex Agents reports pass at one. Fractional workbook values are converted to percentages. When a source cell contains multiple reported aggregates, the first aggregate is shown unless the cell contains only three slash-separated trial values, in which case their mean is reported. A dash means the exact release checkpoint has no reported result for that benchmark.
### Family Evaluation: Advanced Research Benchmarks
| Model | Revision | MCP Atlas | HLE | SciCode | OmniScience Accuracy | OmniScience Non-Hallucination | CritPT |
| --- | --- | --- | --- | --- | --- | --- | --- |
| K2-Horizon-7B | `mid_4_final` | 53.6 | 13.8 | - | - | 43.7 | - |
| K2-Horizon-375B | `mid_4_final` | 59.0 | 21.2 | 40.3 | 20.6 | 49.2 | 5.1 |
These results use exact final-stage checkpoint records. Benchmark availability differs by model, so unreported cells remain `-`.
### This Repository: Base / Pretraining Snapshot
| Revision | ArabicMMLU | ARC-C | BBH | GPQA-Diamond-CoT | GSM8K | MMLU | MMLU-Pro | HumanEval | MBPP | IFEval |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| `base_final` | 65.1 | 64.1 | 76.7 | 23.7 | 78.2 | 70.6 | 47.1 | 56.7 | 58.2 | 27.6 |
### This Repository: Midtraining Snapshot
| Revision | IFEval avg | MMLU-Pro | GSM8K | MMLU | BBH | MBPP | AIME26 | GPQA-Diamond | LongBench-v2 | LCR | SWE-Bench Verified | Terminal Bench 2 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| `mid_1_final` | 87.4 | 75.6 | 94.9 | 83.6 | 87.3 | 90.8 | 76.9 | 62.8 | - | - | 25.9 | 12.0 |
| `mid_2_final` | 87.0 | 75.2 | 94.5 | 83.4 | 87.7 | 89.0 | 90.0 | 69.3 | - | - | 47.2 | 20.6 |
| `mid_3_final` | 85.4 | 75.3 | 94.6 | 83.2 | 86.8 | 90.4 | 90.7 | 69.1 | - | - | 46.1 | 25.5 |
| `mid_4_final` | 89.9 | 75.7 | 95.1 | 83.3 | 87.8 | 91.0 | 87.6 | 73.9 | - | - | - | - |
### This Repository: Agentic and Long-Context Results by Stage
| Revision | SWE-Bench Verified | Terminal-Bench | GDPval (acc@75%) | Tau3 Banking | BrowseComp+ | Toolathlon | Apex Agents | LongBench-v2 | LCR |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| `mid_1_final` | 25.9 | 12.0 | 9.1 | - | 10.2 | - | - | - | - |
| `mid_2_final` | 47.2 | 20.6 | 22.7 | - | 46.0 | 6.2 | - | - | - |
| `mid_3_final` | 46.1 | 25.5 | 24.5 | 5.2 | 53.1 | 7.4 | - | - | - |
| `mid_4_final` | 57.5 | 28.1 | 34.5 | 10.4 | 52.2 | - | 6.0 | - | - |
### This Repository: RULER Long-Context Results
| Revision | 4K | 8K | 16K | 32K | 64K | 128K |
| --- | --- | --- | --- | --- | --- | --- |
| `mid_1_final` | 95.8 (13) | 93.6 (13) | 87.9 (13) | - | - | - |
| `mid_2_final` | 93.3 (15) | 91.4 (15) | 90.7 (15) | 87.9 (15) | 80.3 (15) | - |
RULER scores are macro-averages over the non-empty task columns in the exact checkpoint row. The number of contributing tasks is shown in parentheses.
## Datasets and Mixtures
K2-Horizon training is organized around transparent data releases:
- Pretraining data: [IFM/K2-Horizon-Pretrain-Data](https://huggingface.co/datasets/IFM/K2-Horizon-Pretrain-Data), derived from the TxT360 lineage.
- Midtraining data: [IFM/K2-Horizon-Midtrain-Data](https://huggingface.co/datasets/IFM/K2-Horizon-Midtrain-Data), following the TxT360-Midas reasoning and long-context release pattern.
- The public data-preparation lineage is maintained in [LLM360/TxT360](https://github.com/LLM360/TxT360).
## Source Code
- [LLM360/xllm](https://github.com/LLM360/xllm) - Training framework and Hugging Face/vLLM bridges. Per-stage training commits are linked in the provenance table.
- [LLM360/Eval360-V2 at `f5081bfb`](https://github.com/LLM360/Eval360-V2/commit/f5081bfba9ef8e7b380f5bd85ed1cf61a91f90b0) - Evaluation harness revision reviewed against the release benchmark workbooks.
- [LLM360/agent-evals at `f3788399`](https://github.com/LLM360/agent-evals/commit/f3788399a974e49121984f11556138f23f907cee) - Agentic benchmark harness, Slurm launchers, and serving profiles used to reconcile the agentic release results.
- [vLLM PR #53806 at `d9fd5f11`](https://github.com/vllm-project/vllm/commit/d9fd5f11423a1a5628fe29e7296ceb9de91aac3c) - Native K2-Horizon architecture plus built-in reasoning and tool parsers used by the serving example.
- [LLM360/Inference360 at `a7ee94f9`](https://github.com/LLM360/Inference360/commit/a7ee94f9ad9a561e65a67ede22d4e7a2c8428b57) - Serving-image and deployment-validation references.
- [LLM360/sglang at `ffb41d77`](https://github.com/LLM360/sglang/commit/ffb41d77d8b96b8a953351cb4d66d6bf4ed061a7) - SGLang serving base used by the hash-guarded K2-Horizon namespace migration.
- [LLM360/TxT360](https://github.com/LLM360/TxT360) - Public data-preparation and source-data lineage reference.
## Intended Use
K2-Horizon-7B is intended for open research on foundation models, transparent evaluation, staged checkpoint analysis, downstream fine-tuning, and reproducibility studies. It is suitable for researchers and developers who want to inspect training-stage behavior, serve a model privately, compare model sizes, or build downstream adaptations.
## Limitations and Safety
- This is a base checkpoint family and may produce inaccurate, biased, unsafe, or hallucinated content.
- The model is not optimized for moderation, refusal behavior, or production assistant safety.
- Long-context behavior depends on serving stack, prompt construction, retrieval quality, and KV-cache configuration.
- Tool-use and agentic results depend heavily on parser format, prompt template, tool schema, and execution harness.
- The model family is documented primarily with English-language evaluations; additional multilingual evaluation should be performed before broad multilingual claims.
- Users are responsible for complying with the model license and for validating deployments in their own risk domain.
## Citation
Please cite this model as:
```bibtex
@misc{ifmk2horizon7b2026,
title = {K2-Horizon Model Family: K2-Horizon-7B},
author = {IFM Team},
year = {2026},
url = {https://huggingface.co/IFM/K2-Horizon-7B},
}
```
## Contact
For questions about this release, contact the IFM / K2-Horizon team through the model repository or the IFM organization.