Skip to content

Add /v1/models endpoint to GenerationServer - #4774

Merged
pzhan9 merged 3 commits into
pytorch:mainfrom
pzhan9:generation-server-v1-models
Sep 18, 2026
Merged

pzhan9 merged 3 commits into
pytorch:mainfrom
pzhan9:generation-server-v1-models

Conversation

@pzhan9

@pzhan9 pzhan9 commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Verifiers uses the /v1/models endpoint for the prompt-truncation path:

  • uses this endpoint to discover max_model_len: link
  • rejects the overlong prompt before generation: link
  • translates the renderer error: link
  • cleanly stops the trace as context_length: link

This PR adds it.

@pytorch-bot pytorch-bot Bot added ciflow/fake-pg Run 1-GPU Fake PG integration tests ciflow/rl labels Sep 17, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 17, 2026

@felipemello1 felipemello1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!

@@ -131,6 +144,19 @@ async def _handle_health_request(self, request: web.Request) -> web.Response:
del request
return web.json_response({"status": "ok"})

async def _handle_models_request(self, request: web.Request) -> web.Response:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

not related to this PR, but we haven't really added anything related to structured logger as decorators here. So we are a bit blind about any bottlenecks that these functions may be introducing.

@pzhan9 pzhan9 Sep 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, we need some observability for the endpoints' latency. (basically standard metrics for a web service)

@pzhan9
pzhan9 force-pushed the generation-server-v1-models branch from 2626e90 to b692574 Compare September 18, 2026 21:00
@pzhan9
pzhan9 merged commit 003beaa into pytorch:main Sep 18, 2026
16 checks passed
@pzhan9
pzhan9 deleted the generation-server-v1-models branch September 18, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/fake-pg Run 1-GPU Fake PG integration tests ciflow/rl CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants