# llama.cpp fixes token limit beyond 65,535

> A bug that stopped processing over 65,535 tokens on NVIDIA and AMD GPUs is fixed, allowing tests up to 70,000 tokens.

Oossa · 2026-11-28 · https://oossa.com/en/llama-cpp-fixes-token-limit-beyond-65-535

The llama.cpp library updated its CUDA kernel to clamp the grid size, stopping the "invalid configuration argument" error that hit when more than 65,535 tokens were processed. A new test case now runs with 70,000 tokens, extending the previous maximum of 129.

## The facts

- The kernel failed for token counts above 65,535.
- A test now runs successfully with 70,000 tokens.

## Why it matters

Developers can run longer prompts on supported GPUs, but actual limits will still be set by memory and compute capacity.

## What it means for you

If you use llama.cpp on a GPU, you can now generate longer outputs without hitting the token‑count crash.

**Our take:** The fix removes a hard ceiling that blocked many long‑prompt use cases, though performance will still depend on your hardware.

## Sources & references

1. [ggml-org/llama.cpp b12823](https://github.com/ggml-org/llama.cpp/releases/tag/b12823) – llama.cpp, 2026-11-28

Last updated: 2026-11-28
