Change8

Migrating to llama.cpp b7748

Version b7748 introduces 2 breaking changes. This guide details how to update your code.

Released: 1/15/2026

2
Breaking Changes
2
Migration Steps
5
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

`pending_token_idx``ctx->weighted_sum``ctx->total_weight``llama_sampler_adaptive_p_i``common_sampler_types_from_chars`

Breaking Changes

Issue #1

The type for `pending_token_idx` was switched from `llama_token` to `int32`. This is functionally identical since `llama.h` defines `typedef int32_t llama_token;`, but users relying on the specific type alias might need to update their code.

Issue #2

The initialization and reset logic for moving average calculations in the sampler has changed: `ctx->weighted_sum` is now initialized/reset to `target / (1.0f - clamped_decay)` and `ctx->total_weight` is now initialized/reset to `1.0f / (1.0f - clamped_decay)` to fix a cold start problem. This affects how the moving average is calculated internally.

Migration Steps

  1. 1
    If you were using the old power-law sampler logic, note that it has been renamed to `adaptive-p`.
  2. 2
    Update code that relies on the type of `pending_token_idx` as it is now explicitly `int32` instead of `llama_token` (though they are typedef equivalents).

Release Summary

This release introduces the new adaptive-p sampler, which replaces the previous power-law implementation, and includes several internal fixes related to sampler initialization and logit handling.

Need More Details?

View the full release notes and all changes for llama.cpp b7748.

View Full Changelog