:doc:`NeptuneData <../../neptunedata>` / Client / create_ml_endpoint

******************
create_ml_endpoint
******************



.. py:method:: NeptuneData.Client.create_ml_endpoint(**kwargs)

  

  Creates a new Neptune ML inference endpoint that lets you query one specific model that the model-training process constructed. See `Managing inference endpoints using the endpoints command <https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-endpoints.html>`__.

   

  When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the `neptune-db\:CreateMLEndpoint <https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#createmlendpoint>`__ IAM action in that cluster.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/neptunedata-2023-08-01/CreateMLEndpoint>`_  


  **Request Syntax**
  ::

    response = client.create_ml_endpoint(
        id='string',
        mlModelTrainingJobId='string',
        mlModelTransformJobId='string',
        update=True|False,
        neptuneIamRoleArn='string',
        modelName='string',
        instanceType='string',
        instanceCount=123,
        volumeEncryptionKMSKey='string'
    )
    
  :type id: string
  :param id: 

    A unique identifier for the new inference endpoint. The default is an autogenerated timestamped name.

    

  
  :type mlModelTrainingJobId: string
  :param mlModelTrainingJobId: 

    The job Id of the completed model-training job that has created the model that the inference endpoint will point to. You must supply either the ``mlModelTrainingJobId`` or the ``mlModelTransformJobId``.

    

  
  :type mlModelTransformJobId: string
  :param mlModelTransformJobId: 

    The job Id of the completed model-transform job. You must supply either the ``mlModelTrainingJobId`` or the ``mlModelTransformJobId``.

    

  
  :type update: boolean
  :param update: 

    If set to ``true``, ``update`` indicates that this is an update request. The default is ``false``. You must supply either the ``mlModelTrainingJobId`` or the ``mlModelTransformJobId``.

    

  
  :type neptuneIamRoleArn: string
  :param neptuneIamRoleArn: 

    The ARN of an IAM role providing Neptune access to SageMaker and Amazon S3 resources. This must be listed in your DB cluster parameter group or an error will be thrown.

    

  
  :type modelName: string
  :param modelName: 

    Model type for training. By default the Neptune ML model is automatically based on the ``modelType`` used in data processing, but you can specify a different model type here. The default is ``rgcn`` for heterogeneous graphs and ``kge`` for knowledge graphs. The only valid value for heterogeneous graphs is ``rgcn``. Valid values for knowledge graphs are: ``kge``, ``transe``, ``distmult``, and ``rotate``.

    

  
  :type instanceType: string
  :param instanceType: 

    The type of Neptune ML instance to use for online servicing. The default is ``ml.m5.xlarge``. Choosing the ML instance for an inference endpoint depends on the task type, the graph size, and your budget.

    

  
  :type instanceCount: integer
  :param instanceCount: 

    The minimum number of Amazon EC2 instances to deploy to an endpoint for prediction. The default is 1

    

  
  :type volumeEncryptionKMSKey: string
  :param volumeEncryptionKMSKey: 

    The Amazon Key Management Service (Amazon KMS) key that SageMaker uses to encrypt data on the storage volume attached to the ML compute instances that run the training job. The default is None.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'id': 'string',
          'arn': 'string',
          'creationTimeInMillis': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **id** *(string) --* 

        The unique ID of the new inference endpoint.

        
      

      - **arn** *(string) --* 

        The ARN for the new inference endpoint.

        
      

      - **creationTimeInMillis** *(integer) --* 

        The endpoint creation time, in milliseconds.

        
  
  **Exceptions**
  
  *   :py:class:`NeptuneData.Client.exceptions.UnsupportedOperationException`

  
  *   :py:class:`NeptuneData.Client.exceptions.BadRequestException`

  
  *   :py:class:`NeptuneData.Client.exceptions.InvalidParameterException`

  
  *   :py:class:`NeptuneData.Client.exceptions.MLResourceNotFoundException`

  
  *   :py:class:`NeptuneData.Client.exceptions.ClientTimeoutException`

  
  *   :py:class:`NeptuneData.Client.exceptions.PreconditionsFailedException`

  
  *   :py:class:`NeptuneData.Client.exceptions.ConstraintViolationException`

  
  *   :py:class:`NeptuneData.Client.exceptions.InvalidArgumentException`

  
  *   :py:class:`NeptuneData.Client.exceptions.MissingParameterException`

  
  *   :py:class:`NeptuneData.Client.exceptions.IllegalArgumentException`

  
  *   :py:class:`NeptuneData.Client.exceptions.TooManyRequestsException`

  