Skip to content

feat: add submodule of worker-vllm, updated fastapi endpoints - #6

Open
velaraptor-runpod wants to merge 13 commits into
mainfrom
feat/update-vllm
Open

feat: add submodule of worker-vllm, updated fastapi endpoints#6
velaraptor-runpod wants to merge 13 commits into
mainfrom
feat/update-vllm

Conversation

@velaraptor-runpod

Copy link
Copy Markdown

No description provided.

@TimPietruskyRunPod TimPietruskyRunPod left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few items to address before merge — mostly small fixes. The core rewrite using vLLM's native serving classes is solid.

Comment thread handler_lb.py Outdated
Comment thread handler_lb.py
Comment thread .runpod/tests_json Outdated
Comment thread README.md
Comment thread README.md
Comment thread .runpod/README.md

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the project from a custom FastAPI + vLLM wrapper (src/handler.py + local request/response models) to a new load-balancer-oriented HTTP server (handler_lb.py) built on top of the worker-vllm submodule and vLLM’s OpenAI/Anthropic entrypoints, while updating documentation and RunPod Hub metadata accordingly.

Changes:

  • Replaced the legacy src/ handler/models/utils with handler_lb.py, exposing /ping, /v1/models, OpenAI Completions/Chat/Responses, and Anthropic Messages endpoints.
  • Updated the Docker image to CUDA 12.9 + vllm[flashinfer], and switched the container layout to copy worker-vllm/src into /src.
  • Added RunPod Hub assets (.runpod/*) and the worker-vllm git submodule; removed the previous example script and CI workflow files.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 15 comments.

Show a summary per file
File Description
handler_lb.py New FastAPI server implementing RunPod LB health semantics and OpenAI/Anthropic-compatible endpoints via vLLM serving classes.
Dockerfile Moves to CUDA 12.9 base, installs uv + vLLM/FlashInfer, and copies worker-vllm sources for engine/model download.
README.md Updated documentation for the new architecture, endpoints, and environment variables (worker-vllm based).
.runpod/README.md Added RunPod template documentation for configuration and SDK usage.
.runpod/hub.json Added RunPod Hub metadata/configuration for LB endpoint deployment.
.gitmodules Adds worker-vllm as a git submodule dependency.
src/handler.py Removed legacy custom FastAPI handler implementation.
src/models.py Removed legacy Pydantic request/response models.
src/utils.py Removed legacy tokenizer/prompt formatting helpers.
example.py Removed legacy manual test script.
builder/setup.sh Removed legacy optional setup script.
.github/workflows/CI-test_handler.yml Removed legacy CI workflow.
.github/workflows/CI-test_e2e.yml Removed legacy CI workflow.
.github/workflows/CI-runpod_dep.yml Removed legacy CI workflow.
.github/workflows/build-test-release.yml Removed legacy CI workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread handler_lb.py
return StreamingResponse(response, media_type="text/event-stream")


if __name__ == "__main__" or multiprocessing.current_process().name == "MainProcess":
Comment thread handler_lb.py
Comment on lines +198 to +206
@app.post("/v1/chat/completions")
async def chat_completions(request: Request):
body = await request.json()

try:
req = ChatCompletionRequest(**body)
except Exception as e:
log.warning(f"Chat completions validation error: {e}")
return JSONResponse(
Comment thread handler_lb.py


@app.get("/v1/models")
async def list_models():
Comment thread handler_lb.py
Comment on lines +211 to +212
response = await _chat_engine.create_chat_completion(req, raw_request=request)

Comment thread Dockerfile
Comment on lines +15 to +18
# Install additional Python dependencies (after vLLM to avoid PyTorch version conflicts)
COPY worker-vllm/builder/requirements.txt /requirements.txt
RUN --mount=type=cache,target=/root/.cache/uv \
uv pip install --system -r /requirements.txt
Comment thread handler_lb.py
Comment on lines +240 to +241
response = await _completion_engine.create_completion(req, raw_request=request)

Comment thread handler_lb.py
Comment on lines +269 to +270
response = await _responses_engine.create_responses(req, raw_request=request)

Comment thread handler_lb.py
Comment on lines +350 to +351
response = await _messages_engine.create_messages(req, raw_request=request)

Comment thread handler_lb.py
Comment on lines +293 to +296
try:
response = await _responses_engine.retrieve_responses(
response_id, starting_after=starting_after, stream=stream
)
Comment thread handler_lb.py
Comment on lines +321 to +322
try:
response = await _responses_engine.cancel_responses(response_id)
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.

4 participants