Server: Handle n_keep parameter in the request#6174
Merged
Conversation
phymbert
reviewed
Mar 20, 2024
| llama_params["repeat_last_n"] = json_value(body, "repeat_last_n", default_sparams.penalty_last_n); | ||
| llama_params["ignore_eos"] = json_value(body, "ignore_eos", false); | ||
| llama_params["tfs_z"] = json_value(body, "tfs_z", default_sparams.tfs_z); | ||
| llama_params["n_keep"] = json_value(body, "n_keep", 0); |
Collaborator
There was a problem hiding this comment.
Hello, thanks but @ggerganov @ngxson I worry this is actually not OAI compatible ?
Contributor
There was a problem hiding this comment.
we can consider it as an "extension" to OAI, for example tfs_z or mirostat that we're having, they are not available on OAI.
Contributor
There was a problem hiding this comment.
In fact this code is duplicated to the one inside launch_slot_with_task, I planned to refactor all of OAI-related logic to one place, maybe I'll do this during weekend.
ngxson
approved these changes
Mar 20, 2024
Contributor
ngxson
left a comment
There was a problem hiding this comment.
LGTM. It's quite surprise to know that server does not have --n-keep argument, maybe we need to add that in the future.
phymbert
approved these changes
Mar 20, 2024
hodlen
pushed a commit
to hodlen/llama.cpp
that referenced
this pull request
Apr 3, 2024
Seunghhon
pushed a commit
to Seunghhon/llama.cpp
that referenced
this pull request
Apr 26, 2026
phuongncn
pushed a commit
to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4
that referenced
this pull request
Apr 28, 2026
ljubomirj
pushed a commit
to ljubomirj/llama.cpp
that referenced
this pull request
May 6, 2026
my-other-github-account
pushed a commit
to my-other-github-account/llama.cpp
that referenced
this pull request
May 15, 2026
my-other-github-account
pushed a commit
to my-other-github-account/llama.cpp
that referenced
this pull request
May 15, 2026
AlexiAlp
pushed a commit
to minghaop/llama.cpp
that referenced
this pull request
Jun 2, 2026
AlexiAlp
pushed a commit
to minghaop/llama.cpp
that referenced
this pull request
Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.