Skip to content

REF: extract route registration into domain-specific routers/#4600

Merged
qinxuye merged 1 commit intoxorbitsai:mainfrom
amumu96:chore/extract-api-routers
Feb 12, 2026
Merged

REF: extract route registration into domain-specific routers/#4600
qinxuye merged 1 commit intoxorbitsai:mainfrom
amumu96:chore/extract-api-routers

Conversation

@amumu96
Copy link
Copy Markdown
Contributor

@amumu96 amumu96 commented Feb 12, 2026

Move all add_api_route calls from RESTfulAPI.serve() into separate modules under xinference/api/routers/:

  • admin.py: status, cluster, workers, supervisor, cache, virtualenvs
  • models.py: list/launch/terminate/describe/registrations/engines/UI
  • llm.py: completions, chat/completions, Anthropic messages, flexible infer
  • embeddings.py: embeddings, convert_ids_to_tokens
  • rerank.py: rerank
  • audio.py: transcriptions, translations, speech
  • images.py: generations, variations, inpainting, ocr, edits, SD API
  • videos.py: text-to-video, image-to-video, flf-to-video

Handler methods remain in RESTfulAPI class (no behavior change). serve() now calls register_all_routes(self) instead of inline registration. Unused imports (Security, AnthropicMessage, etc.) removed from restful_api.py.

Move all add_api_route calls from RESTfulAPI.serve() into separate
modules under xinference/api/routers/:
- admin.py: status, cluster, workers, supervisor, cache, virtualenvs
- models.py: list/launch/terminate/describe/registrations/engines/UI
- llm.py: completions, chat/completions, Anthropic messages, flexible infer
- embeddings.py: embeddings, convert_ids_to_tokens
- rerank.py: rerank
- audio.py: transcriptions, translations, speech
- images.py: generations, variations, inpainting, ocr, edits, SD API
- videos.py: text-to-video, image-to-video, flf-to-video

Handler methods remain in RESTfulAPI class (no behavior change).
serve() now calls register_all_routes(self) instead of inline registration.
Unused imports (Security, AnthropicMessage, etc.) removed from restful_api.py.
@XprobeBot XprobeBot added this to the v2.x milestone Feb 12, 2026
Copy link
Copy Markdown
Contributor

@qinxuye qinxuye left a comment

Choose a reason for hiding this comment

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

LGTM

@qinxuye qinxuye merged commit d151e41 into xorbitsai:main Feb 12, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants