In order to develop Apps for the Virtualitics AI Platform (VAIP), you’ll need to download and install the Software Development Kit (SDK) and Command Line Interface (CLI) packages. This article will provide the resources you need to get these tools set up in order to begin creating your own Apps.
Installing the Virtualitics SDK
The installation of the Virtualitics SDK is done using a pip
install. The included stubs package will provide you with a helpful autocorrect as you code your Apps.
To install, type the following into the terminal:
pip install virtualitics-sdk
Visit the Virtualitics SDK page on PyPI for additional details and resources.
Installing the Virtualitics CLI
This section will walk you through creating an environment with venv
and installing the Virtualitics CLI with pip
. Once finished, you'll have set up the folder structure needed to build and deploy Virtualitics AI Apps. For additional technical details, see the Virtualitics CLI page on PyPI.
Prerequisites
In order to install the Virtualitics CLI, you first need to ensure your computer is properly set up with:
-
Python
We support version 3.11 to 3.12. -
A Python environment manager (recommended)
Environment managers create virtual environments to isolate Python package installations between projects. Virtual environments are recommended because installing or upgrading a Python package may cause unintentional effects on another package.
Tip: For more details on Python environments, see Python Virtual Environments: A Primer. -
A Python package manager
Package managers handle the installation of each of your Python packages, including the Virtualitics SDK. For this guide, we'll be usingpip
, which comes with Python.
Installation and Setup
1. Install the Virtualitics CLI in your environment.
In the directory with your environment activated, type the following into the terminal:
pip install virtualitics-cli
Test that the installation worked by running the “help” command:
vaip --help
The VAIP help message should appear in the terminal.
2. Initialize App structure.
We will now run two commands (config
and init
) using the Virtualitics CLI to initialize the App structure that you will develop your Apps in. First, we will create a configuration file that will hold your API key, username, and host to deploy to.
In your terminal, type:
vaip config
And follow the steps you are prompted to fill out. Refer to the Virtualitics CLI page on PyPI for more details.
- Name: User-specified friendly name for a given VAIP instance
-
Host: Backend hostname for a given VAIP instance. This can be found by opening the Explore Connection menu in the top right corner and clicking on the Copy Backend URL button
-
Token: API token used to verify the user’s access to the given VAIP instance. This can be found by opening the Account Profile menu in the top right corner, clicking on My Account, and navigating to the Tokens and Keys section.
-
Username: Username (i.e., email address) associated with API token. This can be found by opening the Account Profile menu in the top right corner, clicking on My Account, and navigating to the Basic Info section.
The config command can be run multiple times to create multiple configurations. Users can switch the config context the Virtualitics CLI is pointed to when building and deploying Apps using the following command:
vaip use-context <VAIP deployment friendly name>
Where <VAIP deployment friendly name> is the name of a previously configured context referenced in the configuration file.
To view the configurations you have created, run the following command:
# Windows command prompt
type %USERPROFILE%\virtualitics\config.conf
# Windows PowerShell
Get-Content $env:USERPROFILE\virtualitics\config.conf
# macOS and Linux
cat ~/.virtualitics/config.conf
Finally, to initialize a Virtualitics AI Platform App structure, run the init
command:
vaip init
- Project name: Name for the VAIP App (No spaces or special chars besides '_'), e.g. new_demo
- Version: User-specified version for the VAIP App
- Description: Description for the VAIP App
- Authors: Authors for the VAIP App as a name and email pair.
- Licenses: Licenses for the VAIP App.
After you have completed the init
command your folder should have populated with several new files and folders that look something like this:
3. Test the Virtualitics CLI.
To ensure you have things set up correctly, you can download the Python code for VAIP tutorial apps here.
Once you've downloaded the appropriate .py files, move the code for a tutorial app into the project folder. The folder should look like this:
You can also have multiple app files within the same project folder and they will all deploy successfully. For example:
You are now set up for deployment! For more on deploying an App using the CLI, see this article.