Skip to content

Conversation

markurtz
Copy link
Collaborator

@markurtz markurtz commented Aug 20, 2025

Summary

This PR introduces four new utility modules that provide foundational capabilities for auto-discovery, registry patterns, singleton management, and enhanced Pydantic utilities. It additionally consolidates the pydantic utility classes from guidellm.objects into the dedicated guidellm.utils module containing the new additions. This change improves code organization and establishes the foundation for upcoming scheduler refactoring work.

Details

  • Moved core utilities from guidellm.objects.pydantic to guidellm.utils.pydantic_utils
  • Added AutoImporterMixin for dynamic module discovery within packages
  • Added RegistryMixin for object registration with optional auto-discovery
  • Added singleton mixins (SingletonMixinThreadSafeSingletonMixin) for instance management
  • Enhanced Pydantic utilities with ReloadableBaseModelStandardBaseDict, and PydanticClassRegistryMixin for polymorphic model serialization
  • Updated all imports across the codebase to reference new module locations
  • Added comprehensive test coverage for all new utility modules
  • Removed obsolete guidellm.objects.pydantic module and associated tests

Test Plan

  • Run existing test suite to ensure no regressions from import changes
  • Execute new utility module test suites covering smoke, sanity, and regression scenarios

Related Issues


  • "I certify that all code in this PR is my own, except as noted below."

Use of AI

  • Includes AI-assisted code completion
  • Includes code generated by an AI application
  • Includes AI-generated tests (NOTE: AI written tests should have a docstring that includes ## WRITTEN BY AI ##)

Copy link
Contributor

@Copilot Copilot AI left a comment

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 refactors GuideLLM's utility infrastructure by introducing four new utility modules and consolidating Pydantic utilities from the objects package. The change establishes foundational capabilities for auto-discovery, registry patterns, singleton management, and enhanced Pydantic utilities while improving code organization.

  • Added four new utility modules: AutoImporterMixin, RegistryMixin, singleton mixins (SingletonMixin, ThreadSafeSingletonMixin), and enhanced Pydantic utilities
  • Consolidated Pydantic utilities: Moved classes from guidellm.objects.pydantic to guidellm.utils.pydantic_utils and enhanced them with registry integration
  • Updated import references: Modified all imports across the codebase to use the new module locations

Reviewed Changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/utils/test_*.py Comprehensive test suites for all new utility modules
tests/unit/objects/test_pydantic.py Removed obsolete test file for moved Pydantic utilities
src/guidellm/utils/*.py New utility modules implementing singleton, registry, auto-importer, and enhanced Pydantic functionality
src/guidellm/objects/pydantic.py Removed original Pydantic utilities module
src/guidellm/**/*.py Updated import statements to reference new utility module locations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

markurtz and others added 2 commits August 20, 2025 19:01
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Mark Kurtz <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Mark Kurtz <[email protected]>
Copy link
Collaborator

@jaredoconnell jaredoconnell left a comment

Choose a reason for hiding this comment

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

I reviewed the code in detail and skimmed the tests and didn't see anything, so this should be good once Samuel's concerns are addressed.

@markurtz markurtz merged commit 3f7f7ac into feature/refactor/main Aug 26, 2025
12 of 17 checks passed
@markurtz markurtz deleted the feature/refactor/utils-core branch August 26, 2025 19:34
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.

3 participants