Skip to content

Conversation

ggerganov
Copy link
Member

The "t_max_predict_ms" parameter can be passed in completion and infill requests to optionally limit the time for the generation phase. The server will stop generating new tokens if the specified time is exceeded and a new-line character has already been generated.

curl \
    --request POST --url http://127.0.0.1:8013/completion \
    --header "Content-Type: application/json" \
    --data '{"prompt": "int main(int argc, char", "n_predict": 999, "stream": true, "t_max_predict_ms": 500}'

@ggerganov ggerganov merged commit edc2656 into master Oct 12, 2024
57 checks passed
@ggerganov ggerganov deleted the gg/server-time-limits branch October 12, 2024 13:14
drollings pushed a commit to drollings/llama.cpp that referenced this pull request Oct 18, 2024
dsx1986 pushed a commit to dsx1986/llama.cpp that referenced this pull request Oct 29, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 15, 2024
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant