Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server : add option to time limit the generation phase #9865

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

ggerganov
Copy link
Owner

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
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