ggml-org/llama.cpp
server: avoid full prompt eval when 'prompt >= ctx'
Fechada
#6.855 aberto em 23 de abr. de 2024
enhancementgood first issue
Métricas do repositório
- Stars
- (124.222 estrelas)
- Métricas de merge de PR
- (Mesclagem média 6d 8h) (389 fundiu PRs em 30d)
Description
When using the server for multi-turn chat, soon or later the prompt is going to surpass the context size, the current approach truncate the prompt by half of the context size excluding n_keep:
By doing that, common_part is going to match only n_keep tokens (when cache_prompt: true):
Technically, this is not a full prompt eval, n_keep is not revaluated, but it would be better to avoid this if possible, specially because prompt eval is slow on CPU.