# llama.cpp now quantizes to a file size you choose

By Ivo Donker · 24 November 2026 — text: Claude (AI)
What is new in llama.cpp? Since build b12669 of November 24, llama-quantize can pick its own mix of quantization types per tensor to hit a given file size (--target-size) or an average number of bits per weight (--target-bpw), with as little error as possible. If you want a model to fit exactly in the memory of your GPU or Mac, you no longer have to choose between a standard variant that is too small and one that is too big. Improvements for Apple chips (Metal) landed the same day.

We read [pull request #15550](https://github.com/ggml-org/llama.cpp/pull/15550) and the release notes of builds b12667 to b12671 through the GitHub API.

## What happened

The proposal by developer EAddario had been open since August 2025 and was merged on November 23 at 17:06 UTC. Build b12669 with the feature appeared on November 24 at 02:38 UTC. The new function target_bpw_type() solves an optimisation problem: which tensor gets how many bits, so that the total stays within budget and the error is as small as possible.

According to the description it works in four steps: estimate the error per tensor by quantizing and dequantizing a sample of rows, weighted by an importance matrix (imatrix); drop, per tensor, the types that are larger without being better; spread the bits across the whole model with a Lagrangian method; and save intermediate results in a --state-file so an interrupted run can resume.

What happened
Item | Per the pull request | 

New options | --target-size (e.g. 23.85g) and --target-bpw (e.g. 4.5678) | 

Tested | 34 models, 238 tests | 

Equal to or better than standard (KLD) | 93 percent of cases | 

Time | 5 to 10 times longer than normal quantization | 

Requires | imatrix with activation data (recent llama-imatrix) | 

The pull request gives an example: on a system with 24 GB of video memory and a 70-billion-parameter model, standard types give a 16.8 GB file (quality left on the table) or a 24.1 GB file (does not fit). With --target-size 23.85g you get a 23.85 GiB file.

## Also new for Macs

- b12668: the Metal backend supports BF16 and F32 input for matrix multiplications ([#32677](https://github.com/ggml-org/llama.cpp/pull/32677)). MoE models can keep BF16 activations, and audio processing in libmtmd can run at full F32 precision on the GPU.

- b12671: concatenating rows on Metal now copies contiguous rows in vector chunks instead of element by element ([#32824](https://github.com/ggml-org/llama.cpp/pull/32824)), using more of the memory bandwidth.

- b12670: a compact bias in the existing Flash Attention, needed to run Inkling 2 models with full Flash Attention; without this patch they used huge amounts of video memory, the author says ([#32740](https://github.com/ggml-org/llama.cpp/pull/32740)).

- b12667: the built-in shell tool of llama-server asks the model for a short description of each command, so a client can show what it is for.

## What this means

For anyone running models locally, the target size is the key change. The memory of a laptop or graphics card is a hard limit, and until now fixed rules per standard type decided how big a file became. The author lists the limits: it takes much more compute, the optimisation uses an estimated per-tensor error rather than actual quality, and without a suitable imatrix the option refuses to run. The 93 percent figure comes from the author's own tests. Background on quantization is in [our article on quantization from 16 to 4 bits](https://nieuws.llmnet.nl/en/quantization-in-productie-van-16-bit-naar-4-bit-precisie). Earlier steps in the project are in [our article on the stable llama.cpp API](https://nieuws.llmnet.nl/en/llama-cpp-v1-stabiele-api), and the Inkling models in [our article on running Inkling 2 Mini locally](https://nieuws.llmnet.nl/en/inkling-2-mini-lokaal).

## What we did not check

We did not test the new option ourselves: it needs a model plus a recent imatrix and, per the author, takes 5 to 10 times longer than a normal quantization. The test results (KLD per model) come from the pull request. llama.cpp builds are marked 'prerelease' on GitHub.

Checked on November 24, 2026.

This article was written with AI (Claude) and checked against the sources below.

## Sources

- Pull request #15550, target_bpw_type (merged November 23, 2026): [github.com](https://github.com/ggml-org/llama.cpp/pull/15550)

- Release b12669 (November 24, 2026): [github.com](https://github.com/ggml-org/llama.cpp/releases/tag/b12669)

- Pull request #32677, BF16/F32 src1 on Metal: [github.com](https://github.com/ggml-org/llama.cpp/pull/32677)

- Pull request #32824, Metal concat in vector chunks: [github.com](https://github.com/ggml-org/llama.cpp/pull/32824)

- Pull request #32740, compact bias in Flash Attention: [github.com](https://github.com/ggml-org/llama.cpp/pull/32740)
