Skip to content

feat: FIFO admission proxy for local LLM servers - #1

Open
eizus wants to merge 2 commits into
masterfrom
2026-09-01.eizus.admission-proxy
Open

feat: FIFO admission proxy for local LLM servers#1
eizus wants to merge 2 commits into
masterfrom
2026-09-01.eizus.admission-proxy

Conversation

@eizus

@eizus eizus commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • New OSS repo cdrxyz/llm-queue-proxy: localhost reverse proxy that admits one in-flight generation POST (FIFO queue for the rest).
  • Health / /v1/models pass through concurrently.
  • Full wait queue → HTTP 429; waiter timeout → HTTP 503.
  • SSE copied with read1 + flush (not buffered to completion).
  • Hermit pins CPython 3.13; runtime is stdlib-only.

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
  • CI on the PR (./bin/hermit install python3@3.13)

Notes for Reviewers

  • Bind refuses 0.0.0.0 / ::.
  • Access logs only; no header dumps.
  • Author: eizus <hello@cdr.xyz>.

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.
@eizus
eizus requested a review from adrw September 2, 2026 03:07
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant