Skip to content

vllm.utils.registry

Classes:

ExtensionManager

A registry for managing pluggable extension classes.

This class provides a simple mechanism to register and instantiate extension classes by name. It is commonly used to implement plugin systems where different implementations can be swapped at runtime.

Examples:

Basic usage with a registry instance:

>>> FOO_REGISTRY = ExtensionManager()
>>> @FOO_REGISTRY.register("my_foo_impl")
... class MyFooImpl(Foo):
...     def __init__(self, value):
...         self.value = value
>>> foo_impl = FOO_REGISTRY.load("my_foo_impl", value=123)

Methods:

  • __init__ –

    Initialize an empty extension registry.

  • load –

    Instantiate and return a registered extension class by name.

  • register –

    Decorator to register a class with the given name.

__init__()

Initialize an empty extension registry.

load(cls_name, *args, **kwargs)

Instantiate and return a registered extension class by name.

register(name)

Decorator to register a class with the given name.