Repository navigation
feat(serve): a chat-completions server, on the CPU and from the GPU - #32
Merged
Merged
Conversation
… scores, generation that continues from where the model stands
…e formats, the reply reader, an engine that keeps its last conversation
…ing and conversations
… a best score that is not finite is the greedy choice; review fixes
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.
What
A chat-completions server, so the engine can be used by the tools that already speak that format.
dluth-serve: an HTTP/1.1 layer written onstd::net(no new dependency), the request and response formats, a reader that cuts a reply into thinking and text, an engine that keeps its last conversation so a follow-up turn only reads what is new, and the server loop.dluth serveruns it on the CPU model;dluth-cuda serveruns it on the GPU.dluth-model: conversations of several turns after the model's own template, drawing a token from the scores (temperature, top_p, seed), and generation that continues from where the model stands./v1/chat/completions(whole or streamed),/v1/models,/health.DLUTH_API_KEYmakes a bearer key required. It is compared in constant time and never printed.Limits
One conversation at a time, text only, no tools, plain HTTP, one request per connection. It listens on loopback unless told otherwise.
How it was checked
Review
Fixed:
authentication_error; the scheme namebeareris accepted in any case; README additions; a misleading test comment.Declined:
(text.is_empty() || sink(..)) && !hitis false whenever a stop was hit. A test now pins the case.