"""Validate the complete vLLM engine configuration before loading weights.""" import argparse import json import os from pathlib import Path from decision_vllm_engine import llm_options def main() -> None: """Resolve model metadata and engine arguments using the inference configuration.""" parser = argparse.ArgumentParser() parser.add_argument('model') parser.add_argument('--output', type=Path) args = parser.parse_args() os.environ['VLLM_ENABLE_V1_MULTIPROCESSING'] = '0' from vllm.engine.arg_utils import EngineArgs config = EngineArgs(**llm_options(args.model)).create_engine_config() if config.model_config.hf_text_config.is_causal is not False: raise ValueError('Full-attention configuration must be bidirectional') report = {'stage': 'engine_configuration_verified', 'passed': True, 'is_causal': False, 'max_model_len': config.model_config.max_model_len} if args.output: args.output.write_text(json.dumps(report, indent=2) + '\n') print(json.dumps(report), flush=True) if __name__ == '__main__': main()