diff --git a/spiceaidocs/content/en/_index.md b/spiceaidocs/content/en/_index.md index 7a1ffb32..94674fd9 100644 --- a/spiceaidocs/content/en/_index.md +++ b/spiceaidocs/content/en/_index.md @@ -3,21 +3,21 @@ type: docs no_list: true --- -# Spice.ai +# Spice -**Spice.ai** makes it easy for developers to build apps that learn and adapt by streamlining the use of machine learning (ML) in software. Combined with time-series data, developers can create applications that continuously improve using ML recommendations. +**Spice** makes it easy for developers to build apps that learn and adapt by streamlining the use of machine learning (ML) in software. Combined with time-series data, developers can create applications that continuously improve using ML recommendations. -Spice.ai takes a developer-first approach, and is focused on a fast, iterative, inner development loop, enabling developers to get started with ML in minutes instead of months. +Spice takes a developer-first approach, and is focused on a fast, iterative, inner development loop, enabling developers to get started with ML in minutes instead of months. -📢 Read the Spice.ai announcement blog post at [blog.spiceai.org](https://blog.spiceai.org/posts/2021/09/07/introducing-spice.ai-open-source-time-series-ai-for-developers/). +📢 Read the Spice announcement blog post at [blog.spiceai.org](https://blog.spiceai.org/posts/2021/09/07/introducing-spice.ai-open-source-time-series-ai-for-developers/). -📺 View a getting started walkthrough of Spice.ai in action [here](https://www.youtube.com/watch?v=DKBLjuAz_lI). +📺 View a getting started walkthrough of Spice in action [here](https://www.youtube.com/watch?v=DKBLjuAz_lI). ## Features -The Spice.ai runtime is written in Golang and Python and runs as a container or microservice. It's deployable to any public cloud, on-premises, and edge. It is configured with a simple manifest and accessed by HTTP APIs. +The Spice runtime is written in Golang and Python and runs as a container or microservice. It's deployable to any public cloud, on-premises, and edge. It is configured with a simple manifest and accessed by HTTP APIs. -Spice.ai includes: +Spice includes: - A lightweight, portable ML runtime accessible by simple HTTP APIs, allowing developers to use their preferred languages and frameworks - A dashboard to visualize data and learning @@ -26,11 +26,11 @@ Spice.ai includes: ### Community-Driven Data Components -Spice.ai also includes a library of community-driven [data components](https://github.com/spiceai/data-components-contrib) for streaming and processing time series data, enabling developers to quickly and easily combine data with learning to create intelligent models. +Spice also includes a library of community-driven [data components](https://github.com/spiceai/data-components-contrib) for streaming and processing time series data, enabling developers to quickly and easily combine data with learning to create intelligent models. ### Spicepod registry -Modern developers build with the community by leveraging registries such as npm, NuGet, and pip. The Spice.ai platform includes [spicerack.org](https://spicerack.org), the registry for ML building blocks. +Modern developers build with the community by leveraging registries such as npm, NuGet, and pip. The Spice platform includes [spicerack.org](https://spicerack.org), the registry for ML building blocks. As the community shares their ML building blocks (aka Spicepods, or pods for short), developers can quickly add them to their Spice.ai applications enabling them to stream data and build learning into their applications quickly and easily. Initially, Spicepods contain simple definitions of how the app should learn, and eventually will enable the sharing and use of fully-trained models. diff --git a/spiceaidocs/content/en/getting-started/_index.md b/spiceaidocs/content/en/getting-started/_index.md index 6bd67702..c594459d 100644 --- a/spiceaidocs/content/en/getting-started/_index.md +++ b/spiceaidocs/content/en/getting-started/_index.md @@ -13,10 +13,123 @@ Before following this guide it is first recommended to review the Spice.ai [core ### Follow these steps to get started with Spice.ai. -1. Install Spice.ai - - - - +**Step 1.** Install the Spice CLI: -{{< button text="First step: Install Spice.ai >>" page="install-spiceai" >}} +```bash +curl https://install.spiceai.org | /bin/bash +``` + +**Step 2.** Initialize a new Spice app with the `spice init` command: + +```bash +spice init spice_app +``` + +A `Spicepod.yaml` file is created in the working directory. + +**Step 3.** Connect to the sample Dremio instance to access the sample data: + +```bash +spice login dremio -u demo -p demo1234 +``` + +**Step 4.** Start the Spice runtime: + +```bash +spice run +``` + +Example output will be shown as follows: + +```bash +Spice.ai runtime starting... +Using latest 'local' runtime version. +2024-02-21T06:11:56.381793Z INFO runtime::http: Spice Runtime HTTP listening on 127.0.0.1:3000 +2024-02-21T06:11:56.381853Z INFO runtime::flight: Spice Runtime Flight listening on 127.0.0.1:50051 +2024-02-21T06:11:56.382038Z INFO runtime::opentelemetry: Spice Runtime OpenTelemetry listening on 127.0.0.1:50052 +``` + +The runtime is now started and ready for queries. + +**Step 5.** In a new terminal window, add the `spiceai/quickstart` Spicepod. A Spicepod is a package of configuration defining datasets and ML models. + +```bash +spice add spiceai/quickstart +``` + +The `Spicepod.yaml` file will be updated with the `spiceai/quickstart` dependency. + +```yaml +version: v1beta1 +kind: Spicepod +name: PROJECT_NAME +dependencies: + - spiceai/quickstart +``` + +The `spiceai/quickstart` Spicepod will add a `taxi_trips` data table to the runtime which is now available to query by SQL. + +```bash +2024-02-22T05:53:48.222952Z INFO runtime: Loaded dataset: taxi_trips +2024-02-22T05:53:48.223101Z INFO runtime::dataconnector: Refreshing data for taxi_trips +``` + +**Step 6.** Start the Spice SQL REPL: + +```bash +spice sql +``` + +The SQL REPL inferface will be shown: + +``` +Welcome to the interactive Spice.ai SQL Query Utility! Type 'help' for help. + +show tables; -- list available tables +sql> +``` + +Enter `show tables;` to display the available tables for query: + +``` +sql> show tables; + ++---------------+--------------------+-------------+------------+ +| table_catalog | table_schema | table_name | table_type | ++---------------+--------------------+-------------+------------+ +| datafusion | public | taxi_trips | BASE TABLE | +| datafusion | information_schema | tables | VIEW | +| datafusion | information_schema | views | VIEW | +| datafusion | information_schema | columns | VIEW | +| datafusion | information_schema | df_settings | VIEW | ++---------------+--------------------+-------------+------------+ + +Query took: 0.004728897 seconds +``` + +Enter a query to display the most expensive tax trips: + +``` +sql> SELECT trip_distance_mi, fare_amount FROM taxi_trips ORDER BY fare_amount LIMIT 10; +``` + +Output: + +``` ++------------------+-------------+ +| trip_distance_mi | fare_amount | ++------------------+-------------+ +| 1.1 | 7.5 | +| 6.1 | 23.0 | +| 0.6 | 4.5 | +| 16.7 | 52.0 | +| 11.3 | 37.5 | +| 1.1 | 6.0 | +| 5.3 | 18.5 | +| 1.3 | 7.0 | +| 1.0 | 7.0 | +| 3.5 | 17.5 | ++------------------+-------------+ + +Query took: 0.002458976 seconds +``` \ No newline at end of file diff --git a/spiceaidocs/content/en/getting-started/install-spiceai.md b/spiceaidocs/content/en/getting-started/install-spiceai.md deleted file mode 100644 index 3ffcf02d..00000000 --- a/spiceaidocs/content/en/getting-started/install-spiceai.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -type: docs -title: "Install Spice.ai" -linkTitle: "Install Spice.ai" -weight: 5 ---- - -### Spice.ai CLI Installation - -Install the Spice CLI by running the following `curl` command in your terminal. - -```bash -curl https://install.spiceai.org | /bin/bash -``` - -You may need to restart your terminal for the `spice` command to be added to your PATH. diff --git a/spiceaidocs/content/en/getting-started/next-steps.md b/spiceaidocs/content/en/getting-started/next-steps.md deleted file mode 100644 index 002e5936..00000000 --- a/spiceaidocs/content/en/getting-started/next-steps.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -type: docs -title: "Next steps" -linkTitle: "Next steps" -weight: 20 ---- - -Congratulations! In just a few minutes you downloaded and installed the Spice.ai CLI and runtime, created your first Spice.ai pod, trained it, and got a recommendation from it. - -This is just the start of the journey with Spice.ai. Next, try one of the quickstart tutorials or more in-depth samples for creating intelligent applications with Spice.ai. - -**Try:** - -- [ServerOps sample](https://github.com/spiceai/samples/tree/trunk/serverops) - a more in-depth version of the quickstart you just completed, using live CPU metrics from your own machine -- [Gardener sample](https://github.com/spiceai/samples/tree/trunk/gardener/README.md) - Intelligently water a simulated garden -- [Trader quickstart](https://github.com/spiceai/quickstarts/tree/trunk/trader) - a basic sample Bitcoin trading bot - -**Have questions?** - -If you need help, feel free to get in touch with the team through [Discord](https://discord.gg/kZnTfneP5u). diff --git a/spiceaidocs/content/en/getting-started/train-pod.md b/spiceaidocs/content/en/getting-started/train-pod.md deleted file mode 100644 index 068339a3..00000000 --- a/spiceaidocs/content/en/getting-started/train-pod.md +++ /dev/null @@ -1,72 +0,0 @@ ---- -type: docs -title: "Create your first Spice.ai pod and train it" -linkTitle: "Train a Spice.ai pod" -weight: 10 ---- - -A [Spice.ai Pod]({{}}#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: - -```bash -cd $HOME -git clone https://github.com/spiceai/quickstarts -cd quickstarts/serverops -``` - -Step 2. Start the Spice runtime with `spice run`: - -```bash -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. - -```bash -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](#retrain-the-pod) below. - -### Observe the pod training - -Navigate to [http://localhost:8000](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. - -```bash -spice train serverops -``` - -### Get a recommendation - -After training the pod, you can now get a recommendation for an action from it! - -```bash -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 -``` - -{{< button text="Next steps >>" page="next-steps" >}}