Summary: The ggerganov/llama.cpp b9731 release optimizes the get_token_probabilities function in the llama.cpp server. By utilizing std::partial_sort to order only the requested top-n tokens instead of the entire 128,000-token vocabulary, the query time is reduced from 8.5 ms to 0.7 ms. This optimization was contributed by Adrien Gallouët of Hugging Face.
Why it matters: This significantly reduces server latency when querying logprobs, which is crucial for applications implementing structured outputs, classifiers, or custom sampling methods. AI builders deploying local LLMs should update to the latest llama.cpp server builds to benefit from the performance gain.