MiniCPM5-2B
(2.5B parameters,
42 layers, 128k context, thinking mode, tool calling; English and Chinese)
packaged as single
CMF
files. They run
with
cortiq
, a Rust inference engine with no Python and no ML framework:
NVIDIA, AMD and Intel GPUs through Vulkan/DX12, Apple silicon through Metal,
and the CPU.
cargo install cortiq-cli
hf download infosave/MiniCPM5-2B-cmf MiniCPM5-2B-q8_2f.cmf --local-dir .
cortiq run MiniCPM5-2B-q8_2f.cmf --prompt "Explain quicksort in three sentences." --no-think
Use cortiq 0.7.6 or later; prebuilt binaries for Linux, macOS and Windows are
on the
releases page
. The
engine picks the GPU and its settings itself.
--no-think
asks for a direct
answer; without it the model reasons in a
<think>
block first, so raise
--max-tokens
(default 256).
Files
file
quantization
size
wikitext-2 ppl
recommended for
MiniCPM5-2B-q4tp.cmf
4-bit GPTQ; embeddings and output head 8-bit
1.57 GB
18.91
smallest and fastest (+6 % ppl)
MiniCPM5-2B-q8_2f.cmf
8-bit
2.53 GB
17.83
default
: practically lossless
Both files are quantized from the bf16 checkpoint; the 4-bit weights are
rounded with GPTQ on 2k tokens of wikitext-2 train. Perplexity: twelve
512-token windows of wikitext-2 test; the unquantized model scores 17.81 on
the same windows.
Performance
One stream, medians of three runs:
hardware
backend
file
cortiq bench --core
, tok/s
chat, 300 tokens, tok/s
2k-token prompt, time to first token
RTX 3090 (24 GB)
Vulkan
q4tp
157.7
112.9
5.8 s
RTX 3090 (24 GB)
Vulkan
q8_2f
134.9
98.2
28.4 s
The chat and prompt columns are measured through
cortiq serve
after one
warm-up request, with the recommended sampling below.
Usage
cortiq run MiniCPM5-2B-q8_2f.cmf # interactive chat
cortiq run MiniCPM5-2B-q8_2f.cmf --prompt "..."# one answer, with reasoning
cortiq run MiniCPM5-2B-q8_2f.cmf --prompt "..." --no-think # answer without the thinking block
cortiq run MiniCPM5-2B-q8_2f.cmf --prompt "..." --greedy # deterministic output
Sampling
OpenBMB recommends temperature 1.0, top-p 0.95, min-p 0; if the output starts
repeating, add a repetition penalty of 1.05:
Without flags the CLI uses temperature 0.7, top-p 0.9, top-k 40, min-p 0.05,
repetition penalty 1.1 and at most 256 new tokens.
--top-k 0
and
--rep-penalty 1.0
switch those filters off. Answers stop at
<|im_end|>
or
</s>
.
Endpoints:
/v1/chat/completions
,
/v1/completions
,
/v1/models
, plus a web
dashboard on the same port.
--host 127.0.0.1
keeps the server local.
temperature: 0
means greedy decoding;
"enable_thinking": false
in the
request gives a direct answer.
Tool calling
Send
tools
in the usual OpenAI format; the embedded template puts them in the
system prompt the way MiniCPM5 was trained. The model calls a tool in XML:
From cortiq 0.7.6 the server turns this into
message.tool_calls
with
finish_reason: "tool_calls"
, streamed or not;
arguments
is a JSON string
whose values follow the types in the tool's schema. Older versions leave the
XML in
message.content
. Run the tool, then send the assistant turn back with
tool_calls
and the result as a
{"role": "tool", ...}
message. The call
and the answer from the result were correct in 6 of 6 test conversations for
both files, on Vulkan and on Apple silicon. The embedded template differs from the upstream file only in
writing
tojson
without
ensure_ascii=False
, which gives the same output, and
the four tool-markup tokens are marked as ordinary text. cortiq 0.7.6 and later
also accept the upstream template and tokenizer unchanged.
Hardware
Apple silicon (Metal).
Runs on the GPU out of the box.
Choosing a GPU (Vulkan).
cortiq gpu
lists the adapters;
CMF_GPU_ADAPTER=1
(index or name substring) picks one. If the list is empty
on Linux, install
libvulkan1 libglvnd0 libegl1 libgl1 libglx0
; on headless
machines set
XDG_RUNTIME_DIR=/tmp
.
Long context
The model supports 131 072 tokens; the KV cache holds 32 768 by default. Raise
it with
CMF_MAX_SEQ
:
CMF_MAX_SEQ=131072 cortiq run MiniCPM5-2B-q8_2f.cmf --prompt "..." --max-tokens 4096
The cache takes about 86 KB per token: 2.8 GB at 32k tokens, 11.3 GB at the
full 131k. Decoding slows down as the context grows (about 18 tok/s at 16k
tokens for
q4tp
on the RTX 3090).
Verify the download
sha256sum -c MiniCPM5-2B-q8_2f.cmf.sha256
cortiq verify MiniCPM5-2B-q8_2f.cmf
cortiq info MiniCPM5-2B-q8_2f.cmf
Weights derive from OpenBMB's release and remain under its Apache-2.0 terms.
Документация на русском
MiniCPM5-2B
(2.5 млрд
параметров, 42 слоя, контекст 128k, режим рассуждений, вызов инструментов;
английский и китайский) в виде отдельных файлов
CMF
. Запускается движком
cortiq
на
Rust без Python и ML-фреймворков: GPU NVIDIA, AMD и Intel через Vulkan/DX12,
Apple silicon через Metal, а также CPU.
Быстрый старт
cargo install cortiq-cli
hf download infosave/MiniCPM5-2B-cmf MiniCPM5-2B-q8_2f.cmf --local-dir .
cortiq run MiniCPM5-2B-q8_2f.cmf --prompt "Объясни квиксорт в трёх предложениях." --no-think
Используйте cortiq 0.7.6 или новее; готовые сборки для Linux, macOS и
Windows — на
странице релизов
.
Движок сам выбирает GPU и настройки.
--no-think
даёт прямой ответ; без него
модель сначала рассуждает в блоке
<think>
, поэтому увеличьте
--max-tokens
(по умолчанию 256).
Файлы
файл
квантизация
размер
ppl wikitext-2
назначение
MiniCPM5-2B-q4tp.cmf
4 бита GPTQ; эмбеддинги и выходная голова 8 бит
1.57 ГБ
18.91
самый компактный и быстрый (+6 % ppl)
MiniCPM5-2B-q8_2f.cmf
8 бит
2.53 ГБ
17.83
по умолчанию
: практически без потерь
Оба файла квантованы из bf16-чекпойнта; 4-битные веса округлены GPTQ на 2k
токенах wikitext-2 train. Перплексия измерена на 12 окнах wikitext-2 test по
512 токенов; неквантованная модель на тех же окнах даёт 17.81.
Скорость
Один поток, медианы трёх запусков:
железо
бэкенд
файл
cortiq bench --core
, ток/с
чат, 300 токенов, ток/с
промпт 2k токенов, время до первого токена
RTX 3090 (24 ГБ)
Vulkan
q4tp
157.7
112.9
5.8 с
RTX 3090 (24 ГБ)
Vulkan
q8_2f
134.9
98.2
28.4 с
Столбцы «чат» и «промпт» измерены через
cortiq serve
после одного
прогревочного запроса, с рекомендуемым сэмплированием (ниже).
Использование
cortiq run MiniCPM5-2B-q8_2f.cmf # интерактивный чат
cortiq run MiniCPM5-2B-q8_2f.cmf --prompt "..."# один ответ с рассуждением
cortiq run MiniCPM5-2B-q8_2f.cmf --prompt "..." --no-think # ответ без блока рассуждений
cortiq run MiniCPM5-2B-q8_2f.cmf --prompt "..." --greedy # детерминированный вывод
OpenBMB рекомендует temperature 1.0, top-p 0.95, min-p 0; если вывод начинает
повторяться, добавьте repetition penalty 1.05:
Без флагов CLI использует temperature 0.7, top-p 0.9, top-k 40, min-p 0.05,
repetition penalty 1.1 и не более 256 новых токенов.
--top-k 0
и
--rep-penalty 1.0
отключают эти фильтры. Ответ заканчивается на
<|im_end|>
или
</s>
.
Эндпоинты
/v1/chat/completions
,
/v1/completions
,
/v1/models
и
веб-панель на том же порту.
--host 127.0.0.1
оставляет сервер локальным.
temperature: 0
означает greedy-декодирование;
"enable_thinking": false
в
запросе даёт прямой ответ.
Вызов инструментов.
Передавайте
tools
в обычном формате OpenAI;
встроенный шаблон помещает их в системный промпт так, как модель обучали.
Модель вызывает инструмент в XML:
Начиная с cortiq 0.7.6 сервер превращает такой вызов в
message.tool_calls
с
finish_reason: "tool_calls"
, и в потоковом режиме тоже;
arguments
— строка
JSON, значения в которой приведены к типам из схемы инструмента. Более старые
версии оставляют XML в
message.content
. Выполните инструмент и отправьте
обратно ход ассистента с
tool_calls
и результат сообщением
{"role": "tool", ...}
. Вызов и ответ по результату были верны в 6 из 6
тестовых диалогов для обоих файлов, на Vulkan и на Apple silicon. Встроенный шаблон отличается от исходного только тем, что
tojson
записан без
ensure_ascii=False
(результат тот же), а четыре токена
разметки вызова помечены как обычный текст. cortiq 0.7.6 и новее принимает и
исходные шаблон и токенизатор без изменений.
Железо
Apple silicon (Metal).
Работает на GPU без настройки.
Выбор GPU (Vulkan).
cortiq gpu
показывает адаптеры;
CMF_GPU_ADAPTER=1
(индекс или часть имени) закрепляет нужный. Если на Linux список пуст,
установите
libvulkan1 libglvnd0 libegl1 libgl1 libglx0
; на машинах без
дисплея задайте
XDG_RUNTIME_DIR=/tmp
.
Длинный контекст
Модель поддерживает 131 072 токена; KV-кэш по умолчанию рассчитан на 32 768.
Увеличьте его через
CMF_MAX_SEQ
:
CMF_MAX_SEQ=131072 cortiq run MiniCPM5-2B-q8_2f.cmf --prompt "..." --max-tokens 4096
.
Кэш занимает около 86 КБ на токен: 2.8 ГБ на 32k токенов, 11.3 ГБ на полных
131k. С ростом контекста декодирование замедляется (около 18 ток/с на 16k
токенов для
q4tp
на RTX 3090).
Проверка загрузки
sha256sum -c MiniCPM5-2B-q8_2f.cmf.sha256
cortiq verify MiniCPM5-2B-q8_2f.cmf
cortiq info MiniCPM5-2B-q8_2f.cmf
Веса получены из релиза OpenBMB и распространяются на условиях Apache-2.0.
MiniCPM5-2B-cmf huggingface.co is an AI model on huggingface.co that provides MiniCPM5-2B-cmf's model effect (), which can be used instantly with this infosave MiniCPM5-2B-cmf model. huggingface.co supports a free trial of the MiniCPM5-2B-cmf model, and also provides paid use of the MiniCPM5-2B-cmf. Support call MiniCPM5-2B-cmf model through api, including Node.js, Python, http.
MiniCPM5-2B-cmf huggingface.co is an online trial and call api platform, which integrates MiniCPM5-2B-cmf's modeling effects, including api services, and provides a free online trial of MiniCPM5-2B-cmf, you can try MiniCPM5-2B-cmf online for free by clicking the link below.
infosave MiniCPM5-2B-cmf online free url in huggingface.co:
MiniCPM5-2B-cmf is an open source model from GitHub that offers a free installation service, and any user can find MiniCPM5-2B-cmf on GitHub to install. At the same time, huggingface.co provides the effect of MiniCPM5-2B-cmf install, users can directly use MiniCPM5-2B-cmf installed effect in huggingface.co for debugging and trial. It also supports api for free installation.