Skip to content

Using a Model Service§

Note

If your service was deployed to SkyPilot, jump to the instructions for SkyPilot below.

Once you have deployed a model service, you need to catalog it in OpenAD in order to use it.

Demonstration Service§

If you've already deployed your own model service, you can skip this step.
Otherwise, launch the demo service to learn how work with OpenAD services.

You can try this out live in our Colab tutorial.
To learn how to deploy a model, go to Deploying Models.

Bash
pip install git+https://github.com/acceleratedscience/openad_service_utils.git@0.3.1
Bash
openad
Bash
model service demo
Bash
|    Demo model service started at http://localhost:8034
|    PID: 0000

Using the Service§

  1. Launch OpenAD

    Bash
    openad
    
  2. Catalog the service
    (Replace the service URL with the one of your own deployment)

    Bash
    catalog model service from remote 'http://localhost:8034' as demo_service
    
  3. See the available commands for the service

    Bash
    demo_service ?
    
  4. Run inference

    Bash
    demo_service get molecule property num_atoms for CC
    
    Bash
    demo_service get molecule property num_atoms for NCCc1c[nH]c2ccc(O)cc12
    

    This will output:

    Text Only
    subject    property      result
    ---------  ----------  --------
    CC         num_atoms          2
    
    Text Only
    subject                 property      result
    ----------------------  ----------  --------
    NCCc1c[nH]c2ccc(O)cc12  num_atoms         13
    

Service Status§

You can easily check your services status by running:

Text Only
model service status

This should display:

Text Only
Service        Status     Endpoint                              Host
-------------  ---------  ------------------------------------  ------
demo_service   Connected  https://open.accelerate.science/demo  remote

Using a Model Service on SkyPilot§

Once you have set up SkyPilot on AWS, using a model works slightly different.

  1. You can catalog any service directly from GitHub by its git@github url.
    To catalog the SMI-TED service, for example:

    Bash
    catalog model service from 'git@github.com:acceleratedscience/openad-service-smi-ted.git' as smi_ted
    
  2. Start the service

    Note: this may take multiple minutes

    Bash
    model service up smi_ted
    
  3. Check if the service is ready

    Bash
    model service status
    
  4. See the available commands for the service

    Bash
    smi_ted ?
    
  5. Shut down the service

    Bash
    model service down smi_ted