def _create_model_from_registry(llm_model: str):
    """Create a model instance based on the registry entry."""
    registry_entry = get_model_registry_entry(llm_model)
    if not registry_entry:
        return None, {"status_code": 400, "detail": f"Unsupported LLM model: {llm_model}"}
    
    provider = registry_entry["provider"]
    model_name = registry_entry["model_name"]
    
    if provider == "openai":
        api_key = registry_entry.get("api_key", "OPENAI_API_KEY")
        return _create_openai_model(model_name, api_key)
    elif provider == "azure_openai":
        return _create_azure_openai_model(model_name)
    elif provider == "deepseek":
        return _create_deepseek_model()
    elif provider == "anthropic":
        return _create_anthropic_model(model_name)
    elif provider == "bedrock_anthropic":
        return _create_bedrock_anthropic_model(model_name)
    elif provider == "ollama":
        return _create_ollama_model(model_name)
    elif provider == "openrouter":
        return _create_openrouter_model(model_name)
    elif provider == "gemini":
        return _create_gemini_model(model_name)
    else:
        return None, {"status_code": 400, "detail": f"Unsupported provider: {provider}"}
Create a model instance based on the registry entry.
src/upsonic/server/level_utilized/utility.py