from .gpt_4o import GPT4O
from .vllm_model import VLLMModel


def get_model_instance(model_name: str, ip: str = None):
    open_source_models = ['qwen', 'internvl', 'ui-tars', 'uground', 'tongui', 'os-atlas', "mimo"]
    if model_name == "gpt-4o":
        return GPT4O()
    else:
        for open_source_model in open_source_models:
            if open_source_model in model_name.lower():
                return VLLMModel(model_name, ip)
        raise ValueError(f"Unsupported model: {model_name}")
