Titan Tutorial #3: Getting started with Titan’s CLI
Titan’s CLI (Command Line Interface) is the main tool to manage models and services in our product.
Our CLI has been designed and built to make it very easy (even for those not familiarized with terminal-like interfaces).
In this tutorial, we will see the main differences of the CLI and we will learn how to use it to transform our ML models into ready-to-use services.
Once Titan has been installed in your computer, it is the possible to start using the CLI. As in every command-line program, you can check the available command options and flags by typing:
This command will return the following:
Usage:titan [<flags>] <command> [<args> …]
To operate the CLI it is just needed to type `titan` followed by some of these flags:
Flags:-h, — help Output usage information.-C, — chdir=”.” Change working directory.-v, — verbose Enable verbose log output.— version Show application version.
And any of these commands:
Commands:help Show help for a command.config Show current config manifest.deploy Deploy a Jupyter Notebook in the cloud.docs Open documentation website in a browser.login Authorize user.logs Inspect service logs.open Open service endpoint URL in a browser.services list List deployed services.services start Start service.services stop Stop service.services restart Restart service.services delete Delete service.upgrade Install the latest or specified version of Titan.version Show version.
To better understand how to use the CLI, let’s see the most common actions to execute as if we were using Titan to deploy models for the first time.
👉 If you want to try Titan, you can apply to obtain a free trial account. Please write us at email@example.com and tell us about you and about what you are planning to do with Titan.
Before anything else, we need to log in before proceeding. To do that, it is just needed to type:
The current logged user can be checked by typing:
Once logged in, you can start using Titan. If you need help to get started, you can open Titan’s documentation straight from the command line by typing:
Deploying a model is as easy as running:
After that, Titan will:
- Require the user to select which of models located in the current folder should be deployed
- Require the user to select which is the desired environment to run the model
As it was shown in previous post, a Swagger UI interface is automagically generated when a model is successfully deployed. It is possible to directly access this web interface by running:
And by selecting after that which Swagger UI interface we want to open among all currently deployed models.
Imagine you have deployed one or more models and you now want to start managing them. In order to do that, we use the command:
This command or its equivalent
$titan services list will return a list of the currently deployed models:
services command is special since it accepts different parameters to modify its behavior. They are the following:
$titan services listList deployed services.
$titan services startStart a service.
$titan services stopStop a service.
$titan services restartRestart a service.
$titan services deleteDelete a service.
Usage examples are shown below:
Apart from the service management, it is possible to check the current version of Titan with:
And finally, a very nice feature of Titan is that it can be automatically updated with just a command by just running:
In this third post of our series of tutorials we have seen how to use Titan’s CLI to deploy models and to manage services with an expressive and simple command set.
Stay tuned for new tutorials!
Be sure to check our next tutorial, where we create and deploy an Image Detection model from scratch!
Titan can help you to radically reduce and simplify the effort required to put AI/ML models into production, enabling Data Science teams to be agile, more productive and closer to the business impact of their developments.
If you want to know more about how to start using Titan or getting a free demo, please visit our website or drop us a line at firstname.lastname@example.org.
If you prefer, you can schedule a meeting with us here.