-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Better server params and fields #130
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
Merged
abetlen
merged 11 commits into
abetlen:main
from
Stonelinks:better-server-params-and-fields
May 7, 2023
Merged
Better server params and fields #130
abetlen
merged 11 commits into
abetlen:main
from
Stonelinks:better-server-params-and-fields
May 7, 2023
Conversation
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
8b81fc8
to
114c9f3
Compare
Upvote. Muchas gracias! 👍 |
5204a6a
to
1c7cc8c
Compare
`model` is ignored, but currently marked "optional"... on the one hand could mark "required" to make it explicit in case the server supports multiple llama's at the same time, but also could delete it since its ignored. decision: mark it required for the sake of openai api compatibility. I think out of all parameters, `model` is probably the most important one for people to keep using even if its ignored for now.
`n`, `presence_penalty`, `frequency_penalty`, `best_of`, `logit_bias`, `user`: not supported, excluded from the calls into llama. decision: delete it
I think this is actually supported (its in the arguments of `LLama.__call__`, which is how the completion is invoked). decision: mark as supported
`llama.create_chat_completion` definitely has a `top_k` argument, but its missing from `CreateChatCompletionRequest`. decision: add it
Slight refactor for common fields shared between completion and chat completion
When I generate a client, it breaks because it fails to process the schema of ChatCompletionRequestMessage These fix that: - I think `Union[Literal["user"], Literal["channel"], ...]` is the same as Literal["user", "channel", ...] - Turns out default value `Literal["user"]` isn't JSON serializable, so replace with "user"
1c7cc8c
to
dbbfc4b
Compare
Not sure why this union type was here but taking a look at llama.py, prompt is only ever processed as a string for completion This was breaking types when generating an openapi client
6396f7e
to
b9098b0
Compare
…r-server-params-and-fields
@Stonelinks great work! I want to merge this in but I'd like to keep the unsupported fields in the API as they were before. Otherwise I'm very happy with the addition of the |
xaptronic
pushed a commit
to xaptronic/llama-cpp-python
that referenced
this pull request
Jun 13, 2023
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.
This is a lot, but the net is that:
Field
annotations)Reasoning should be in commit messages for individual decisions, with some more details here: Stonelinks#3
The result of all this should be better documentation from the swagger / openapi docs available from the server, as well as improved clients generated from
openapi.json
(up next)