# SPDX-License-Identifier: Apache-2.0
"""
vllm-serve-encrypted — wrapper for serving encrypted models.

Why this wrapper exists
-----------------------
This wrapper ensures the encrypted model loader is registered before
vLLM's CLI runs. It simply imports vllm.model_security (which triggers
the register_model_loader registration), then delegates to vllm serve.

Usage (identical to `vllm serve`):
    vllm-serve-encrypted ./my-model --load-format encrypted [options...]
    vllm-serve-encrypted ./my-model [options...]   # auto-detect

Alternative (without wrapper):
    # Add to PYTHONPATH or use .pth file
    import vllm.model_security  # triggers registration
    # Then use vllm serve normally
    vllm serve ./my-model --load-format encrypted
"""

from __future__ import annotations

import sys


def main() -> None:
    # Step 1: Register the encrypted loader BEFORE vllm's CLI runs.
    import vllm.model_security  # noqa: F401  triggers registration

    # Step 2: Run vllm's CLI.
    from vllm.entrypoints.cli.main import main as vllm_main

    vllm_main()


if __name__ == "__main__":
    sys.exit(main())