/ Модель

Характеристики

Контекст
524 288 токенов
Параметры
4,1 млрд
Размер весов
10,1 ГБ
Лицензия
Apache 2.0
Архитектура
k2_horizon · dense
Базовая модель
K2-Horizon-3.7B
Библиотека
mlx
Опубликована
29 сен 2026

K2-Horizon-3.7B-bf16

Генерация текстаТекст → текст15 профессий

MLX-конверсия плотной языковой модели IFM K2-Horizon-3.7B для генерации текста и диалогов на компьютерах Apple с контекстом до 524 288 токенов.

453скачиваний за 30 дней0лайковвеса обновлены30 сен 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

MLX-версия модели K2-Horizon-3.7B от IFM, подготовленная сообществом mlx-community для компьютеров Apple с Apple Silicon. Это плотная авторегрессионная языковая модель с 3,7 млрд параметров и контекстом 524 288 токенов, предназначенная для генерации текста и диалогов. Сборка использует веса bf16 без квантизации и формат safetensors; размер на диске — около 10,1 ГБ.

Модель подходит для ответов на вопросы, рассуждений, программирования и агентных сценариев в приложениях на базе MLX. Реализация архитектуры K2-Horizon поставляется вместе с репозиторием, поскольку поддержка этой архитектуры в mlx-lm может зависеть от версии библиотеки. Для запуска требуется mlx-lm; в некоторых версиях необходимо разрешить загрузку удалённого кода. Длинный контекст требует значительной дополнительной памяти для KV-кэша. Конвертация сверялась с реализацией IFM на PyTorch. Лицензия — Apache-2.0.

Сценарии применения

  • диалоговые ответы и чат на локальном Mac
  • ответы на вопросы по длинному текстовому контексту
  • генерация и объяснение программного кода
  • решение задач на рассуждение и математику
  • локальные агентные сценарии на базе языковой модели

Ограничения

Для запуска нужна совместимая версия mlx-lm и поддержка архитектуры K2-Horizon; в некоторых версиях требуется разрешить загрузку удалённого кода. Работа с длинным контекстом заметно увеличивает расход памяти из-за KV-кэша.

Для каких профессий подходит15

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

K2-Horizon-3.7B (MLX, bf16)

Unquantized bf16 MLX conversion of IFM/K2-Horizon-3.7B, converted from revision 943ce4e. 10.1 GB on disk. For Apple silicon.

K2-Horizon-3.7B is IFM's small dense K2-Horizon model: a 3.7B decoder-only model with a 512K (524,288-token) context window.

Requirements

mlx-lm doesn't support the k2_horizon architecture yet. There's an open request: mlx-lm#1876. Until support lands, this repo ships the MLX model code (k2_horizon.py), which mlx-lm loads through the model_file entry in config.json. So the released mlx-lm works as-is:

pip install -U mlx-lm

Pass --trust-remote-code (or trust_remote_code=True). mlx-lm 0.31.3 loads the file without it, but newer versions require it. The file runs on your machine, so read it first if you like; its comments describe how it differs from IFM's PyTorch code.

Once K2-Horizon support lands in a released mlx-lm, this repo will be updated to use it. If something breaks after that, open a discussion here asking for a re-upload.

How it was converted

mlx_lm.convert --dtype bfloat16 with the K2-Horizon model code described below. No quantization; the weights are the original bf16 values.

Memory

Peak 10.2 GB for a short prompt; fits a 24 GB Mac. The KV cache adds about 144 KB per token in bf16 (18.0 GB at 128K tokens), so long contexts need more memory; --max-kv-size and KV-cache quantization (--kv-bits 8, where available) reduce it.

Conversion check

The MLX implementation was checked against IFM's PyTorch code (modeling_k2_horizon.py) in fp32 on the real weights of this model:

  • Layer by layer, all 36 layers match to a relative error of 4e-6 or better, and the next-token predictions agree at every position.
  • Token by token: the full model in fp32 greedily generated with the KV cache, and the PyTorch model picked the same token at every step (256/256 tokens across English, code, math and Chinese prompts). Cached and uncached outputs also agree at every step.

Smoke-tested after conversion with released mlx-lm 0.31.3: 17 * 23 → 391 and "capital of Australia" → Canberra, both ending normally. On a Mac Studio M4 Max 128GB: 50.3 tok/s generation, peak 10.2 GB (short prompt).

Benchmarks (all K2-Horizon-3.7B MLX variants)

WikiText-2 test perplexity (128 × 512 tokens, lower is better) and generation speed on an M4 Max 128GB, all measured the same way:

bf168-bit4-bit
Bits/weight168.56.5
Disk10.1 GB5.4 GB4.1 GB
Peak memory10.2 GB5.5 GB4.3 GB
WikiText-2 perplexity17.55217.544 (-0.05%)18.324 (+4.4%)
Generation50.3 tok/s84.2 tok/s109.6 tok/s

Perplexity is a coarse signal. Test the versions on your own workload before picking one. Other K2-Horizon sizes: the K2-Horizon collection.

Usage

mlx_lm.generate --model mlx-community/K2-Horizon-3.7B-bf16 --trust-remote-code --prompt "Explain mixture-of-experts in two sentences." --max-tokens 2048
from mlx_lm import load, generate

# Newer mlx-lm versions need trust_remote_code=True; on mlx-lm 0.31.3 use load("mlx-community/K2-Horizon-3.7B-bf16").
model, tokenizer = load("mlx-community/K2-Horizon-3.7B-bf16", trust_remote_code=True)
messages = [{"role": "user", "content": "Explain mixture-of-experts in two sentences."}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
print(generate(model, tokenizer, prompt, max_tokens=2048))

mlx_lm.chat and mlx_lm.server take the same --trust-remote-code flag.

The model thinks before it answers, inside <ifm|think> … </ifm|think>. Leave room for that in max_tokens. The effort level is set with reasoning_effort in the chat template: "high" (default), "medium" or "low", e.g. apply_chat_template(messages, add_generation_prompt=True, reasoning_effort="low").

Notes:

  • Server output: mlx-lm doesn't recognize the <ifm|think> tags yet, so mlx_lm.server returns the thinking text inside content, before </ifm|think>, rather than in a separate reasoning field. K2-Horizon's tool-call format isn't parsed yet either.
  • Chat template change: the original template raises an error when an earlier assistant message has no thinking field, which is what OpenAI-style clients send. The template here renders empty thinking for those messages instead. Nothing else was changed.

License

Apache-2.0, inherited from the base model. Refer to the original model card for architecture, benchmarks and intended use. All credit for the model belongs to IFM.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · mlx

Нельзя запустить

MLX-модели работают только на Apple Silicon.

Класс архитектуры
K2HorizonForCausalLM
Ревизия весов
a73108f

0 моделей