Create your first Spice.ai pod and train it

A Spice.ai Pod is simply a collection of configuration and data that is used to train and deploy your own AI.

We will add intelligence to a sample application, ServerOps, by creating and training a Spice.ai pod that offers recommendations to the application for different server operations, such as performing server maintenance.

If you are using GitHub Codespaces, skip Step 1. and continue with Step 2., as the repository will already be cloned.

Step 1. Clone the Spice.ai quickstarts repository:

cd $HOME
git clone https://github.com/spiceai/quickstarts
cd quickstarts/serverops

Step 2. Start the Spice runtime with spice run:

cd $HOME/quickstarts/serverops
spice run

Step. 3. In a new terminal, add the ServerOps quickstart pod:

So that we can leave Spice.ai running, add the quickstart pod in a new terminal tab or window. If you are running in GitHub Codespaces, you can open a new terminal by clicking the split-terminal button in VS Code.

spice add quickstarts/serverops

The Spice.ai CLI will download the ServerOps quickstart pod and add the pod manifest to your project at spicepods/serverops.yaml.

The Spice runtime will then automatically detect the pod and start your first training run!

Note, automatic training relies on your system’s filewatcher. In some cases, this might be disabled or not work as expected. If training does not start, follow the command to retrain the pod below.

Observe the pod training

Navigate to http://localhost:8000 in your favorite browser. You will see an overview of your pods. From here, you can click on the serverops pod to see a chart of the pod’s training progress.

Retrain the pod

In addition to automatic training upon manifest changes, training can be started by using the Spice CLI from within your app directory.

spice train serverops

Get a recommendation

After training the pod, you can now get a recommendation for an action from it!

curl http://localhost:8000/api/v0.1/pods/serverops/recommendation

Run the server ops application

To see how Spice.ai integrates with an app you write, start the associated sample app in this repo and look at the source code to see how it works.

npm install
node serverops.js
Next steps >>