Instructions to use UraionLabs/K2-Horizon-7B-oQ4e with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use UraionLabs/K2-Horizon-7B-oQ4e with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("UraionLabs/K2-Horizon-7B-oQ4e") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use UraionLabs/K2-Horizon-7B-oQ4e with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "UraionLabs/K2-Horizon-7B-oQ4e"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "UraionLabs/K2-Horizon-7B-oQ4e" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use UraionLabs/K2-Horizon-7B-oQ4e with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "UraionLabs/K2-Horizon-7B-oQ4e"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "UraionLabs/K2-Horizon-7B-oQ4e" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "UraionLabs/K2-Horizon-7B-oQ4e", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use UraionLabs/K2-Horizon-7B-oQ4e with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "UraionLabs/K2-Horizon-7B-oQ4e"
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:8080/v1 hermes config set model.default UraionLabs/K2-Horizon-7B-oQ4e
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use UraionLabs/K2-Horizon-7B-oQ4e with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "UraionLabs/K2-Horizon-7B-oQ4e"
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:8080/v1 \ --custom-model-id "UraionLabs/K2-Horizon-7B-oQ4e" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- K2-Horizon-7B — oQ4e
- About This Quantization
- Model Information
- Why oQ4e?
- Upstream K2-Horizon-7B Highlights
- Benchmark Results
- Quantization and Benchmark Disclaimer
- Quickstart
- Hugging Face Download
- Using mlx-lm
- OpenAI-Compatible Serving
- Recommended Generation Settings
- Reasoning Format
- Tool Calling
- Upstream vLLM Example
- Upstream SGLang Example
- Training Overview
- Progressive Context Extension
- Reinforcement Learning Experts
- Training Data
- Quantization vs. Training
- Quantization Metadata
- Practical Context Length
- Intended Use
- Limitations
- Disclaimer
- Original Model and Attribution
- Upstream Resources
- License
- Citation
- About This Quantization
Uraion Labs
Foundational systems research.
K2-Horizon-7B — oQ4e
An MLX oQ4e mixed-precision quantization of IFM/K2-Horizon-7B for efficient local inference on Apple Silicon, quantized and published by Uraion Labs.
K2-Horizon-7B-oQ4e is an MLX mixed-precision quantization of IFM/K2-Horizon-7B, optimized for efficient local inference on Apple Silicon Macs.
This checkpoint was quantized and published by Uraion Labs using the oMLX oQe quantization workflow.
The oQ4e configuration targets a substantially smaller memory and storage footprint than higher-precision variants while retaining additional precision for model components identified as more quantization-sensitive by the oQe workflow.
The checkpoint uses the standard MLX model format and is intended primarily for oMLX and compatible MLX inference runtimes.
The underlying K2-Horizon architecture, tokenizer, chat template, reasoning behavior, tool-use format, and native 524,288-token context architecture originate from the upstream IFM model.
About This Quantization
- Quantization Level:
oQ4e - Quantization Workflow: oMLX oQe mixed-precision quantization
- Base Weight Precision: 4-bit
- Base Model:
IFM/K2-Horizon-7B - Model Class: 7B dense decoder-only
- Quantization Strategy: sensitivity-aware mixed precision
- Target Runtime: Apple Silicon macOS
- Storage Format: MLX safetensors
- Quantized By: Uraion Labs
- Native Context Architecture: 524,288 tokens
- Reasoning Support: inherited from upstream
- Tool Calling: inherited from upstream
- License: Apache-2.0
Exact layer overrides, effective bits per weight, group size, calibration statistics, output-head precision, and final repository size should be taken directly from the oMLX quantization report for this checkpoint.
Model Information
| Property | Value |
|---|---|
| Original Model | IFM/K2-Horizon-7B |
| Quantization Variant | oQ4e |
| Quantized By | Uraion Labs |
| Quantization Tooling | oMLX |
| Quantization Workflow | oQe mixed precision |
| Architecture | Dense decoder-only language model |
| Model Class | 7B |
| Base Weight Precision | 4-bit |
| Mixed Precision | Yes |
| Context Length | 524,288 tokens |
| Reasoning | K2-Horizon reasoning format |
| Tool Calling | K2-Horizon tool-call format |
| Storage Format | MLX safetensors |
| Target Platform | Apple Silicon macOS |
| Intended Runtime | omlx, MLX-compatible runtimes |
| License | Apache-2.0 |
Why oQ4e?
The oQ4e variant is intended to provide a stronger balance between:
- model quality,
- memory footprint,
- storage footprint,
- inference throughput,
- and practical local deployment.
Rather than uniformly quantizing every eligible model component to the same precision, the oQe workflow can retain additional precision for tensors that are more sensitive to quantization.
This makes oQ4e particularly suitable for users who want to run K2-Horizon-7B locally without the larger memory footprint of an 8-bit checkpoint.
The exact quality/performance trade-off should be measured against the final quantized artifact rather than inferred from nominal bit width alone.
Upstream K2-Horizon-7B Highlights
K2-Horizon-7B is developed by IFM as the medium dense member of the K2-Horizon family.
7B Dense Architecture
K2-Horizon-7B is a 7B-class dense decoder-only language model evaluated across:
- mathematical reasoning,
- software engineering,
- scientific reasoning,
- scientific coding,
- long-context reasoning,
- terminal use,
- tool use,
- search,
- and agentic workflows.
Native 512K Context
The model supports a native context architecture of:
524,288 tokens
IFM progressively extended context during midtraining through:
8K → 32K → 128K → 512K
Practical usable context during local inference depends on available unified memory, KV-cache configuration, runtime implementation, prompt size, and concurrent workload.
Agentic Capabilities
The upstream model was evaluated on benchmarks including:
- SWE-bench Verified
- Terminal-Bench 2.1
- tau3-Banking
- BrowseComp
- SciCode
- LCR
- HLE
- HMMT
Reasoning Control
K2-Horizon supports request-level reasoning effort through its chat template.
IFM recommends:
{
"chat_template_kwargs": {
"reasoning_effort": "high"
}
}
Tool Calling
The upstream model supports structured tool-use formats including:
json
xml
xml_typed
The upstream default format is:
xml
Benchmark Results
The results below are reported by IFM for the original K2-Horizon-7B checkpoint. They are not independent benchmark results for this Uraion Labs oQ4e quantization.
| Capability | Benchmark | K2-Horizon-7B | Reference Models |
|---|---|---|---|
| Math | HMMT Feb 2026 | 73.3 | Gemma 4-12B: 63.1 · Qwen3.5-9B: 65.7 · Granite 4.2-8B: 66.5 |
| Coding | SWE-bench Verified | 70.6 | Gemma 4-12B: 30.6 · Granite 4.2-8B: 47.7 · Qwen3.5-9B: 50.8 |
| Scientific Reasoning | HLE | 18.6 | Granite 4.2-8B: 9.7 · Qwen3.5-9B: 14.9 · Gemma 4-12B: 15.7 |
| Scientific Coding | SciCode | 31.6 | Qwen3.5-9B: 27.5 · Mistral Small 4: 28.0 · Granite 4.2-8B: 30.4 |
| Long Context | LCR | 68.0 | Granite 4.2-8B: 43.3 · Gemma 4-12B: 61.7 · Qwen3.5-9B: 65.3 |
| Agentic Coding | Terminal-Bench 2.1 | 39.1 | Granite 4.2-8B: 18.4 · Gemma 4-12B: 27.3 · Qwen3.5-9B: 29.2 |
| Tool Use | tau3-Banking | 25.8 | Qwen3.5-9B: 7.0 · Granite 4.2-8B: 7.6 · Muse Glimmer-30B: 24.0 |
| Web Search | BrowseComp | 59.0 | DeepSeek V4 Flash-0423: 53.5 · GPT-5: 54.9 · LongCat Flash Thinking-2601: 56.6 |
For BrowseComp, IFM reports that K2-Horizon-7B uses the Discard-all@95k context-length protocol proposed in the DeepSeek-V3.2 technical report.
Comparison models may have been evaluated using different harnesses or inference configurations.
Quantization and Benchmark Disclaimer
Quantization changes numerical precision and may affect model behavior.
The upstream scores above therefore should not be interpreted as measured scores for:
K2-Horizon-7B-oQ4e
Possible differences may occur in:
- reasoning accuracy,
- code generation,
- tool-call formatting,
- long-context retrieval,
- instruction following,
- structured output,
- perplexity,
- and generation stability.
Independent benchmarking of the final oQ4e checkpoint is recommended when exact quality retention matters.
Quickstart
Using oMLX
oMLX is the primary intended inference runtime for this release on Apple Silicon.
Install oMLX:
pip install omlx
Run the model:
omlx run UraionLabs/K2-Horizon-7B-oQ4e \
--prompt "Explain why long-context reasoning is difficult."
Hugging Face Download
Download the repository locally with:
hf download UraionLabs/K2-Horizon-7B-oQ4e
Using mlx-lm
If the final checkpoint is compatible with the installed version of mlx-lm, install it with:
pip install mlx-lm
Python Example
from mlx_lm import load, generate
model_id = "UraionLabs/K2-Horizon-7B-oQ4e"
model, tokenizer = load(model_id)
messages = [
{
"role": "user",
"content": "Explain why long-context evaluation is difficult."
}
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
response = generate(
model,
tokenizer,
prompt=prompt,
max_tokens=32768,
temp=1.0,
top_p=0.95,
verbose=True,
)
print(response)
Verify
mlx-lmcompatibility against the final checkpoint and runtime version. oMLX remains the intended runtime for this release.
OpenAI-Compatible Serving
When serving through an oMLX OpenAI-compatible endpoint, use:
UraionLabs/K2-Horizon-7B-oQ4e
For example, an OpenAI-compatible client can connect to the server exposed by your local oMLX deployment.
from openai import OpenAI
client = OpenAI(
base_url="http://127.0.0.1:8000/v1",
api_key="omlx",
)
response = client.chat.completions.create(
model="UraionLabs/K2-Horizon-7B-oQ4e",
messages=[
{
"role": "user",
"content": "Explain speculative decoding in simple terms."
}
],
temperature=1.0,
top_p=0.95,
max_tokens=32768,
)
print(response.choices[0].message.content)
The exact local URL, port, API key, and served model identifier depend on the user's oMLX configuration.
Recommended Generation Settings
IFM recommends the following configuration for the original K2-Horizon-7B model:
| Parameter | Recommended Value | Notes |
|---|---|---|
reasoning_effort |
high |
Used for upstream reported evaluations |
temperature |
1.0 |
Recommended sampling temperature |
top_p |
0.95 |
Nucleus sampling |
| Output Budget | >= 32,768 tokens |
Avoid reasoning truncation |
Recommended upstream sampling configuration:
{
"temperature": 1.0,
"top_p": 0.95,
"max_tokens": 32768
}
Recommended reasoning configuration:
{
"chat_template_kwargs": {
"reasoning_effort": "high"
}
}
Lower reasoning-effort settings may reduce latency and output length at the cost of capability.
Reasoning Format
K2-Horizon separates internal reasoning output and normal response content when used with runtimes that support its dedicated parser.
The upstream serving configuration uses:
k2_horizon
as the reasoning parser.
For example, upstream vLLM configurations use:
--reasoning-parser k2_horizon
Whether reasoning is exposed separately through oMLX depends on runtime support and API configuration.
Tool Calling
K2-Horizon supports multiple tool-call formats.
Supported upstream formats are:
json
xml
xml_typed
The default is:
xml
When using runtimes that implement the upstream K2 parser, IFM recommends:
--tool-call-parser k2_horizon
For oMLX deployments, preserve the original tokenizer and chat template wherever possible.
Do not substitute a generic chat template unless the replacement has been specifically validated for:
- reasoning,
- tool calling,
- multi-turn conversations,
- structured output,
- and agentic workloads.
Upstream vLLM Example
The original BF16 checkpoint can be served using IFM's recommended vLLM configuration:
vllm serve IFM/K2-Horizon-7B \
--trust-remote-code \
--dtype bfloat16 \
--tensor-parallel-size 1 \
--reasoning-parser k2_horizon \
--enable-auto-tool-choice \
--tool-call-parser k2_horizon
This command applies to the original upstream checkpoint, not this MLX quantization.
It is included to document the model's intended reasoning and tool-calling configuration.
Upstream SGLang Example
IFM also provides a validated SGLang configuration for the original model:
sglang serve \
--model-path IFM/K2-Horizon-7B \
--revision 69ada542b68fe13d767479db2ab9421baff88681 \
--tp 1 \
--dtype bfloat16 \
--attention-backend fa3 \
--reasoning-parser k2_horizon \
--host 0.0.0.0 \
--port 30000
Again, this is provided for upstream reference and does not apply directly to the MLX-formatted oQ4e release.
Training Overview
Uraion Labs did not train K2-Horizon-7B.
The following training information describes the upstream IFM model.
K2-Horizon-7B was produced through a multi-stage curriculum consisting of:
- large-scale pretraining,
- progressive long-context extension,
- specialist reinforcement learning,
- expert merging,
- supervised fine-tuning.
Upstream Training Stages
| Training Stage | Steps | Additional Tokens | Sequence Length | Purpose |
|---|---|---|---|---|
| Pretraining | 1,100,000 | 22.9T | 8K | General pretraining |
| Midtraining — Stage 1 | 55,000 | 1.1T | 32K | Context extension |
| Midtraining — Stage 2 | 25,000 | 498B | 128K | Context extension |
| Midtraining — Stage 3 | 5,500 | 110B | 512K | Context extension |
| Midtraining — Stage 4 | 10,000 | 199B | 512K | Agentic + reasoning-oriented continuation |
| RL — Math Expert | 2,399 | 29.1B | 64K | Mathematical reasoning RL |
| RL — Code Expert Stage 1 | 601 | 6.2B | 64K | Code RL |
| RL — Code Expert Stage 2 | 1,499 | 12.3B | 64K | Broader code RL |
| RL — Search Expert | 59 | 8.4B | — | Search-agent RL |
| RL — Tool-Use Expert | 39 | 1.4B | — | Tool-use RL |
| RL — Merge | — | — | — | Specialist-model merge |
| SFT — Phase 1 | 10,000 | 199B | 512K | Domain coverage |
| SFT — Phase 2 | 2,500 | 50B | 512K | High-quality SFT + LR decay |
Progressive Context Extension
The original model's context length was extended progressively during midtraining:
Pretraining
8K
↓
Midtraining Stage 1
32K
↓
Midtraining Stage 2
128K
↓
Midtraining Stage 3
512K
↓
Midtraining Stage 4
512K
This differs from simply modifying a RoPE or runtime context parameter after training: the model received additional training at progressively longer sequence lengths.
Reinforcement Learning Experts
During upstream RL, IFM branched training into specialized models.
These included:
- Math expert
- Code expert
- Search expert
- Tool-use expert
The final RL model was produced using a merge that incorporated:
Midtraining Stage 4
+
Math Expert
+
Code Expert Stage 2
+
Search Expert
+
Tool-Use Expert
↓
RL Merged Model
↓
SFT Phase 1
↓
SFT Phase 2
The released K2-Horizon-7B checkpoint follows this broader training lineage.
Training Data
Training-data metadata is inherited from the upstream IFM release.
Referenced upstream datasets include:
IFM/K2-Horizon-Pretrain-DataIFM/K2-Horizon-Midtrain-Data
Uraion Labs did not create or modify these datasets as part of this quantization.
This repository represents a quantized derivative of the released model weights rather than a retrained model.
Quantization vs. Training
The roles of IFM and Uraion Labs are distinct.
IFM
IFM:
- designed K2-Horizon,
- trained K2-Horizon-7B,
- performed pretraining,
- performed long-context midtraining,
- performed reinforcement learning,
- trained specialist models,
- merged the RL experts,
- performed supervised fine-tuning,
- produced the original model weights,
- and reported the upstream benchmark results.
Uraion Labs
Uraion Labs:
- started from the released
IFM/K2-Horizon-7Bcheckpoint, - converted the checkpoint for MLX deployment,
- quantized the model using oMLX,
- used the oQe mixed-precision workflow,
- produced this
oQ4evariant, - and published the Apple Silicon-oriented derivative.
Uraion Labs did not retrain the underlying model as part of this release.
No capability improvement over the upstream model should be inferred from the quantization itself.
Quantization Metadata
Known metadata for this release:
| Property | Value |
|---|---|
| Quantization | oQ4e |
| Tooling | oMLX |
| Workflow | oQe |
| Base Precision | 4-bit |
| Allocation | Mixed precision |
| Platform | Apple Silicon |
| Format | MLX safetensors |
| Original Model | IFM/K2-Horizon-7B |
| Quantized By | Uraion Labs |
The following values should be inserted directly from the final oMLX quantization report:
| Property | Value |
|---|---|
| Exact Mixed-Precision Profile | TBD from oMLX report |
| 5-bit Layer Overrides | TBD from oMLX report |
| 6-bit Layer Overrides | TBD from oMLX report |
| 8-bit Layer Overrides | TBD from oMLX report |
lm_head Precision |
TBD from oMLX report |
| Group Size | TBD from oMLX report |
| Quantization Mode | TBD from oMLX report |
| Non-Quantized Tensor Precision | TBD from oMLX report |
| Calibration Dataset | TBD from oMLX report |
| Calibration Sample Count | TBD from oMLX report |
| Model Weight Size | TBD from final artifact |
| Effective Bits per Weight | TBD from oMLX report |
These values are deliberately not inferred from other oQ4e releases because oQe's mixed-precision allocation can differ between model architectures and calibration runs.
Practical Context Length
Although the architecture supports:
524,288 tokens
the maximum practical context on a particular Mac depends heavily on:
- total unified memory,
- memory available to the GPU,
- model weight footprint,
- KV-cache precision,
- KV-cache implementation,
- runtime overhead,
- number of concurrent requests,
- prompt length,
- output reservation,
- and macOS memory pressure.
Quantizing model weights reduces the static weight footprint but does not eliminate the memory cost of very large KV caches.
Users should therefore distinguish between:
architectural context support
and
context that can practically be served within available memory.
Intended Use
This quantization is intended for:
- local LLM inference,
- Apple Silicon deployments,
- coding assistants,
- agent runtimes,
- tool-calling applications,
- long-context experimentation,
- local search agents,
- terminal agents,
- reasoning workloads,
- development environments,
- research,
- and edge deployment experiments.
Limitations
Quantization Loss
The oQ4e checkpoint uses substantially reduced numerical precision compared with the original BF16 model.
This can introduce quality degradation.
The amount of degradation may vary across capabilities.
Potentially sensitive workloads include:
- complex mathematical reasoning,
- long chains of reasoning,
- long-context retrieval,
- exact structured generation,
- software engineering,
- tool-call syntax,
- rare-token generation,
- and multilingual output.
Benchmark Transfer
The benchmark scores shown in this model card belong to the upstream IFM checkpoint.
They should not be treated as measured oQ4e results.
Runtime Differences
Generation behavior can differ depending on:
- runtime,
- sampler implementation,
- chat-template implementation,
- reasoning-parser support,
- context handling,
- quantized kernels,
- and generation parameters.
Hallucination
This model can produce:
- incorrect facts,
- unsupported claims,
- invalid code,
- incorrect tool calls,
- fabricated citations,
- and misleading reasoning.
Outputs should be independently verified when correctness matters.
Disclaimer
This model generates text based on statistical language-modeling patterns.
Responses involving specialized or consequential domains should not be treated as a substitute for qualified professional judgment.
Users are responsible for:
- validating outputs,
- implementing appropriate guardrails,
- testing the model for their intended application,
- and complying with applicable laws, licenses, regulations, and policies.
The model is provided AS IS, without warranty of any kind, express or implied.
Original Model and Attribution
This repository contains an MLX quantized derivative of:
K2-Horizon-7B was developed and trained by IFM.
The following originate from the upstream K2-Horizon release:
- architecture,
- tokenizer,
- model training,
- pretraining data,
- midtraining,
- long-context training,
- reinforcement learning,
- supervised fine-tuning,
- reasoning behavior,
- tool-use behavior,
- benchmark results,
- and original model weights.
Uraion Labs performed the MLX/oMLX quantization and publication of this oQ4e derivative.
Upstream Resources
- Original Model: IFM/K2-Horizon-7B
- K2 Horizon Blog: Introducing K2 Horizon
- Training Logs: Weights & Biases
- Training Code: ifm-ai/xllm
- SGLang Cookbook: K2-Horizon
License
The underlying K2-Horizon-7B model is released under the Apache License 2.0.
This quantized derivative retains the applicable upstream licensing terms.
Users should review the original model repository and license before redistribution or deployment.
Citation
Please cite the original K2-Horizon work when referencing the underlying model:
@misc{k2horizon2026,
title = {Introducing K2 Horizon: Frontier Performance, Radically Open},
author = {{IFM Team}},
year = {2026},
url = {https://ifm.ai/blog/k2/},
}
Quantized and published by Uraion Labs using oMLX · Foundational systems research.
- Downloads last month
- 167
4-bit
Model tree for UraionLabs/K2-Horizon-7B-oQ4e
Base model
IFM/K2-Horizon-7B