koboldcpp/tools/mtmd/models
Daniel Bevenius 7e1e28cae3
mtmd : add Nemotron 3 Nano Omni support (parakeet) (#22520)
* mtmd : add Nemotron 3 Nano Omni support (parakeet)

This commit adds support for the subsampling and encoder part of
Nemotron Nemo 3 omni model.

The Parakeet subsampling/encoder were taken from parakeet.cpp which
is currently a pull request against whisper.cpp. I've tried to copy the
code a close as possible to hopefully enable easy patching between the
these two project later.

Refs: https://github.com/ggml-org/whisper.cpp/pull/3735

* mtmd : generate rel pos tensor in graph instead of in conversion [no ci]

This commit removes the generation of the relative positional tensor in
the model conversion script and instead computes it in the encoder
graph. This is only done for the window of positions required for the
current audio sample.

* mtmd : add clip_get_model to clip API [no ci]

This commit adds a function to get access to the clip_model. It also
removes the two functions clip_get_mel_filter_tensor, and
clip_get_window_tensor(const struct clip_ctx * ctx) which can now use
clip_get_model to access the model tensors that it needs.

* mtmd : read mel_filters and window into hparams

* mtmd : use set_input_f32 lambda [no ci]

* mtmd : add better asserts for mel_filters and hann window [no ci]

* mtmd : add missing size_t cast

* mtmd : change type of pad to size_t

* mtmd : zero initialize samples_padded

* mtmd : remove unsued ctx member from parakeet preprocessor

* mtmd : make log_mel_spectrogram_parakeet_worker_thread private static

* mtmd : sync/update parakeeet impl with latest whisper.cpp

This commit updates the parakeet code in mtmd to reflect the latest
updates to parakeet.cpp in whisper.cpp.

A follow up commit will address the currently hardcoded dw_pad and see
if we can add n_conv_kernel as a model metadata field.

* mtmd : add audio_conv_kernel_size to model conversion

This commit updates the model conversion to read the conv_kernel_size
field from the sound_config section of the models config.json file.
It then uses this field instead of the hardcoded values in parakeet.cpp.

* mtmd : cleanup [no ci]

* conversion : call super().filter_tensors [no ci]

* do not discard result of super filter_tensors

* mtmd : use build_mm instead of ggml_mul_mat

* mtmd : use build_ffn

* mtmd : move and reuse get_vector lambda

* mtmd : use build_inp_raw for parakeet

* mtmd : throw exception in get_scalar instead of assert

* mtmd : fix std::min call

* mtmt : use .c_str in throw clause in get_vector

* mtmd : check for F32 type and non-empty tensor in get_vector

The get_vector lambda is used by get_scalar but also standalone to read
in the mel_filters and the window data. Therefor we are not checking
for 1D tensors but allowing multiple dimensions. We do have a check in
get_scalar to verify the size of the vector.

* mtmd : replace hardcoded 1101 for n_tokens_real

* mtmd : assert subsampling_factor is 8

This commit adds an assert of the parakeet subsampling factor to check
that it is 8.

The motivation for this is that this model currently has three
convolutions with a stride of 2. If the underlying model updates the
subsampling factor these convolution operations will need to be updated
and this will produce and error if this occurs.

* mtmd : remove unused ggml_tensors attn_pos_w and mm_norm_w

* mtmd : remove single thread path

This commit removes the single thread path which was a left over from
the original parakeet.cpp where n_threads is configurable.

* fix some security issues

---------

Co-authored-by: Sigbjørn Skjæret <1629204+CISC@users.noreply.github.com>
Co-authored-by: Xuan Son Nguyen <son@huggingface.co>
2026-07-28 17:20:25 +02:00
..
cogvlm.cpp mtmd: add clip_graph::build_mm() (#20751) 2026-03-19 13:11:39 +01:00
conformer.cpp mtmd, server: add "placeholder bitmap" for counting tokens , add */input_tokens API (#23913) 2026-06-06 11:06:51 +02:00
deepseekocr.cpp mtmd: deepseek-ocr v1 multi-tile (#24717) 2026-07-10 16:05:49 +02:00
deepseekocr2.cpp mtmd: Add DeepSeekOCR 2 Support (#20975) 2026-05-29 16:13:51 +02:00
dotsocr.cpp mtmd: support dots.ocr (#17575) 2026-04-09 12:16:38 +02:00
exaone4_5.cpp mtmd, server: add "placeholder bitmap" for counting tokens , add */input_tokens API (#23913) 2026-06-06 11:06:51 +02:00
gemma4a.cpp mtmd: add Gemma 4 audio conformer encoder support (#21421) 2026-04-12 14:15:26 +02:00
gemma4ua.cpp mtmd, model: allow skip build_vit() (#24077) 2026-06-03 17:10:35 +02:00
gemma4uv.cpp mtmd, model: allow skip build_vit() (#24077) 2026-06-03 17:10:35 +02:00
gemma4v.cpp mtmd: add batching API (#24384) 2026-06-13 00:10:29 +02:00
glm4v.cpp mtmd, server: add "placeholder bitmap" for counting tokens , add */input_tokens API (#23913) 2026-06-06 11:06:51 +02:00
granite-speech.cpp model: Granite Speech Plus (#24818) 2026-06-23 12:03:31 +02:00
granite4-vision.cpp model: Granite Speech Plus (#24818) 2026-06-23 12:03:31 +02:00
hunyuanvl.cpp mtmd, model : merge HunyuanOCR into HunyuanVL and fix OCR vision precision (#23329) 2026-05-21 00:35:37 +02:00
internvl.cpp mtmd: add batching support for internvl (#24775) 2026-06-19 01:16:16 +02:00
kimik25.cpp mtmd, server: add "placeholder bitmap" for counting tokens , add */input_tokens API (#23913) 2026-06-06 11:06:51 +02:00
kimivl.cpp clip: move model cgraphs into their own files (#17965) 2025-12-12 21:14:48 +01:00
llama4.cpp mtmd: add clip_graph::build_mm() (#20751) 2026-03-19 13:11:39 +01:00
llava.cpp model: Granite Speech Plus (#24818) 2026-06-23 12:03:31 +02:00
mimo-audio.cpp mtmd: support MiMo-V2.5 audio input (RVQ-based model) (#26190) 2026-07-27 23:17:09 +02:00
mimovl.cpp mtmd, server: add "placeholder bitmap" for counting tokens , add */input_tokens API (#23913) 2026-06-06 11:06:51 +02:00
minicpmv.cpp mtmd : support MiniCPM-V 4.6 (#22529) 2026-05-06 21:54:09 +02:00
minimax-m3.cpp mtmd: Add Vision Support for Minimax-M3 (#25113) 2026-07-27 01:44:41 +02:00
mobilenetv5.cpp mtmd: add clip_graph::build_mm() (#20751) 2026-03-19 13:11:39 +01:00
models.h mtmd : add Nemotron 3 Nano Omni support (parakeet) (#22520) 2026-07-28 17:20:25 +02:00
nemotron-v2-vl.cpp mtmd : Add Nemotron Nano 12B v2 VL support (#19547) 2026-02-14 14:07:00 +01:00
paddleocr.cpp model: Add PaddleOCR-VL model support (#18825) 2026-02-19 17:05:25 +01:00
parakeet.cpp mtmd : add Nemotron 3 Nano Omni support (parakeet) (#22520) 2026-07-28 17:20:25 +02:00
pixtral.cpp mtmd: add more validations (#25013) 2026-06-26 08:43:29 +02:00
qwen2vl.cpp mtmd: support "frame merge" for qwen-vl-based models (#21858) 2026-06-06 21:17:25 +02:00
qwen3a.cpp mtmd: add chunks and fix preproc for qwen3a (#23073) 2026-05-15 19:32:47 +02:00
qwen3vl.cpp mtmd : use align_corners for qwen3vl vision position embedding interpolation (#25781) 2026-07-21 23:58:34 +02:00
siglip.cpp mtmd: Add DeepSeekOCR Support (#17400) 2026-03-25 19:57:40 +01:00
step3vl.cpp model : support step3-vl-10b (#21287) 2026-04-08 09:51:31 +02:00
whisper-enc.cpp mtmd, server: add "placeholder bitmap" for counting tokens , add */input_tokens API (#23913) 2026-06-06 11:06:51 +02:00
yasa2.cpp mtmd: Add support for Reka Edge 2603 (#21616) 2026-04-21 20:02:49 +02:00
youtuvl.cpp mtmd: add clip_graph::build_mm() (#20751) 2026-03-19 13:11:39 +01:00