feat: add BaseInfer ABC, input size limits, and payload size middleware#10
Merged
feat: add BaseInfer ABC, input size limits, and payload size middleware#10
Conversation
added 2 commits
April 7, 2026 15:57
Introduce BaseInfer abstract base class that all inference backends (vLLM, Transformers, Diffusers, Custom) now inherit from. This unifies the interface, eliminates duplicated "not supported" boilerplate, and adds per-model max_context_length detection in every loader. Add PayloadSizeLimitMiddleware to the gateway (YASHA_MAX_REQUEST_BODY_BYTES, default 50 MB) as a coarse safety net against oversized requests. Add max_context_length() to all plugin base classes so plugins can report their model's context limit.
…ion and context length tracking - Remove use_gpu (int/str) config and CUDA_VISIBLE_DEVICES pinning — Ray handles GPU scheduling via num_gpus fractions - Add BaseInfer._get_memory_fraction() used by vllm, diffusers, transformers - Add BaseInfer._set_max_context_length() for per-model context tracking - Remove vllm speech serving (TTS requires loader=custom with plugin) - Add CUDA_DEVICE_ORDER=PCI_BUS_ID to Dockerfile - Add lint-fix Makefile target - Update docs to reflect simplified GPU allocation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce BaseInfer abstract base class that all inference backends (vLLM, Transformers, Diffusers, Custom) now inherit from. This unifies the interface, eliminates duplicated "not supported" boilerplate, and adds per-model max_context_length detection in every loader.
Add PayloadSizeLimitMiddleware to the gateway (YASHA_MAX_REQUEST_BODY_BYTES, default 50 MB) as a coarse safety net against oversized requests.
Add max_context_length() to all plugin base classes so plugins can report their model's context limit.