def __init__(
        self,
        model: str = DEFAULT_MODEL,
        user: Optional[str] = None,
        account: Optional[str] = None,
        private_key_file: Optional[str] = None,
        jwt_token: Optional[str] = None,
        session: Optional[Any] = None,
        callback_manager: Optional[CallbackManager] = None,
        additional_kwargs: Optional[Dict[str, Any]] = None,
    ) -> None:
        """
        Implements all Snowflake Cortex LLMs.

        AUTHENTICATION:
        The recommended way to connect is to use a snowflake.snowpark.Session object.
        Environment variables SNOWFLAKE_ACCOUNT and SNOWFLAKE_USERNAME must be set or passed as params.

        Authentication methods (in order of precedence):
        1. Explicitly provided authentication (one of: private_key_file, jwt_token, or session)
        2. Environment variable SNOWFLAKE_KEY_FILE (legacy support)
        3. Default OAUTH token in SPCS environment

        If none of these methods are available, an assertion error is raised.

        """
        super().__init__(
            additional_kwargs=additional_kwargs or {},
            callback_manager=callback_manager,
        )

        # Set model specs first
        self.model = model
        specs = model_specs.get(self.model, {})
        self.context_window = specs.get("context_window") or DEFAULT_CONTEXT_WINDOW
        self.max_tokens = specs.get("max_output") or DEFAULT_MAX_TOKENS

        # Set user and account
        self.user = user or os.environ.get("SNOWFLAKE_USERNAME")
        self.account = account or os.environ.get("SNOWFLAKE_ACCOUNT")

        # Authentication logic - prioritize explicit authentication methods
        is_in_spcs = is_spcs_environment()
        env_key_file = os.environ.get("SNOWFLAKE_KEY_FILE")

        # Case 1: Explicit authentication provided
        if private_key_file:
            self.private_key_file = private_key_file
        elif jwt_token:
            if os.path.isfile(jwt_token):
                with open(jwt_token) as fp:
                    self.jwt_token = fp.read()
            else:
                self.jwt_token = jwt_token
        elif session:
            self.session = session

        # Case 2: Environment variable private key (legacy behavior)
        elif env_key_file and not is_in_spcs:
            self.private_key_file = env_key_file

        # Case 3: SPCS environment with default token
        elif is_in_spcs:
            self.jwt_token = get_default_spcs_token()

        # No valid authentication method found
        else:
            raise ValueError(
                "Authentication required. Please provide one of: private_key_file, jwt_token, session, "
                "set SNOWFLAKE_KEY_FILE environment variable, or run in SPCS environment."
            )
        if is_in_spcs and self.session:
            warnings.warn(
                "SPCS environment detected. If using the default auth token, please ensure you do NOT set values for 'user' and 'role' parameters or your auth may be rejected."
            )

        Implements all Snowflake Cortex LLMs.

        AUTHENTICATION:
        The recommended way to connect is to use a snowflake.snowpark.Session object.
        Environment variables SNOWFLAKE_ACCOUNT and SNOWFLAKE_USERNAME must be set or passed as params.

        Authentication methods (in order of precedence):
        1. Explicitly provided authentication (one of: private_key_file, jwt_token, or session)
        2. Environment variable SNOWFLAKE_KEY_FILE (legacy support)
        3. Default OAUTH token in SPCS environment

        If none of these methods are available, an assertion error is raised.

        
llama-index-integrations/llms/llama-index-llms-cortex/llama_index/llms/cortex/base.py