You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Disaggregated router: add the /v1/completions endpoint #200
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
feat(server): add /v1/completions to the disaggregated router (#386)
feat(server): add /v1/completions to the disaggregated router (lablup…