Text Generation
Transformers
Safetensors
English
k2_horizon
k2-horizon
7b
dense
open-weights
ifm
conversational
custom_code
Instructions to use IFM/K2-Horizon-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IFM/K2-Horizon-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IFM/K2-Horizon-7B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("IFM/K2-Horizon-7B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IFM/K2-Horizon-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IFM/K2-Horizon-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/K2-Horizon-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/IFM/K2-Horizon-7B
- SGLang
How to use IFM/K2-Horizon-7B 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 "IFM/K2-Horizon-7B" \ --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": "IFM/K2-Horizon-7B", "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 "IFM/K2-Horizon-7B" \ --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": "IFM/K2-Horizon-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use IFM/K2-Horizon-7B with Docker Model Runner:
docker model run hf.co/IFM/K2-Horizon-7B
| { | |
| "aurora_commit": "e47c5555caa987ded29dba0624d3de1b34cf6162", | |
| "aurora_repo": "/mnt/weka/home/mrunner/workspace/code/eval360-v2/runtime/eval-runtime/releases/20260825T235203Z-e47c5555caa9-646960/repo/vendor/xllm-dataloader1", | |
| "completed_utc": "2026-09-02T19:23:56Z", | |
| "converter": "/mnt/weka/home/mrunner/workspace/code/tools/conversion_aurora2horizon/convert_k2aurora_to_k2horizon.py", | |
| "horizon_commit": "42ae4f88016b083a8f514655d93521d6af006de9", | |
| "horizon_repo": "/mnt/weka/home/mrunner/workspace/code/eval360-v2/runtime/eval-runtime/releases/20260825T235203Z-e47c5555caa9-646960/repo/vendor/xllm-dataloader1-horizon", | |
| "output_checkpoint": "/mnt/weka/home/mrunner/workspace/checkpoints/k2horizon_bf16_safetensors/k2v3-7B_iso_attn_shared_small_phase2_sft_38n_2251790/checkpoints/checkpoint_0002500", | |
| "schema_version": 1, | |
| "source_checkpoint": "/mnt/weka/shrd/k2m/junlin.chen/ckpts/k2v3-7B_iso_attn_shared_small_phase2_sft_38n_2251790/huggingface/checkpoint_0002500_k2aurora_bf16_safetensors", | |
| "source_hashes": { | |
| "config.json": "c04cacb14be30d630f0bd40c63bf0da63ffcebe89bbb5d5471093a9d1ce911a0", | |
| "configuration_k2_aurora.py": "90efba266ef94d3959e7f490e56146da48225e4539cca87ed6fcfea77872ce6d", | |
| "model.safetensors.index.json": "62dae1eff09ec0983d9f52f486caeb65bc79d2ff0d7df966c523b06d775fc609", | |
| "modeling_k2_aurora.py": "aa6e3ea27c90eca3a88b7fcfaa0aa5235c6ac22e45e33ea4f0a613dc07821924" | |
| }, | |
| "source_model_type": "k2_aurora", | |
| "target_hashes": { | |
| "config.json": "142a40a899c1b72ea4b4730036041f9adc109d8f14186ad96ae5ccf02aff0be1", | |
| "configuration_k2_horizon.py": "5c2f993c1053d9462ebea6dea416c897fddfbb4a5edd904e486936b20d4badc5", | |
| "model.safetensors.index.json": "62dae1eff09ec0983d9f52f486caeb65bc79d2ff0d7df966c523b06d775fc609", | |
| "modeling_k2_horizon.py": "fb09e010956bd51cfa7d4055b4381cff34c9e06164066b49e3546f38b2e6242f" | |
| }, | |
| "target_model_type": "k2_horizon", | |
| "weight_mode": "copy", | |
| "weights": { | |
| "dtypes": [ | |
| "BF16" | |
| ], | |
| "filenames": [ | |
| "pytorch_model-00001-of-00036.safetensors", | |
| "pytorch_model-00002-of-00036.safetensors", | |
| "pytorch_model-00003-of-00036.safetensors", | |
| "pytorch_model-00004-of-00036.safetensors", | |
| "pytorch_model-00005-of-00036.safetensors", | |
| "pytorch_model-00006-of-00036.safetensors", | |
| "pytorch_model-00007-of-00036.safetensors", | |
| "pytorch_model-00008-of-00036.safetensors", | |
| "pytorch_model-00009-of-00036.safetensors", | |
| "pytorch_model-00010-of-00036.safetensors", | |
| "pytorch_model-00011-of-00036.safetensors", | |
| "pytorch_model-00012-of-00036.safetensors", | |
| "pytorch_model-00013-of-00036.safetensors", | |
| "pytorch_model-00014-of-00036.safetensors", | |
| "pytorch_model-00015-of-00036.safetensors", | |
| "pytorch_model-00016-of-00036.safetensors", | |
| "pytorch_model-00017-of-00036.safetensors", | |
| "pytorch_model-00018-of-00036.safetensors", | |
| "pytorch_model-00019-of-00036.safetensors", | |
| "pytorch_model-00020-of-00036.safetensors", | |
| "pytorch_model-00021-of-00036.safetensors", | |
| "pytorch_model-00022-of-00036.safetensors", | |
| "pytorch_model-00023-of-00036.safetensors", | |
| "pytorch_model-00024-of-00036.safetensors", | |
| "pytorch_model-00025-of-00036.safetensors", | |
| "pytorch_model-00026-of-00036.safetensors", | |
| "pytorch_model-00027-of-00036.safetensors", | |
| "pytorch_model-00028-of-00036.safetensors", | |
| "pytorch_model-00029-of-00036.safetensors", | |
| "pytorch_model-00030-of-00036.safetensors", | |
| "pytorch_model-00031-of-00036.safetensors", | |
| "pytorch_model-00032-of-00036.safetensors", | |
| "pytorch_model-00033-of-00036.safetensors", | |
| "pytorch_model-00034-of-00036.safetensors", | |
| "pytorch_model-00035-of-00036.safetensors", | |
| "pytorch_model-00036-of-00036.safetensors" | |
| ], | |
| "index_sha256": "62dae1eff09ec0983d9f52f486caeb65bc79d2ff0d7df966c523b06d775fc609", | |
| "logical_bytes": 17998356480, | |
| "physical_bytes": 17998393584, | |
| "shards": 36, | |
| "tensors": 327 | |
| }, | |
| "weights_reencoded": false | |
| } | |