feat: FIFO admission proxy for local LLM servers - #1
Open
eizus wants to merge 2 commits into
Open
Conversation
Serialize generation POSTs (default one in-flight) and queue the rest so two Hermes threads cannot prefill MTPLX at once. Health and model list stay concurrent. Stdlib HTTP reverse proxy, Hermit-pinned CPython 3.13, localhost bind only.
Copy upstream with HTTPResponse.read1 so Transfer-Encoding is decoded instead of forwarded as framing, and close when there is no Content-Length. Drain Content-Length on 429/503 so keep-alive clients stay synchronized. Ticket is a context manager.
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.
Summary
cdrxyz/llm-queue-proxy: localhost reverse proxy that admits one in-flight generation POST (FIFO queue for the rest)./v1/modelspass through concurrently.read1+ flush (not buffered to completion).Motivation
Hermes has no global one-request queue. Two local-only threads still overlap MTPLX prefills and abort with GPU memory pressure. This proxy is the admission layer in front of
:8000.It does not evict KV or fix a single oversized context at zero headroom.
Test Plan
./bin/python3 -m pytest— 17 passed (admission FIFO/full/timeout, path matching, concurrent GET, serialized POST, 429/503, streaming, health, CLI)./bin/python3 -m ruff check src tests./bin/hermit install python3@3.13)Notes for Reviewers
0.0.0.0/::.<hello@cdr.xyz>.