Skip to content

Conversation

merrymercy
Copy link
Contributor

@merrymercy merrymercy commented Jan 20, 2025

We want to separate the Engine and HTTP server, so we can use the two entrypoints flexibly without depending on each other.

This PR splits the file python/sglang/srt/server.py into the following two files:

  • Engine: python/sglang/srt/entrypoints/engine.py
    • Engine class, _launch_subprocesses
  • HTTP server: python/sglang/srt/entrypoints/http_server.py
    • launch_server, FastAPI registration (@app.api_route("/generate", methods=["POST", "PUT"]))

The old server.py is deprecated now. This PR is based on #2959.

@merrymercy merrymercy mentioned this pull request Jan 20, 2025
4 tasks
@merrymercy merrymercy changed the title Separate Engine and HTTP server Separate two entry points: Engine and HTTP server Jan 20, 2025
Co-authored-by: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com>
@merrymercy merrymercy merged commit 0346489 into main Jan 20, 2025
21 checks passed
@merrymercy merrymercy deleted the pr-fix-engine branch January 20, 2025 06:09
timethink pushed a commit to timethink/sglang that referenced this pull request Mar 9, 2025
Co-authored-by: fzyzcjy <5236035+fzyzcjy@users.noreply.github.com>
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