Skip to content

Disaggregated router: add the /v1/completions endpoint #200

Closed

Description

@inureyes

Context

Follow-up from epic #116 (#126, router front). The disaggregated router only serves chat completions.

Problem

create_router_app (src/server/router_front.rs) registers only POST /v1/chat/completions and GET /health. The text-completion endpoint POST /v1/completions (served single-node by routes::completions) is not available through the router.

Implementation

  • Add a router_completions handler that parses a completion request, tokenizes the raw prompt with the same add_special rule the worker uses (!prompt.starts_with("<bos>") && !prompt.starts_with("<s>")), and reuses the same route -> send PrefillRequestFrame -> demux -> SSE/JSON path as the chat handler.
  • Factor the shared body (tokenize -> select_prefill -> send -> drive_handoff_result -> emit) so chat and completions share it; the difference is request parsing and the response chunk shape (completion chunk vs chat chunk).
  • Register the route in create_router_app.

Acceptance criteria

  • POST /v1/completions through the router returns output byte-identical to single-node /v1/completions for the same prompt and sampling.

Activity

  1. added
    status:backlog
    type:enhancement
    priority:low
    area:architecture
    on Jun 9, 2026
  2. self-assigned this
    on Jun 13, 2026
  3. added this to the 0.4 milestone on Jun 21, 2026
  4. added
    status:in-progress
    status:review
    status:done
    and removed
    status:backlog
    status:in-progress
    status:review
    on Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:architecturepriority:lowstatus:donetype:enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions