Your First 30 Minutes with Modzy

Get up and running with Modzy in a jiffy!

In this guide we’ll show you how to get started with Modzy in 30 minutes or less. This guide covers finding models, downloading API keys, running inferences, and using many of Modzy’s monitoring features.

:department-store: Find a Model

Let’s start by searching for a model in the Model Library. You can get to the Model Library by clicking on the Models tab in the menu at the top of the page. Search for “Sentiment Analysis” and click on the top result. You can also find Modzy’s open-source sentiment analysis model in the Open Source model creators section. If you have a Modzy Basic account, you can also find it here: https://app.modzy.com/models/ed542963de/1.0.1

Searching for a sentiment analysis model in Modzy's model librarySearching for a sentiment analysis model in Modzy's model library

Searching for a sentiment analysis model in Modzy's model library

:car: Run Your First Model

Each model has its own biography, which includes background information, performance metrics, training information, API snippets, and more. Once you’ve looked through some of this documentation for the Sentiment Analysis model, click on the Test Drive tab. Type any English text you’d like into the 'input.txt' field, then click the "Start Job" button. Modzy will then send your input to this Sentiment Analysis model for inference which returns a prediction of the sentiment detected.

Sending text to a sentiment analysis model using Modzy's "Test Drive" featureSending text to a sentiment analysis model using Modzy's "Test Drive" feature

Sending text to a sentiment analysis model using Modzy's "Test Drive" feature

📘

For a quick interpretation of the result, compare the "class": "positive" and "class": "negative" scores. If the positive score is larger, the text is seen as more positive, if the negative score is larger, then the text is seen as more negative.

:crystal-ball: View Model Results

Once you’ve completed your first Sentiment Analysis inference using the Test Drive feature, you can look at the raw results on the Jobs page. Modzy uses to word Job to describe when one or more data inputs are passed through a model. Click on the "Operations" tab in the menu at the top of the page and then click on "Jobs" in the menu that appears right beneath it.

Viewing the full log of all past AI inferencesViewing the full log of all past AI inferences

Viewing the full log of all past AI inferences

You can find the job you just submitted at the top of the jobs list. Click on the Job ID of the inference you just submitted to see more information. The Job Details page provides access that job’s predictions, inference times, and other metadata.

Viewing the results for a single submission to a sentiment analysis modelViewing the results for a single submission to a sentiment analysis model

Viewing the results for a single submission to a sentiment analysis model

:key: Download Your API Key

Next, let's try using Modzy's API. Before you can start using it you will need an API Key. You can find and download any API keys in your profile. Click on your name in the menu at the top left of the screen and then click "Profile & API Keys".

Link to API KeysLink to API Keys

Link to API Keys

You should see an API key listed for each of the teams to which you belong. If you belong to multiple teams, then you’ll see multiple keys. Find the API key for the applicable team and click on “Get Key” to download your API key.

Downloading an API keyDownloading an API key

Downloading an API key

Next, open the text file downloaded from Modzy to view the full-length key. Modzy’s API keys have a 2-part format, a public portion (the characters to the left of the period) and a private portion (the characters to the right of the period). To work with Modzy’s APIs, you need the full string (with the period in the middle) for authentication. Store this file somewhere safe as you can only download it once.

An example of a Modzy API KeyAn example of a Modzy API Key

An example of a Modzy API Key

:computer: Run a Job from Your Terminal

Now that you have an API Key, you can directly interact with Modzy’s API. An easy way to do so is to copy the cURL example from the API page of the Sentiment Analysis model or use the example below. You will just need to make the following substitution:

  • Replace API_KEY in the sample code below with the API key string you just downloaded

An easy way to do this is to paste the example below into a text editor, replace the text that says API_KEY with the API Key you just downloaded, then copy the whole thing again before pasting it into your terminal or command prompt.

curl https://app.modzy.com/api/jobs -X POST \
 -H 'Content-Type: application/json' \
 -H 'Authorization: ApiKey API_KEY' \
 -d '{
      "model": {
        "identifier": "ed542963de",
        "version": "1.0.1"
      },
      "input": {
        "type": "text",
        "sources": {
          "first-phone-call": {
            "input.txt": "Mr Watson, come here. I want to see you."
          }
        }
      }
    }'
curl https://app.modzy.com/api/jobs -X POST ^
 -H "Content-Type: application/json" ^
 -H "Authorization: ApiKey API_KEY" ^
 -d "{\"model\":{\"identifier\": \"ed542963de\",\"version\":\"1.0.1\"},\"input\":{\"type\":\"text\",\"sources\":{\"first-phone-call\":{\"input.txt\":\"Mr Watson, come here. I want to see you.\"}}}}"

🚧

Modzy URL is installation specific

If you're using app.modzy.com, the example above should work just fine, but if you're using a private or on-premise installation of Modzy, you'll need to replace "https://app.modzy.com" with the URL of your private Modzy instance.

Once you’ve made those substitutions, open a terminal (MacOS, Linux) or command prompt (Windows), paste in this cURL command, and hit enter. When Modzy receives your request, you will receive a confirmation message with details about your job submission that includes a jobIdentifier number, the accessKey (the public portion of your API Key) used for the request, and much more. Modzy runs inferences asynchronously, so you can either request your results via an API request (with the /api/results/ endpoint), or you can view them again on the Jobs page.

{
  "model": {
    "identifier": "ed542963de",
    "version": "1.0.1",
    "name": "Sentiment Analysis"
  },
  "status": "SUBMITTED",
  "totalInputs": 1,
  "jobIdentifier": "b1e4477b-2361-421b-9095-a9b4edde447b",
  "accessKey": "syXs1jd1hQY1FdMTnCjM",
  "explain": false,
  "jobType": "batch",
  "accountIdentifier": "modzy-account",
  "team": {
    "identifier": "559b3f00-3f39-442f-ac23-94314daa8acc"
  },
  "user": {
    "identifier": "7344b933-0ab4-4e50-a3c0-20b8e1e1fcbc",
    "externalIdentifier": "[email protected]",
    "firstName": "Thomas",
    "lastName": "Edison",
    "email": "[email protected]",
    "status": "active"
  },
  "jobInputs": {
    "identifier": [
      "first-phone-call"
    ]
  },
  "submittedAt": "2021-10-07T01:22:27.888+00:00",
  "hoursDeleteInput": 24,
  "imageClassificationModel": false
}

:factory: Monitor Model Operations

Now that you ran a few jobs, visit the Utilization page to get a birds-eye view of the overall model usage in Modzy. Click on Operations -> Utilization to find it. This is also where you can find detailed information about your total cluster utilization which includes CPU and Memory utilization.

Viewing model utilization statsViewing model utilization stats

Viewing model utilization stats

:mountain-cableway: Scale Your Models

Lastly, you may change the auto-scaling settings for the Sentiment Analysis model on the Model Management page in the Operations section. Search for “Sentiment Analysis” in the search bar. Once you see the correct model you can expand the row for that model and version to see usage statistics. You can also adjust auto-scaling settings for this model.

📘

Model Scaling Requires an Admin Role

Unless you have an administrative role, you won't be able to adjust model scaling settings. This feature is limited to Team Admin and Platform Admin roles, since this feature can significantly impact infrastructure costs. Not available to Modzy Basic accounts.

To increase the number of copies of a model that are always active, click on the min/max element in the Engine Autoscaling column and adjust the “minimum” value in the dialogue that appears. When set to “0” the model will automatically shut down if it hasn’t been used recently. When set to “1” or greater, then there will always be at least one copy of a model ready for new jobs (aka inferences).

Adjusting model autoscaling settingsAdjusting model autoscaling settings

Adjusting model autoscaling settings

Great work making it through your first 30 minutes in Modzy. If you’re wondering what’s next, there are a couple of ways to do even more with Modzy.


What’s Next

Once you've gotten a feel for Modzy, try building your first AI-powered app in Python, or packaging and deploying your first model

Did this page help you?