Skip to content

Commit 8f48cf9

Browse files
authored
[GuideLLM Refactor] backend package updates, rewrites, and tests expansion (#355)
## **Summary** Refactors the backend package to introduce a new architecture that supports the scheduler refactor. The changes include new object models for requests/responses, adjustments to the registry-based backend system, and integration with the scheduler interface. The refactor replaces the previous response/streaming model with a more flexible request-response pattern that supports timing measurements and distributed execution. ## **Details** - **New object models**: Introduced `GenerationRequest`, `GenerationResponse`, and `GenerationRequestTimings` in `objects.py` to standardize data flow between scheduler and backends - **Backend architecture refactor**: Redesigned `Backend` base class to extend `RegistryMixin` and `BackendInterface`, enabling automatic registration and scheduler integration - **Process lifecycle management**: Added `process_startup()` and `process_shutdown()` methods to support distributed worker processes with proper resource management - **OpenAI backend modernization**: Rewrote `OpenAIHTTPBackend` with improved error handling, streaming support, beginning support for multimodal content processing, and configuration management - **Registry system**: Implemented automatic backend registration using decorators, replacing manual registry management - **Scheduler integration**: Backends now implement `BackendInterface` with `resolve()` method for processing generation requests with timing metadata - **Removed deprecated modules**: Eliminated `response.py` with its streaming response types in favor of the new object model - **Enhanced test coverage**: Added comprehensive unit tests for all new components with smoke, sanity, and regression test categories ## **Test Plan** - Execute new backend module test suites covering smoke, sanity, and regression scenarios - Verify OpenAI backend functionality with mocked HTTP responses for both streaming and non-streaming modes - Test backend registry and factory pattern functionality - Validate integration with scheduler interfaces and timing measurement - Ensure proper resource management during process startup/shutdown cycles ## **Related Issues** - Part of the larger scheduler refactor initiative --- - [x] "I certify that all code in this PR is my own, except as noted below." ## **Use of AI** - [x] Includes AI-assisted code completion - [x] Includes code generated by an AI application - [] Includes AI-generated tests (NOTE: AI written tests should have a docstring that includes `## WRITTEN BY AI ##`)
2 parents ad14178 + 452eb65 commit 8f48cf9

18 files changed

+2920
-1739
lines changed

src/guidellm/backend/__init__.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/guidellm/backend/backend.py

Lines changed: 0 additions & 259 deletions
This file was deleted.

0 commit comments

Comments
 (0)