Using CLI
Guide to start using Konduit-Serving with CLI
Last updated
Guide to start using Konduit-Serving with CLI
Last updated
This document will demonstrate using Konduit-Serving using mainly CLI tools. You can deploy ML/DL models to production using minimal effort using Konduit-Serving. Let's look at the process of building and installing Konduit-Serving from source and how to deploy a model using a simple configuration.
You will need following prerequisites to follow along
Maven 3.x
JDK 8
Git
The following two sections explains how to clone, build and install Konduit-Serving from sources.
To build from source, follow the guide below
To install the respective built binaries you can navigate to the section below
After you've installed Konduit-Serving in your local machine you can switch to a terminal and verify the installation by running
You'll see an output similar to the one below
Let's look at how to deploy a dl4j/keras model using Konduit-Serving
Let's clone the konduit-serving-examples
repo
and navigate to the quickstart
folder
The examples we want to run are under the folders 3-keras-mnist
and 5-dl4j-mnist
. Let's follow a basic workflow for both models using the Konduit-Serving CLI.
Navigate to 3-keras-mnist
Here, you'll find the following files:
The keras.json
contains the configuration file for running an MNIST dataset trained model in Keras. To serve the model, execute the following command
You'll be able to see a similar output like the following
The last line will show you the details about which URL the server is serving the models at.
Press Ctrl + C
, or execute konduit stop keras-server
to kill the server.
To run the server in the background, you can run the same command with the --background
or -b
flag.
You'll see something similar to
To list the server, simply run
You'll see the running servers as a list
To view the logs, you can run the following command
The --lines
or -l
flag shows the specified number of last lines. By executing the above command you'll see the following
Now finally, let's look at running predictions with Konduit-Serving by sending an image file to the server.
It will convert the image into an n-dimensional array and then send the input to the keras model and you'll see the following output
Congratulations! You've learned the basic workflow for Konduit-Serving using the Command Line Interface.