]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/log
pkg/ggml/sources/llama.cpp
7 weeks agovulkan: fix top_k bug when there are ties in the input (#17659)
Jeff Bolz [Fri, 5 Dec 2025 21:03:19 +0000 (15:03 -0600)]
vulkan: fix top_k bug when there are ties in the input (#17659)

* vulkan: Reduce temporary memory usage for TOP_K

- Compute row size for the temp buffer based on the output of the first pass.
- Update shader addressing math to use the output row size
- Pass the output row size as "ncols_output", what used to be "ncols_output" is now "k"

For the common case of K=40 and src0=(200000,1,1,1), this reduces the temporary buffer
from about 3.2MB to 500KB.

* vulkan: fix top_k bug when there are ties in the input

I noticed by inspection a bug in the vulkan top_k shader where if the least
value in the top_k appears multiple times we could end up writing those extra
copies out rather than some larger values (if the larger values are on higher
numbered threads).

I rewrote the test verification to handle this case, where the final index set
is not necessarily the same.

* Update tests/test-backend-ops.cpp

Co-authored-by: Georgi Gerganov <redacted>
---------

Co-authored-by: Georgi Gerganov <redacted>
7 weeks agovulkan : support conv-2d with large output size (#17685)
Acly [Fri, 5 Dec 2025 20:46:39 +0000 (21:46 +0100)]
vulkan : support conv-2d with large output size (#17685)

7 weeks agoggml webgpu: unary op suppport, code refactoring, ops support (#17764)
Reese Levine [Fri, 5 Dec 2025 20:25:51 +0000 (12:25 -0800)]
ggml webgpu: unary op suppport, code refactoring, ops support (#17764)

* Squashed commit of the following:

commit b3c6bf4b0450d8d452b934df27a0fb7cb53cd755
Author: Abhijit Ramesh <redacted>
Date:   Mon Dec 1 18:29:00 2025 -0800

    ggml webgpu: fix xielu parameter passing (#11)

    The XIELU operation was incorrectly using static_cast to convert
    float parameters to uint32_t, which converted numeric values instead
    of preserving IEEE 754 bit patterns. This caused incorrect values
    to be interpreted by the GPU shader.

    * Use reinterpret_cast to preserve float bit patterns when passing
      through uint32_t params buffer
    * Update WGSL shader parameter types from u32 to f32
    * Re-enable XIELU support (was disabled due to numerical issues)

    Fixes NMSE test failures for XIELU operation on WebGPU backend.

commit 5ca9b5e49ea7cddc9ab7c8b43a11a9c76a4dff4a
Author: neha-ha <redacted>
Date:   Tue Nov 18 12:17:00 2025 -0800

    Refactored pipelines and workgroup calculations (#10)

    * refactored pipelines

    * refactored workgroup calculation

    * removed commented out block of prior maps

    * Clean up ceiling division pattern

    ---------

Co-authored-by: Neha Abbas <redacted>
Co-authored-by: Reese Levine <redacted>
Author: James Contini <redacted>
Date:   Wed Oct 29 23:13:06 2025 -0700

    formatted embed wgsl and ggml-webgpu.cpp

commit e1f6baea31645e5d96ad53664acae856f74b96f4
Author: James Contini <redacted>
Date:   Wed Oct 29 23:08:37 2025 -0700

    implemented REPL_Template support and removed bug in unary operators kernel

commit 8c70b8fece445cdc9a8c660dbddbf201e52da2bb
Author: James Contini <redacted>
Date:   Wed Oct 15 16:14:20 2025 -0700

    responded and dealt with PR comments

commit f9282c660c10dec4487d434549bdb707a9cd9f37
Author: James Contini <redacted>
Date:   Sun Oct 12 13:41:41 2025 -0700

    removed unnecesarry checking if node->src[1] exists for unary operators

commit 4cf28d7dec41c29186d66152735b244c5699f9dc
Author: James Contini <redacted>
Date:   Sun Oct 12 13:32:45 2025 -0700

    All operators (inlcluding xielu) working

commit 74c6add1761a59d2c2ff60b60e8ad3c8300f6d3e
Author: James Contini <redacted>
Date:   Fri Oct 10 13:16:48 2025 -0700

    fixed autoconfig

commit 362749910be4f0120c8ffb21ceddeb7d2c088e51
Author: James Contini <redacted>
Date:   Fri Oct 10 13:10:46 2025 -0700

    removed vestigial files

commit cb0858333785757804c5104e59c4981843207c16
Author: James Contini <redacted>
Date:   Fri Oct 10 12:59:32 2025 -0700

    abides by editor-config

commit 5360e2852a4b51197d7d67d0a5d42e908b02d7ed
Author: James Contini <redacted>
Date:   Fri Oct 10 12:45:57 2025 -0700

    rms_norm double declaration bug atoned

commit 7b09baa4aa53711be5a126043670cc182c78bfcd
Merge: 8a6ec843 74b8fc17
Author: James Contini <redacted>
Date:   Fri Oct 10 11:50:03 2025 -0700

    resolving merge conflicts

commit 8a6ec843a50ab82f8cef59b4558eb63f318ba02d
Author: James Contini <redacted>
Date:   Wed Oct 8 18:06:47 2025 -0700

    unary operators pass ggml tests

commit c3ae38278a2db236adc5912c9140e4f0d63f2c19
Author: James Contini <redacted>
Date:   Wed Oct 1 16:22:40 2025 -0700

    neg passes backend test

commit aa1c9b2f8877a405470ca56709c42a1fd43713de
Author: James Contini <redacted>
Date:   Tue Sep 30 23:55:27 2025 -0700

    neg f16xf32xip builds and runs, havent actually ran a model that uses neg kernel yet though

Co-authored-by: James Contini <redacted>
Co-authored-by: Neha Abbas <redacted>
Co-authored-by: Abhijit Ramesh <redacted>
* Remove extra code and format

* Add ops documentation (finally)

* Update ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py

Co-authored-by: Sigbjørn Skjæret <redacted>
---------

Co-authored-by: James Contini <redacted>
Co-authored-by: Neha Abbas <redacted>
Co-authored-by: Abhijit Ramesh <redacted>
Co-authored-by: Sigbjørn Skjæret <redacted>
7 weeks agovulkan: enable mmvq for q2_k on NVIDIA (#17675)
Jeff Bolz [Fri, 5 Dec 2025 20:21:57 +0000 (14:21 -0600)]
vulkan: enable mmvq for q2_k on NVIDIA (#17675)

7 weeks agovulkan: set all memory allocations to high priority (#17624)
Jeff Bolz [Fri, 5 Dec 2025 20:21:04 +0000 (14:21 -0600)]
vulkan: set all memory allocations to high priority (#17624)

* vulkan: set all memory allocations to high priority

* gate by env var

7 weeks agorpc : fix alloc size logic (#17116)
Georgi Gerganov [Fri, 5 Dec 2025 17:39:04 +0000 (19:39 +0200)]
rpc : fix alloc size logic (#17116)

* rpc : fix alloc size logic

* rpc : bump version

7 weeks agometal : add residency sets keep-alive heartbeat (#17766)
Georgi Gerganov [Fri, 5 Dec 2025 17:38:54 +0000 (19:38 +0200)]
metal : add residency sets keep-alive heartbeat (#17766)

* examples : add idle

* metal : attach residency sets to queue

* idle : add link

* idle : adjust intervals

* metal : add residency sets keep-alive heartbeat

* cont : adjust default keep-alive time

7 weeks agoHIP : fix RDNA4 build (#17792)
Johannes Gäßler [Fri, 5 Dec 2025 12:47:52 +0000 (13:47 +0100)]
HIP : fix RDNA4 build (#17792)

7 weeks agofix: prevent segfault in tokenizer on highly repetitive input (#17786)
Pascal [Fri, 5 Dec 2025 11:52:23 +0000 (12:52 +0100)]
fix: prevent segfault in tokenizer on highly repetitive input (#17786)

Add nosubs|optimize flags to std::regex constructors to prevent
catastrophic backtracking when processing prompts with repeated
identical characters (e.g., 'A' * 10000).

The nosubs flag disables subgroup capture, significantly reducing
memory usage and backtracking on uniform token sequences

7 weeks agoci : fix winget workflow (#17790)
Adrien Gallouët [Fri, 5 Dec 2025 11:44:17 +0000 (12:44 +0100)]
ci : fix winget workflow (#17790)

7 weeks agoQ4/Q8 Tiled Gemm Optimization. (#16999)
shalinib-ibm [Fri, 5 Dec 2025 11:41:51 +0000 (17:11 +0530)]
Q4/Q8 Tiled Gemm Optimization. (#16999)

7 weeks agoAdd pwilkin to CODEOWNERS for chat files (#17789)
Piotr Wilkin (ilintar) [Fri, 5 Dec 2025 11:00:57 +0000 (12:00 +0100)]
Add pwilkin to CODEOWNERS for chat files (#17789)

* Add pwilkin to CODEOWNERS for chat files

* Reorder alphabetically

7 weeks agoCUDA: fix FA VKQ accumulator overflow (#17746)
Johannes Gäßler [Fri, 5 Dec 2025 08:18:10 +0000 (09:18 +0100)]
CUDA: fix FA VKQ accumulator overflow (#17746)

7 weeks agoHIP: enable WMMA-MMQ INT kernels for RDNA 3 (#17576)
Jiacheng (Jason) Chen [Fri, 5 Dec 2025 08:17:37 +0000 (03:17 -0500)]
HIP: enable WMMA-MMQ INT kernels for RDNA 3 (#17576)

* enabled wmma instructions for most quantizations other than q2k

* fixed the last q2_k test case failure

* address comments: fix out of bound write for RDNA4, add comments after #endif

* clean up rebase: fix ne error in half2

* fix the EditorConfig CI

7 weeks agoci : transform release binary root dir in tar to llama-bXXXX (#17773)
Sigbjørn Skjæret [Fri, 5 Dec 2025 00:50:19 +0000 (01:50 +0100)]
ci : transform release binary root dir in tar to llama-bXXXX (#17773)

* transform release binary root dir in tar to llama-bXXXX

* bsdtar supports -s instead of --transform

7 weeks agodocs : update ops.md (Metal, BLAS) (#17768)
Gabe Goodhart [Thu, 4 Dec 2025 23:55:34 +0000 (16:55 -0700)]
docs : update ops.md (Metal, BLAS) (#17768)

* docs: Regen Metal.csv

Branch: UpdateOpsMd

Signed-off-by: Gabe Goodhart <redacted>
* docs: Regen BLAS.csv

Branch: UpdateOpsMd

Signed-off-by: Gabe Goodhart <redacted>
* docs: Update ops.md

Branch: UpdateOpsMd

Signed-off-by: Gabe Goodhart <redacted>
---------

Signed-off-by: Gabe Goodhart <redacted>
7 weeks agoAdd support for CUMSUM and TRI for CUDA. (#17584)
Piotr Wilkin (ilintar) [Thu, 4 Dec 2025 21:19:51 +0000 (22:19 +0100)]
Add support for CUMSUM and TRI for CUDA. (#17584)

* Add support for CUMSUM and TRI for CUDA.

* Minor optimizations.

* Correct warp_prefix_inclusive_sum in float2 variant to return float2

* Optimize TRI

* Whitespace

* Fix strides.

* Implement double loop

* Whitespace

* Fix HIP compilation bugs

* Optimizations + big case performance tests

* Implement using CUB with fallback to custom kernel

* Remove error message.

* Fixes from code review

* Comment out CPU-unsupported F16/BF16 cases to fix CI

* Fine, you win :P

* Fix last cast, use NO_DEVICE_CODE and GGML_UNUSED_VARS

* Vary warp-size based on physical warp size

* Add GGML_UNUSED_VARS in tri as well

* Use constexpr and call prefix_inclusive with warp_size template param

* Update ggml/src/ggml-cuda/cumsum.cu

Co-authored-by: Johannes Gäßler <redacted>
* Apply suggestions from code review

Co-authored-by: Johannes Gäßler <redacted>
* Change to tid % warp_size

* Fix strides; hardcode mask; add ggml_lane_mask_t

* Missing renames, remove unused get_warp_mask(), explicit calls to ggml_cuda_info()

* Too hasty...

---------

Co-authored-by: Johannes Gäßler <redacted>
7 weeks agometal: TRI, FILL, EXPM1, SOFTPLUS (#16623)
Gabe Goodhart [Thu, 4 Dec 2025 17:12:19 +0000 (10:12 -0700)]
metal: TRI, FILL, EXPM1, SOFTPLUS (#16623)

* feat(wip): Port initial TRI impl from pervious work

The kernel does not work and is not optimized, but the
code compiles and runs, so this will be the starting point
now that the core op has been merged.

Branch: ggml-cumsum-tri

Signed-off-by: Gabe Goodhart <redacted>
* fix: Remove argument for constant val override

This was added in the original draft, but later removed. With this, the
kernel now passes tests.

Branch: ggml-cumsum-tri

Signed-off-by: Gabe Goodhart <redacted>
* feat: Move the ttype conditional to templating to avoid conditional in kernel

Branch: ggml-cumsum-tri

Signed-off-by: Gabe Goodhart <redacted>
* fix: Type fixes

Signed-off-by: Gabe Goodhart <redacted>
Co-authored-by: Georgi Gerganov <redacted>
Co-authored-by: Georgi Gerganov <redacted>
* feat: Add softplus for metal

Branch: ggml-cumsum-tri

Signed-off-by: Gabe Goodhart <redacted>
* feat: Add EXPM1 for metal

Branch: ggml-cumsum-tri

Signed-off-by: Gabe Goodhart <redacted>
* feat: Add FILL for metal

Branch: ggml-cumsum-tri

Signed-off-by: Gabe Goodhart <redacted>
* refactor: Branchless version of tri using _ggml_vec_tri_cmp as a mask

Branch: ggml-cumsum-tri

Signed-off-by: Gabe Goodhart <redacted>
* fix: Remove unused arguments

Branch: ggml-cumsum-tri

Signed-off-by: Gabe Goodhart <redacted>
* refactor: Use select instead of branch for softplus non-vec

Branch: ggml-cumsum-tri

Signed-off-by: Gabe Goodhart <redacted>
---------

Signed-off-by: Gabe Goodhart <redacted>
Co-authored-by: Georgi Gerganov <redacted>
7 weeks agoserver: strip content-length header on proxy (#17734)
Xuan-Son Nguyen [Thu, 4 Dec 2025 15:32:57 +0000 (16:32 +0100)]
server: strip content-length header on proxy (#17734)

7 weeks agoserver: move msg diffs tracking to HTTP thread (#17740)
Xuan-Son Nguyen [Thu, 4 Dec 2025 14:46:08 +0000 (15:46 +0100)]
server: move msg diffs tracking to HTTP thread  (#17740)

* server: move msg diffs tracking to HTTP thread

* wip

* tool call tests ok

* minor : style

* cont : fix

* move states to server_response_reader

* add safe-guard

* fix

* fix 2

---------

Co-authored-by: Georgi Gerganov <redacted>
7 weeks agoexamples : add missing code block end marker [no ci] (#17756)
Daniel Bevenius [Thu, 4 Dec 2025 13:17:30 +0000 (14:17 +0100)]
examples : add missing code block end marker [no ci] (#17756)

This commit adds the missing code block end marker in simple-cmake-pkg
to correct the formatting.

7 weeks agocommon : skip model validation when --help is requested (#17755)
Daniel Bevenius [Thu, 4 Dec 2025 12:36:50 +0000 (13:36 +0100)]
common : skip model validation when --help is requested (#17755)

This commit skips the model validation check when the user specifies the
--help option.

The motivation for this is that currently and error is thrown before the
--help could be processed. Now skips validation if params.usage is set,
allowing help to display without requiring --model.

Resolves: https://github.com/ggml-org/llama.cpp/issues/17754

7 weeks agoggml-cpu : remove asserts always evaluating to false (#17728)
Alberto Cabrera Pérez [Thu, 4 Dec 2025 12:16:38 +0000 (12:16 +0000)]
ggml-cpu : remove asserts always evaluating to false (#17728)

7 weeks agoconvert: use existing local chat_template if mistral-format model has one. (#17749)
SmartestWashingMachine [Thu, 4 Dec 2025 11:12:45 +0000 (22:12 +1100)]
convert: use existing local chat_template if mistral-format model has one. (#17749)

* conversion: use existing local chat_template.jinja file if mistral-format model has one.

* fix --mistral-format mistakenly assuming some <=v7 chat template names are file paths and reading them.

* Update convert_hf_to_gguf.py - change from exists() to is_file()

Co-authored-by: Sigbjørn Skjæret <redacted>
---------

Co-authored-by: Sigbjørn Skjæret <redacted>
7 weeks agocmake : simplify build info detection using standard variables (#17423)
Adrien Gallouët [Thu, 4 Dec 2025 10:42:13 +0000 (11:42 +0100)]
cmake : simplify build info detection using standard variables (#17423)

The current approach has several drawbacks. Mostly, when
cross-compiling, invoking the compiler binary directly to query the
machine hardware can behave unexpectedly depending on the toolchain
wrapper (using COMPILER_TARGET, CFLAGS, etc).

As CMake is the official tool to build llama.cpp, I propose to only rely
on it to get those variables (`CMAKE_SYSTEM_NAME` and
`CMAKE_SYSTEM_PROCESSOR`).

Signed-off-by: Adrien Gallouët <redacted>
7 weeks agoci : disable ggml-ci-x64-amd-* (#17753)
Sigbjørn Skjæret [Thu, 4 Dec 2025 10:25:08 +0000 (11:25 +0100)]
ci : disable ggml-ci-x64-amd-* (#17753)

7 weeks agocommon: use native MultiByteToWideChar (#17738)
Adrien Gallouët [Thu, 4 Dec 2025 10:06:49 +0000 (11:06 +0100)]
common: use native MultiByteToWideChar (#17738)

`std::codecvt_utf8<wchar_t>` is deprecated and produces warnings:

    common/common.cpp:792:31: warning: 'codecvt_utf8<wchar_t>' is deprecated [-Wdeprecated-declarations]
      792 |     std::wstring_convert<std::codecvt_utf8<wchar_t>> converter;
          |

Signed-off-by: Adrien Gallouët <redacted>
7 weeks agometal : use params per pipeline instance (#17739)
Georgi Gerganov [Thu, 4 Dec 2025 08:34:11 +0000 (10:34 +0200)]
metal : use params per pipeline instance (#17739)

7 weeks agollama : fix sanity checks during quantization (#17721)
Georgi Gerganov [Thu, 4 Dec 2025 08:33:42 +0000 (10:33 +0200)]
llama : fix sanity checks during quantization (#17721)

7 weeks agobuild : move _WIN32_WINNT definition to headers (#17736)
Adrien Gallouët [Thu, 4 Dec 2025 06:04:02 +0000 (07:04 +0100)]
build : move _WIN32_WINNT definition to headers (#17736)

Previously, cmake was forcing `_WIN32_WINNT=0x0A00` for MinGW builds,
This caused "macro redefined" warnings with toolchains that define the version.

This also removes the `GGML_WIN_VER` variable as it is no longer needed.

Signed-off-by: Adrien Gallouët <redacted>
7 weeks agobuild: enable parallel builds in msbuild using MTT (#17708)
Jeff Bolz [Thu, 4 Dec 2025 04:42:29 +0000 (22:42 -0600)]
build: enable parallel builds in msbuild using MTT (#17708)

* build: enable parallel builds in msbuild using MTT

* check LLAMA_STANDALONE

7 weeks agoggml-cpu: remove duplicate conditional check 'iid' (#17650)
Herman Semenoff [Wed, 3 Dec 2025 21:03:19 +0000 (00:03 +0300)]
ggml-cpu: remove duplicate conditional check 'iid' (#17650)

7 weeks agoAdd a couple of file types to the text section (#17670)
Piotr Wilkin (ilintar) [Wed, 3 Dec 2025 20:45:06 +0000 (21:45 +0100)]
Add a couple of file types to the text section (#17670)

* Add a couple of file types to the text section

* Format + regenerate index

* Rebuild after rebase

7 weeks agoconvert : support latest mistral-common (fix conversion with --mistral-format) (...
SmartestWashingMachine [Wed, 3 Dec 2025 20:15:04 +0000 (07:15 +1100)]
convert : support latest mistral-common (fix conversion with --mistral-format) (#17712)

* fix convert_hf_to_gguf.py failing with --mistral-format using later mistral-common versions.

* use get_one_valid_tokenizer_file from mistral-common if available and fallback to old logic otherwise.

* use file name instead of file path for get_one_valid_tokenizer_file.

* fix --mistral-format tokenizer file failing for tokenizers in subdirectories.

* move get_one_valid_tokenizer_file import to avoid nested try-except.

7 weeks agoUse OpenAI-compatible `/v1/models` endpoint by default (#17689)
Aleksander Grygier [Wed, 3 Dec 2025 19:49:09 +0000 (20:49 +0100)]
Use OpenAI-compatible `/v1/models` endpoint by default (#17689)

* refactor: Data fetching via stores

* chore: update webui build output

* refactor: Use OpenAI compat `/v1/models` endpoint by default to list models

* chore: update webui build output

* chore: update webui build output

7 weeks agowebui: Fix zero pasteLongTextToFileLen to disable conversion being overridden (#17445)
Andika Wasisto [Wed, 3 Dec 2025 19:45:17 +0000 (02:45 +0700)]
webui: Fix zero pasteLongTextToFileLen to disable conversion being overridden (#17445)

* webui: Fix zero pasteLongTextToFileLen to disable conversion being overridden

Zero pasteLongTextToFileLen should disable the conversion, but it was
overwritten with 2500.

* Apply suggestions from code review

* Update webui build

7 weeks agoCUDA: generalized (mma) FA, add Volta support (#17505)
Johannes Gäßler [Wed, 3 Dec 2025 15:57:05 +0000 (16:57 +0100)]
CUDA: generalized (mma) FA, add Volta support (#17505)

* CUDA: generalized (mma) FA, add Volta support

* use struct for MMA FA kernel config

---------

Co-authored-by: Aman Gupta <aman>
7 weeks agochat : reserve memory in compute_diffs and improve naming (#17729)
Georgi Gerganov [Wed, 3 Dec 2025 15:22:10 +0000 (17:22 +0200)]
chat : reserve memory in compute_diffs and improve naming (#17729)

7 weeks agoserver: add router multi-model tests (#17704) (#17722)
Pascal [Wed, 3 Dec 2025 14:10:37 +0000 (15:10 +0100)]
server: add router multi-model tests (#17704) (#17722)

* llama-server: add router multi-model tests (#17704)

Add 4 test cases for model router:
- test_router_unload_model: explicit model unloading
- test_router_models_max_evicts_lru: LRU eviction with --models-max
- test_router_no_models_autoload: --no-models-autoload flag behavior
- test_router_api_key_required: API key authentication

Tests use async model loading with polling and graceful skip when
insufficient models available for eviction testing.

utils.py changes:
- Add models_max, models_dir, no_models_autoload attributes to ServerProcess
- Handle JSONDecodeError for non-JSON error responses (fallback to text)

* llama-server: update test models to new HF repos

* add offline

* llama-server: fix router LRU eviction test and add preloading

Fix eviction test: load 2 models first, verify state, then load
3rd to trigger eviction. Previous logic loaded all 3 at once,
causing first model to be evicted before verification could occur.

Add module fixture to preload models via ServerPreset.load_all()
and mark test presets as offline to use cached models

* llama-server: fix split model download on Windows

---------

Co-authored-by: Xuan-Son Nguyen <redacted>
7 weeks agoserver : fix bad fmt, size() is a size_type (#17735)
Adrien Gallouët [Wed, 3 Dec 2025 13:47:22 +0000 (14:47 +0100)]
server : fix bad fmt, size() is a size_type (#17735)

Signed-off-by: Adrien Gallouët <redacted>
7 weeks agocmake: explicitly link against crypt32 on non-MSVC Windows builds (#17727)
Adrien Gallouët [Wed, 3 Dec 2025 13:47:02 +0000 (14:47 +0100)]
cmake: explicitly link against crypt32 on non-MSVC Windows builds (#17727)

Some toolchains do not support linking via pragmas such as:

    #pragma comment(lib, "crypt32.lib")

so we need to add the library explicitly.

Signed-off-by: Adrien Gallouët <redacted>
7 weeks agometal : fix data race in pipeline library (#17731)
Georgi Gerganov [Wed, 3 Dec 2025 12:03:40 +0000 (14:03 +0200)]
metal : fix data race in pipeline library (#17731)

7 weeks agoci : remove the build of openeuler-cann in release (#17724)
jiahao su [Wed, 3 Dec 2025 11:24:59 +0000 (19:24 +0800)]
ci : remove the build of openeuler-cann in release (#17724)

* Remove the build of openeuler-cann in release

* Remove the relevant release files

7 weeks agocommon : introduce composable PEG parser combinators for chat parsing (#17136)
Aldehir Rojas [Wed, 3 Dec 2025 10:45:32 +0000 (04:45 -0600)]
common : introduce composable PEG parser combinators for chat parsing (#17136)

* common : implement parser combinators to simplify chat parsing

* add virtual destructor to parser_base

* fix memory leak from circular references of rules

* implement gbnf grammar building

* remove unused private variable

* create a base visitor and implement id assignment as a visitor

* fix const ref for grammar builder

* clean up types, friend classes, and class declarations

* remove builder usage from until_parser

* Use a counter class to help assign rule ids

* cache everything

* add short description for each parser

* create a type for the root parser

* implement repetition parser

* Make optional, one_or_more, and zero_or_more subclasses of repetition

* improve context constructor

* improve until parsing and add benchmarks

* remove cached() pattern, cache in parser_base with specialized parsing functions for each parser

* improve json parsing performance to better match legacy parsing

* fix const auto * it for windows

* move id assignment to classes instead of using a visitor

* create named rules in the command r7b example

* use '.' for any in GBNF

* fix parens around choices in gbnf grammar

* add convenience operators to turn strings to literals

* add free-form operators for const char * to simplify defining literals

* simplify test case parser

* implement semantic actions

* remove groups in favor of actions and a scratchpad

* add built in actions for common operations

* add actions to command r7b example

* use std::default_searcher for platforms that don't have bm

* improve parser_type handling and add cast helper

* add partial result type to better control when to run actions

* fix bug in until()

* run actions on partial results by default

* use common_chat_msg for result

* add qwen3 example wip

* trash partial idea and simplify

* move action arguments to a struct

* implement aho-corasick matcher for until_parser and to build exclusion grammars

* use std::string for input, since std::string_view is incompatible with std::regex

* Refactor tests

* improve qwen3 example

* implement sax-style parsing and refactor

* fix json string in test

* rename classes to use common_chat_ prefix

* remove is_ suffix from functions

* rename from id_counter to just counter

* Final refactored tests

* Fix executable name and editorconfig-checker

* Third time's the charm...

* add trigger parser to begin lazy grammar rule generation

* working lazy grammar

* refactor json rules now that we check for reachability

* reduce pointer usage

* print out grammars in example

* rename to chat-peg-parser* and common_chat_peg_parser*

* Revert unrelated changes

* New macros for CMakeLists to enable multi-file compilations

* starting unicode support

* add unicode support to char_parser

* use unparsed args as additional sources

* Refactor tests to new harness

* Fix CMakeLists

* fix rate calculation

* add unicode tests

* fix trailing whitespace and line endings

skip-checks: true

* Helpers + rewrite qwen3 with helpers

* Fix whitespace

* extract unicode functions to separate file

* refactor parse unicode function

* fix compiler error

* improve construction of sequence/choice parsers

* be less clever

* add make_parser helper function

* expand usage of make_parser, alias common_chat_msg_peg_parser_builder to builder in source

* lower bench iterations

* add unicode support to until_parser

* add unicode support to json_string_parser

* clean up unicode tests

* reduce unicode details to match src/unicode.cpp

* simplify even further

* remove unused functions

* fix type

* reformat char class parsing

* clean up json string parser

* clean up + fix diagnostics

* reorder includes

* compact builder functions

* replace action_parser with capture_parser, rename env to semantics

* rename env to semantics

* clean up common_chat_parse_context

* move type() to below constant

* use default constructor for common_chat_peg_parser

* make all operators functions for consistency

* fix compilation errors in test-optional.cpp

* simplify result values

* rename json_string_unquoted to json_string_content

* Move helper to separate class, add separate explicit and helper classes

* Whitespace

* Change + to append()

* Reformat

* Add extra helpers, tests and Minimax example

* Add some extra optional debugging prints + real example of how to use them

* fix bug in repetitions when min_count = 0 reports failures

* dump rule in debug

* fix token accumulation and assert parsing never fails

* indent debug by depth

* use LOG_* in tests so logs sync up with test logs

* - Add selective testing
- Refactor all messaging to use LOG_ERR
- Fix lack of argument / tool name capturing
- Temporary fix for double event capture

* refactor rule() and introduce ref()

* clean up visitor

* clean up indirection in root parser w.r.t rules

* store shared ptr directly in parser classes

* replace aho-corasick automation with a simple trie

* Reset prev for qwen3 helper example variant

* refactor to use value semantics with std::variant/std::visit

* simplify trie_matcher result

* fix linting issues

* add annotations to rules

* revert test workaround

* implement serializing the parser

* remove redundant parsers

* remove tests

* gbnf generation fixes

* remove LOG_* use in tests

* update gbnf tests to test entire grammar

* clean up gbnf generation and fix a few bugs

* fix typo in test output

* remove implicit conversion rules

* improve test output

* rename trie_matcher to trie

* simplify trie to just know if a node is the end of a word

* remove common_chat_ prefix and ensure a common_peg_ prefix to all types

* rename chat-peg-parser -> peg-parser

* promote chat-peg-parser-helper to chat-peg-parser

* checkpoint

* use a static_assert to ensure we handle every branch

* inline trivial peg parser builders

* use json strings for now

* implement basic and native chat peg parser builders/extractors

* resolve refs to their rules

* remove packrat caching (for now)

* update tests

* compare parsers with incremental input

* benchmark both complete and incremental parsing

* add raw string generation from json schema

* add support for string schemas in gbnf generation

* fix qwen example to include \n

* tidy up example

* rename extractor to mapper

* rename ast_arena to ast

* place basic tests into one

* use gbnf_format_literal from json-schema-to-grammar

* integrate parser with common/chat and server

* clean up schema and serialization

* add json-schema raw string tests

* clean up json creation and remove capture parser

* trim spaces from reasoning and content

* clean up redundant rules and comments

* rename input_is_complete to is_partial to match rest of project

* simplify json rules

* remove extraneous file

* remove comment

* implement += and |= operators

* add comments to qwen3 implementation

* reorder arguments to common_chat_peg_parse

* remove commented outdated tests

* add explicit copy constructor

* fix operators and constness

* wip: update test-chat for qwen3-coder

* bring json parser closer to json-schema-to-grammar rules

* trim trailing space for most things

* fix qwen3 coder rules w.r.t. trailing spaces

* group rules

* do not trim trailing space from string args

* tweak spacing of qwen3 grammar

* update qwen3-coder tests

* qwen3-coder small fixes

* place parser in common_chat_syntax to simplify invocation

* use std::set to collect rules to keep order predictable for tests

* initialize parser to make certain platforms happy

* revert back to std::unordered_set, sort rule names at the end instead

* uncomment rest of chat tests

* define explicit default constructor

* improve arena init and server integration

* fix chat test

* add json_member()

* add a comprehensive native example

* clean up example qwen test and add response_format example to native test

* make build_peg_parser accept std::function instead of template

* change peg parser parameters into const ref

* push tool call on tool open for constructed parser

* add parsing documentation

* clean up some comments

* add json schema support to qwen3-coder

* add id initializer in tests

* remove grammar debug line from qwen3-coder

* refactor qwen3-coder to use sequence over operators

* only call common_chat_peg_parse if appropriate format

* simplify qwen3-coder space handling

* revert qwen3-coder implementation

* revert json-schema-to-grammar changes

* remove unnecessary forward declaration

* small adjustment to until_parser

* rename C/C++ files to use dashes

* codeowners : add aldehir to peg-parser and related files

---------

Co-authored-by: Piotr Wilkin <redacted>
7 weeks agoserver: fix duplicate HTTP headers in multiple models mode (#17698)
Pascal [Wed, 3 Dec 2025 09:28:43 +0000 (10:28 +0100)]
server: fix duplicate HTTP headers in multiple models mode (#17698)

* llama-server: fix duplicate HTTP headers in multiple models mode (#17693)

* llama-server: address review feedback from ngxson

- restrict scope of header after std::move
- simplify header check (remove unordered_set)

7 weeks agoggml webgpu: add support for emscripten builds (#17184)
Reese Levine [Wed, 3 Dec 2025 09:25:34 +0000 (01:25 -0800)]
ggml webgpu: add support for emscripten builds (#17184)

* Faster tensors (#8)

Add fast matrix and matrix/vector multiplication.

* Use map for shader replacements instead of pair of strings

* Wasm (#9)

* webgpu : fix build on emscripten

* more debugging stuff

* test-backend-ops: force single thread on wasm

* fix single-thread case for init_tensor_uniform

* use jspi

* add pthread

* test: remember to set n_thread for cpu backend

* Add buffer label and enable dawn-specific toggles to turn off some checks

* Intermediate state

* Fast working f16/f32 vec4

* Working float fast mul mat

* Clean up naming of mul_mat to match logical model, start work on q mul_mat

* Setup for subgroup matrix mat mul

* Basic working subgroup matrix

* Working subgroup matrix tiling

* Handle weirder sg matrix sizes (but still % sg matrix size)

* Working start to gemv

* working f16 accumulation with shared memory staging

* Print out available subgroup matrix configurations

* Vectorize dst stores for sg matrix shader

* Gemv working scalar

* Minor set_rows optimization (#4)

* updated optimization, fixed errors

* non vectorized version now dispatches one thread per element

* Simplify

* Change logic for set_rows pipelines

---------

Co-authored-by: Neha Abbas <redacted>
Co-authored-by: Neha Abbas <redacted>
Co-authored-by: Reese Levine <redacted>
* Comment on dawn toggles

* Working subgroup matrix code for (semi)generic sizes

* Remove some comments

* Cleanup code

* Update dawn version and move to portable subgroup size

* Try to fix new dawn release

* Update subgroup size comment

* Only check for subgroup matrix configs if they are supported

* Add toggles for subgroup matrix/f16 support on nvidia+vulkan

* Make row/col naming consistent

* Refactor shared memory loading

* Move sg matrix stores to correct file

* Working q4_0

* Formatting

* Work with emscripten builds

* Fix test-backend-ops emscripten for f16/quantized types

* Use emscripten memory64 to support get_memory

* Add build flags and try ci

---------

Co-authored-by: Xuan Son Nguyen <redacted>
* Remove extra whitespace

* Move wasm single-thread logic out of test-backend-ops for cpu backend

* Disable multiple threads for emscripten single-thread builds in ggml_graph_plan

* Fix .gitignore

* Add memory64 option and remove unneeded macros for setting threads to 1

---------

Co-authored-by: Xuan Son Nguyen <redacted>
7 weeks agoci : move release details to the top visible by default (#17719)
Sigbjørn Skjæret [Wed, 3 Dec 2025 08:22:46 +0000 (09:22 +0100)]
ci : move release details to the top visible by default (#17719)

7 weeks agoggml, llama : use defaulted constructors/destructors (#17649)
Herman Semenoff [Wed, 3 Dec 2025 06:12:18 +0000 (09:12 +0300)]
ggml, llama : use defaulted constructors/destructors (#17649)

7 weeks agobuild: document how to compile with Vulkan using Debian/Ubuntu packages (#17688)
Marcos Del Sol Vives [Wed, 3 Dec 2025 00:25:11 +0000 (01:25 +0100)]
build: document how to compile with Vulkan using Debian/Ubuntu packages (#17688)

7 weeks agoserver: add --media-path for local media files (#17697)
Xuan-Son Nguyen [Tue, 2 Dec 2025 21:49:20 +0000 (22:49 +0100)]
server: add --media-path for local media files (#17697)

* server: add --media-path for local media files

* remove unused fn

7 weeks agomtmd: fix --no-warmup (#17695)
Xuan-Son Nguyen [Tue, 2 Dec 2025 21:48:08 +0000 (22:48 +0100)]
mtmd: fix --no-warmup (#17695)

7 weeks agoci : RVV1.0 builds with tests (#16682)
Ali Tariq [Tue, 2 Dec 2025 20:46:10 +0000 (01:46 +0500)]
ci : RVV1.0 builds with tests (#16682)

* Added RISC-V supported tests

* Added default value for LLAMA_FATAL_WARNINGS and option to specify by user

* Added RISC-V supported tests

* Added default value for LLAMA_FATAL_WARNINGS and option to specify by user

* Removed apt prompt

* Added RISC-V specific tests with corrections

Corrections included:
1. Changed the test names from debian to ubuntu as it is more stable than Debian Trixie
2. Added explicit compiler in cmake command as GCC compiler below version 14 have been recorded
to throw errors with rvv1.0 and some other extensions
3. Added dependencies which are not installed by default in the RISC-V Ubuntu 24.04
4. Separate ccache directory for all jobs as all the ccache results are not the same and may cause ccache to not work

* Resolved the merge conflict and cleaned up run.sh

* Update ci/run.sh

Co-authored-by: Sigbjørn Skjæret <redacted>
* Removed previously added build ci for RISC-V

* Removed trailing whitespaces

* corrected build name

Co-authored-by: Sigbjørn Skjæret <redacted>
* cleanup

* Enabled build tests (1)

Co-authored-by: Sigbjørn Skjæret <redacted>
* Enabled build tests (2)

Co-authored-by: Sigbjørn Skjæret <redacted>
* enable openssl

---------

Co-authored-by: Sigbjørn Skjæret <redacted>
7 weeks agovulkan: Reduce temporary memory usage for TOP_K (#17623)
Jeff Bolz [Tue, 2 Dec 2025 18:22:04 +0000 (12:22 -0600)]
vulkan: Reduce temporary memory usage for TOP_K (#17623)

- Compute row size for the temp buffer based on the output of the first pass.
- Update shader addressing math to use the output row size
- Pass the output row size as "ncols_output", what used to be "ncols_output" is now "k"

For the common case of K=40 and src0=(200000,1,1,1), this reduces the temporary buffer
from about 3.2MB to 500KB.

7 weeks agocmake : add utf8 compilation options for msvc (#17682)
xiaobing318 [Tue, 2 Dec 2025 17:50:57 +0000 (01:50 +0800)]
cmake : add utf8 compilation options for msvc (#17682)

7 weeks agoServer: Change Invalid Schema from Server Error (500) to User Error (400) (#17572)
Chad Voegele [Tue, 2 Dec 2025 16:33:50 +0000 (10:33 -0600)]
Server: Change Invalid Schema from Server Error (500) to User Error (400) (#17572)

* Make invalid schema a user error (400)

* Move invalid_argument exception handler to ex_wrapper

* Fix test

* Simplify test back to original pattern

7 weeks agoggml : use svcntb() for SVE vector length detection (#17474)
Adrien Gallouët [Tue, 2 Dec 2025 16:21:11 +0000 (17:21 +0100)]
ggml : use svcntb() for SVE vector length detection (#17474)

Signed-off-by: Adrien Gallouët <redacted>
7 weeks agoCANN: Disable Ger operator of OUT_PROD on 310p device (#17563)
TianHao324 [Tue, 2 Dec 2025 12:35:23 +0000 (20:35 +0800)]
CANN: Disable Ger operator of OUT_PROD on 310p device (#17563)

7 weeks agoggml : remove redundant n_copies check when setting input/output (#17612)
Daniel Bevenius [Tue, 2 Dec 2025 11:52:45 +0000 (12:52 +0100)]
ggml : remove redundant n_copies check when setting input/output (#17612)

This commit removes a redundant check for sched->n_copies > 1 when
setting input and output flags on tensor copies in
ggml_backend_sched_split_graph.

The motivation for this change is to clarify the code as the outer if
statement already performs this check.

7 weeks agocodeowners : remove ericcurtin (#17658)
Eric Curtin [Tue, 2 Dec 2025 11:18:15 +0000 (11:18 +0000)]
codeowners : remove ericcurtin (#17658)

Taking a break from llama.cpp . I wasn't around at the start of llama.cpp
but I want to thank @ggerganov and @slaren for creating a neat community
here.

Signed-off-by: Eric Curtin <redacted>
7 weeks agollama : fix signed comparison warning on FreeBSD (#17497)
Adrien Gallouët [Tue, 2 Dec 2025 11:05:38 +0000 (12:05 +0100)]
llama : fix signed comparison warning on FreeBSD (#17497)

This ensures correct RLIM_INFINITY handling and compatibility on all platforms (32/64-bit).

    warning: comparison of integers of different signs: 'rlim_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Wsign-compare]
      488 |         if (suggest && (lock_limit.rlim_max > lock_limit.rlim_cur + size)) {
          |                         ~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Adrien Gallouët <redacted>
7 weeks agoconvert: add error message for mistral3 quantized weight (#17686)
Xuan-Son Nguyen [Tue, 2 Dec 2025 10:48:31 +0000 (11:48 +0100)]
convert: add error message for mistral3 quantized weight (#17686)

7 weeks agoserver: remove default "gpt-3.5-turbo" model name (#17668)
Xuan-Son Nguyen [Tue, 2 Dec 2025 10:38:57 +0000 (11:38 +0100)]
server: remove default "gpt-3.5-turbo" model name (#17668)

* server: remove default "gpt-3.5-turbo" model name

* do not reflect back model name from request

* fix test

7 weeks agoserver: fixing naming conflict res_error in server-models.cpp (#17679)
senhtry [Tue, 2 Dec 2025 10:18:39 +0000 (18:18 +0800)]
server: fixing naming conflict res_error in server-models.cpp (#17679)

7 weeks agoserver: explicitly set exec path when create new instance (#17669)
Xuan-Son Nguyen [Tue, 2 Dec 2025 09:25:11 +0000 (10:25 +0100)]
server: explicitly set exec path when create new instance (#17669)

* Revert "rm unused fn"

This reverts commit f2dbe9c087ac8776cd41f747a8b0ddf448c8399a.

* server: explicitly set exec path when create new instance

* put back TODO

* only call get_server_exec_path() once

* add fallback logic

7 weeks agoci : skip winget update when not in ggml-org (#17465)
Adrien Gallouët [Tue, 2 Dec 2025 09:15:01 +0000 (10:15 +0100)]
ci : skip winget update when not in ggml-org (#17465)

Prevent forks from generating daily failure notifications.

Signed-off-by: Adrien Gallouët <redacted>
7 weeks agoggml : add fallback definition for HWCAP2_SVE2 (#17683)
Adrien Gallouët [Tue, 2 Dec 2025 08:41:26 +0000 (09:41 +0100)]
ggml : add fallback definition for HWCAP2_SVE2 (#17683)

This align with other HWCAP2 feature flags

See #17528

Signed-off-by: Adrien Gallouët <redacted>
7 weeks agoAdd context info to server error (#17663)
Aleksander Grygier [Tue, 2 Dec 2025 08:20:57 +0000 (09:20 +0100)]
Add context info to server error (#17663)

* fix: Add context info to server error

* chore: update webui build output

7 weeks agoggml-cuda: reorder only relevant nodes (#17639)
Aman Gupta [Tue, 2 Dec 2025 04:36:31 +0000 (12:36 +0800)]
ggml-cuda: reorder only relevant nodes (#17639)

7 weeks agorelease: fix duplicate libs, store symbolic links (#17299)
Aaron Teo [Tue, 2 Dec 2025 03:52:05 +0000 (11:52 +0800)]
release: fix duplicate libs, store symbolic links (#17299)

7 weeks agoenhance argsort for UT (#17573)
Neo Zhang Jianyu [Tue, 2 Dec 2025 00:56:46 +0000 (08:56 +0800)]
enhance argsort for UT (#17573)

Co-authored-by: Neo Zhang <redacted>
7 weeks agoOverride SSM_A op for Qwen3 Next to reduce splits (#17587)
Piotr Wilkin (ilintar) [Mon, 1 Dec 2025 23:43:13 +0000 (00:43 +0100)]
Override SSM_A op for Qwen3 Next to reduce splits (#17587)

* Override SSM_A op for Qwen3 Next to reduce splits

* New tensor mapping SSM_A_NOSCAN for SSM_A used outside of OP_SSM_SCAN context.

* Update src/llama-model.cpp

Co-authored-by: Sigbjørn Skjæret <redacted>
* Update src/llama-model.cpp

Co-authored-by: Sigbjørn Skjæret <redacted>
---------

Co-authored-by: Sigbjørn Skjæret <redacted>
7 weeks agoops.md: update vulkan support (#17661)
Jeff Bolz [Mon, 1 Dec 2025 21:26:21 +0000 (15:26 -0600)]
ops.md: update vulkan support (#17661)

7 weeks agomtmd: add mtmd_context_params::warmup option (#17652)
Xuan-Son Nguyen [Mon, 1 Dec 2025 20:32:25 +0000 (21:32 +0100)]
mtmd: add mtmd_context_params::warmup option (#17652)

* mtmd: add mtmd_context_params::warmup option

* reuse the common_params::warmup

7 weeks agofix: llama arch implementation (#17665)
Gilad S. [Mon, 1 Dec 2025 20:21:13 +0000 (22:21 +0200)]
fix: llama arch implementation (#17665)

7 weeks agoserver: introduce API for serving / loading / unloading multiple models (#17470)
Xuan-Son Nguyen [Mon, 1 Dec 2025 18:41:04 +0000 (19:41 +0100)]
server: introduce API for serving / loading / unloading multiple models (#17470)

* server: add model management and proxy

* fix compile error

* does this fix windows?

* fix windows build

* use subprocess.h, better logging

* add test

* fix windows

* feat: Model/Router server architecture WIP

* more stable

* fix unsafe pointer

* also allow terminate loading model

* add is_active()

* refactor: Architecture improvements

* tmp apply upstream fix

* address most problems

* address thread safety issue

* address review comment

* add docs (first version)

* address review comment

* feat: Improved UX for model information, modality interactions etc

* chore: update webui build output

* refactor: Use only the message data `model` property for displaying model used info

* chore: update webui build output

* add --models-dir param

* feat: New Model Selection UX WIP

* chore: update webui build output

* feat: Add auto-mic setting

* feat: Attachments UX improvements

* implement LRU

* remove default model path

* better --models-dir

* add env for args

* address review comments

* fix compile

* refactor: Chat Form Submit component

* ad endpoint docs

* Merge remote-tracking branch 'webui/allozaur/server_model_management_v1_2' into xsn/server_model_maagement_v1_2

Co-authored-by: Aleksander <redacted>
* feat: Add copy to clipboard to model name in model info dialog

* feat: Model unavailable UI state for model selector

* feat: Chat Form Actions UI logic improvements

* feat: Auto-select model from last assistant response

* chore: update webui build output

* expose args and exit_code in API

* add note

* support extra_args on loading model

* allow reusing args if auto_load

* typo docs

* oai-compat /models endpoint

* cleaner

* address review comments

* feat: Use `model` property for displaying the `repo/model-name` naming format

* refactor: Attachments data

* chore: update webui build output

* refactor: Enum imports

* feat: Improve Model Selector responsiveness

* chore: update webui build output

* refactor: Cleanup

* refactor: Cleanup

* refactor: Formatters

* chore: update webui build output

* refactor: Copy To Clipboard Icon component

* chore: update webui build output

* refactor: Cleanup

* chore: update webui build output

* refactor: UI badges

* chore: update webui build output

* refactor: Cleanup

* refactor: Cleanup

* chore: update webui build output

* add --models-allow-extra-args for security

* nits

* add stdin_file

* fix merge

* fix: Retrieve lost setting after resolving merge conflict

* refactor: DatabaseStore -> DatabaseService

* refactor: Database, Conversations & Chat services + stores architecture improvements (WIP)

* refactor: Remove redundant settings

* refactor: Multi-model business logic WIP

* chore: update webui build output

* feat: Switching models logic for ChatForm or when regenerating messges + modality detection logic

* chore: update webui build output

* fix: Add `untrack` inside chat processing info data logic to prevent infinite effect

* fix: Regenerate

* feat: Remove redundant settigns + rearrange

* fix: Audio attachments

* refactor: Icons

* chore: update webui build output

* feat: Model management and selection features WIP

* chore: update webui build output

* refactor: Improve server properties management

* refactor: Icons

* chore: update webui build output

* feat: Improve model loading/unloading status updates

* chore: update webui build output

* refactor: Improve API header management via utility functions

* remove support for extra args

* set hf_repo/docker_repo as model alias when posible

* refactor: Remove ConversationsService

* refactor: Chat requests abort handling

* refactor: Server store

* tmp webui build

* refactor: Model modality handling

* chore: update webui build output

* refactor: Processing state reactivity

* fix: UI

* refactor: Services/Stores syntax + logic improvements

Refactors components to access stores directly instead of using exported getter functions.

This change centralizes store access and logic, simplifying component code and improving maintainability by reducing the number of exported functions and promoting direct store interaction.

Removes exported getter functions from `chat.svelte.ts`, `conversations.svelte.ts`, `models.svelte.ts` and `settings.svelte.ts`.

* refactor: Architecture cleanup

* feat: Improve statistic badges

* feat: Condition available models based on modality + better model loading strategy & UX

* docs: Architecture documentation

* feat: Update logic for PDF as Image

* add TODO for http client

* refactor: Enhance model info and attachment handling

* chore: update webui build output

* refactor: Components naming

* chore: update webui build output

* refactor: Cleanup

* refactor: DRY `getAttachmentDisplayItems` function + fix UI

* chore: update webui build output

* fix: Modality detection improvement for text-based PDF attachments

* refactor: Cleanup

* docs: Add info comment

* refactor: Cleanup

* re

* refactor: Cleanup

* refactor: Cleanup

* feat: Attachment logic & UI improvements

* refactor: Constants

* feat: Improve UI sidebar background color

* chore: update webui build output

* refactor: Utils imports + move types to `app.d.ts`

* test: Fix Storybook mocks

* chore: update webui build output

* test: Update Chat Form UI tests

* refactor: Tooltip Provider from core layout

* refactor: Tests to separate location

* decouple server_models from server_routes

* test: Move demo test  to tests/server

* refactor: Remove redundant method

* chore: update webui build output

* also route anthropic endpoints

* fix duplicated arg

* fix invalid ptr to shutdown_handler

* server : minor

* rm unused fn

* add ?autoload=true|false query param

* refactor: Remove redundant code

* docs: Update README documentations + architecture & data flow diagrams

* fix: Disable autoload on calling server props for the model

* chore: update webui build output

* fix ubuntu build

* fix: Model status reactivity

* fix: Modality detection for MODEL mode

* chore: update webui build output

---------

Co-authored-by: Aleksander Grygier <redacted>
Co-authored-by: Georgi Gerganov <redacted>
7 weeks agocommon: improve verbosity level definitions (#17630)
Xuan-Son Nguyen [Mon, 1 Dec 2025 13:38:13 +0000 (14:38 +0100)]
common: improve verbosity level definitions (#17630)

* common: improve verbosity level definitions

* string_format

* update autogen docs

7 weeks agomodel: support Ministral3 (#17644)
Xuan-Son Nguyen [Mon, 1 Dec 2025 11:26:52 +0000 (12:26 +0100)]
model: support Ministral3 (#17644)

* conversion script

* support ministral 3

* maybe this is better?

* add TODO for rope_yarn_log_mul

* better ppl (tested on 14B-Instruct)

* Add Ministral3 support to Mistral format

* improve arch handling

* add sizes

* Apply suggestions from code review

Co-authored-by: Sigbjørn Skjæret <redacted>
* nits

---------

Co-authored-by: Julien Denize <redacted>
Co-authored-by: Sigbjørn Skjæret <redacted>
7 weeks agometal : add FA head size 48 (#17619)
Georgi Gerganov [Mon, 1 Dec 2025 10:49:53 +0000 (12:49 +0200)]
metal : add FA head size 48 (#17619)

7 weeks agoggml : extend the GGML_SCHED_NO_REALLOC debug logic of the scheduler (#17617)
Georgi Gerganov [Mon, 1 Dec 2025 10:49:33 +0000 (12:49 +0200)]
ggml : extend the GGML_SCHED_NO_REALLOC debug logic of the scheduler (#17617)

7 weeks agollama-graph: avoid expand_forward for fusion (#17633)
Aman Gupta [Mon, 1 Dec 2025 09:12:48 +0000 (17:12 +0800)]
llama-graph: avoid expand_forward for fusion (#17633)

8 weeks agocontributing: update guidelines for AI-generated code (#17625)
Xuan-Son Nguyen [Sun, 30 Nov 2025 21:51:34 +0000 (22:51 +0100)]
contributing: update guidelines for AI-generated code (#17625)

* contributing: update guidelines for AI-generated code

* revise

8 weeks agocmake : add option to build and link LibreSSL (#17552)
Adrien Gallouët [Sun, 30 Nov 2025 21:14:32 +0000 (22:14 +0100)]
cmake : add option to build and link LibreSSL (#17552)

Signed-off-by: Adrien Gallouët <redacted>
8 weeks agomodel: LFM2-VL fixes (#17577)
Tarek Dakhran [Sun, 30 Nov 2025 20:57:31 +0000 (21:57 +0100)]
model: LFM2-VL fixes (#17577)

* Adjust to pytorch

* Add antialiasing upscale

* Increase number of patches to 1024

* Handle default marker insertion for LFM2

* Switch to flag

* Reformat

* Cuda implementation of antialias kernel

* Change placement in ops.cpp

* consistent float literals

* Pad only for LFM2

* Address PR feedback

* Rollback default marker placement changes

* Fallback to CPU implementation for antialias implementation of upscale

8 weeks agoclip: fix nb calculation for qwen3-vl (#17594)
Xuan-Son Nguyen [Sun, 30 Nov 2025 14:33:55 +0000 (15:33 +0100)]
clip: fix nb calculation for qwen3-vl (#17594)

8 weeks agocli: add migration warning (#17620)
Xuan-Son Nguyen [Sun, 30 Nov 2025 14:32:43 +0000 (15:32 +0100)]
cli: add migration warning (#17620)

8 weeks agocommon : throttle download progress output to reduce IO flush (#17427)
Adrien Gallouët [Sun, 30 Nov 2025 12:22:44 +0000 (13:22 +0100)]
common : throttle download progress output to reduce IO flush (#17427)

This change limits progress updates to approximately every 0.1% of the
file size to minimize stdio overhead.

Also fixes compiler warnings regarding __func__ in lambdas.

Signed-off-by: Adrien Gallouët <redacted>
8 weeks agocommon: add LLAMA_LOG_FILE env var (#17609)
Aaron Teo [Sun, 30 Nov 2025 11:12:32 +0000 (19:12 +0800)]
common: add LLAMA_LOG_FILE env var (#17609)

Signed-off-by: Aaron Teo <redacted>
8 weeks agoggml: fix: macOS build with `-DGGML_BACKEND_DL=ON` (#17581)
Gilad S. [Sun, 30 Nov 2025 02:00:59 +0000 (04:00 +0200)]
ggml: fix: macOS build with `-DGGML_BACKEND_DL=ON` (#17581)

8 weeks agocommon: update env var name (#17588)
ddh0 [Sun, 30 Nov 2025 01:59:25 +0000 (19:59 -0600)]
common: update env var name (#17588)

8 weeks agoCUDA: add stream-based concurrency (#16991)
Aman Gupta [Sun, 30 Nov 2025 00:17:55 +0000 (08:17 +0800)]
CUDA: add stream-based concurrency (#16991)

* CUDA: add stream-based concurrency

* HIP: fix hipStreamWaitEvent define and nodiscard warnings

* ggml-cuda: fix fusion inside stream

* ggml-cuda: fix bug w.r.t first stream launch

* ggml-cuda: format

* ggml-cuda: improve assert message

* ggml-cuda: use lambda instead of duplicating code

* ggml-cuda: add some more comments

* ggml-cuda: add more detailed comments about concurrency

* ggml-cuda: rename + remove unused var

* ggml-cuda: fix condition for stream launch

* ggml-cuda: address review comments, add destructor

* common.cuh: add is_valid for concurrent events

* common.cuh: make comment better

* update comment

Co-authored-by: Johannes Gäßler <redacted>
* update comment

Co-authored-by: Johannes Gäßler <redacted>
* common.cuh: fix lower_bound condition + remove join_node data from write_ranges

* ggml-cuda: fix overlap condition + shadowing parameter

---------

Co-authored-by: Carl Philipp Klemm <redacted>
Co-authored-by: Johannes Gäßler <redacted>
8 weeks ago cuda : add error checking for cudaMemcpyAsync in argsort (#17599)
Mahekk Shaikh [Sun, 30 Nov 2025 00:16:28 +0000 (19:16 -0500)]
   cuda : add error checking for cudaMemcpyAsync in argsort (#17599)

* cuda : add error checking for cudaMemcpyAsync in argsort (#12836)

* fix indentation

8 weeks agovulkan : fix FA mask load with bounds check (coopmat2) (#17606)
Acly [Sun, 30 Nov 2025 00:03:21 +0000 (01:03 +0100)]
vulkan : fix FA mask load with bounds check (coopmat2) (#17606)

8 weeks agoserver: move server-context to its own cpp|h (#17595)
Xuan-Son Nguyen [Sat, 29 Nov 2025 21:04:44 +0000 (22:04 +0100)]
server: move server-context to its own cpp|h (#17595)

* git mv

* add server-context.h

* add server-context.h

* clean up headers

* cont : cleanup

* also expose server_response_reader (to be used by CLI)

* fix windows build

* decouple server_routes and server_http

---------

Co-authored-by: Georgi Gerganov <redacted>
8 weeks agoserver: explicitly set the function name in lambda (#17538)
Haiyue Wang [Sat, 29 Nov 2025 17:43:29 +0000 (01:43 +0800)]
server: explicitly set the function name in lambda (#17538)

As [1] explained, the real debug message will be like:
"res    operator(): operator() : queue result stop"

Set the name explicitly, the message is easy for debugging:
"res    operator(): recv : queue result stop"

The left "operator()" is generated by 'RES_DBG() ... __func__'

[1]: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/lambda-function-name.html

Signed-off-by: Haiyue Wang <redacted>
8 weeks agocommon : fix json schema with '\' in literals (#17307)
Igor Smirnov [Sat, 29 Nov 2025 16:06:32 +0000 (21:06 +0500)]
common : fix json schema with '\' in literals (#17307)

* Fix json schema with '\' in literals

* Add "literal string with escapes" test

8 weeks agosycl : support to malloc memory on device more than 4GB, update the doc and script...
Neo Zhang [Sat, 29 Nov 2025 12:59:44 +0000 (20:59 +0800)]
sycl : support to malloc memory on device more than 4GB, update the doc and script (#17566)

Co-authored-by: Neo Zhang Jianyu <redacted>
8 weeks agoggml: replace hwcap with riscv_hwprobe for RVV detection (#17567)
ixgbe [Sat, 29 Nov 2025 12:56:31 +0000 (20:56 +0800)]
ggml: replace hwcap with riscv_hwprobe for RVV detection (#17567)

Signed-off-by: Wang Yang <redacted>
8 weeks agoVulkan: MMVQ Integer Dot K-Quant and MUL_MAT_ID support (#16900)
Ruben Ortlam [Sat, 29 Nov 2025 08:37:22 +0000 (09:37 +0100)]
Vulkan: MMVQ Integer Dot K-Quant and MUL_MAT_ID support (#16900)

* vulkan: split mul_mmq_funcs for mul_mat_vecq use

* add mxfp4 mmvq

* add q2_k mmvq

* add q3_k mmvq

* add q4_k and q5_k mmvq

* add q6_k mmvq

* handle 4x4 quants per mmvq thread

* enable MUL_MAT_ID mmvq support

* enable subgroup optimizations for mul_mat_vec_id shaders

* device tuning

* request prealloc_y sync after quantization

* fix indentation

* fix llvmpipe test failures

* fix mul_mat_id mmvq condition

* fix unused variable warning

8 weeks agovulkan: improve topk perf for large k, fix overflow in unit tests (#17582)
Jeff Bolz [Sat, 29 Nov 2025 07:39:57 +0000 (01:39 -0600)]
vulkan: improve topk perf for large k, fix overflow in unit tests (#17582)

8 weeks agogguf-py : fix passing non-native endian tensors (editor-gui and new-metadata) (#17553)
Aleksei Nikiforov [Fri, 28 Nov 2025 19:53:01 +0000 (20:53 +0100)]
gguf-py : fix passing non-native endian tensors (editor-gui and new-metadata) (#17553)

gguf_new_metadata.py reads data from reader.
Reader doesn't byteswap tensors to native endianness.
But writer does expect tensors in native endianness to convert them
into requested endianness.

There are two ways to fix this: update reader and do conversion to native endianness and back,
or skip converting endianness in writer in this particular USE-case.

gguf_editor_gui.py doesn't allow editing or viewing tensor data.
Let's go with skipping excessive byteswapping.

If eventually capability to view or edit tensor data is added,
tensor data should be instead byteswapped when reading it.