Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions website/blog/2024/adding-spice.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ Spice is open-source, Apache 2.0 licensed, and is built using industry-leading t

You can download and run Spice in less than 30 seconds by following the quickstart at [github.com/spiceai/spiceai](https://github.com/spiceai/spiceai#quickstart).

<ReactPlayer
controls
url='https://www.youtube.com/watch?v=t3B2AyshVY0&list=PLesJrUXEx3U-dQul0PqLV3TGTdUmr3B6e&index=1&pp=gAQBiAQB'
/>
<div style={{display: 'flex', justifyContent: 'center', marginBottom: '15px'}}>
<ReactPlayer
controls
url='https://www.youtube.com/watch?v=t3B2AyshVY0&list=PLesJrUXEx3U-dQul0PqLV3TGTdUmr3B6e&index=1&pp=gAQBiAQB'
/>
</div>

### Conclusion

Expand Down
2 changes: 1 addition & 1 deletion website/docs/features/federated-queries/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Spice supports federated queries, enabling you to join and combine data from mul

To start using federated queries in Spice, follow these steps:

**Step 1.** Install Spice by following the [installation instructions](/docs/getting-started/index.md).
**Step 1.** Install Spice by following the [installation instructions](/docs/getting-started/index.mdx).

**Step 2.** Clone the Spice Cookbook repository and navigate to the `federation` directory.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@ description: 'Get started with Spice in 5 minutes'
pagination_next: null
---

import ReactPlayer from 'react-player';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

<div className="video-container">
<iframe width="560" height="420" src="https://www.youtube.com/embed/AZyrecVWnEs?si=2s_2jLTJlUdgItyC" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<div style={{display: 'flex', justifyContent: 'center', marginBottom: '15px'}}>
<ReactPlayer
controls
url='https://www.youtube.com/watch?v=RvUvmCzuqYI'
/>
</div>

### Follow these steps to get started with Spice.

Download the latest version of Spice, connect to a dataset in S3, and ask questions about the data using AI, in less than 5 minutes.

**Step 1.** Install the Spice CLI:

<Tabs>
Expand Down Expand Up @@ -49,26 +55,15 @@ A `spicepod.yaml` file is created in the `spice_qs` directory. Change to that di
cd spice_qs
```

**Step 3.** Start the Spice runtime:
**Step 3.** Download the Spice runtime:

```bash
spice run
```

Example output will be shown as follows:
Install the Spice runtime with support for AI features with:

```bash
Spice.ai runtime starting...
2024-08-05T13:02:40.247484Z INFO runtime::flight: Spice Runtime Flight listening on 127.0.0.1:50051
2024-08-05T13:02:40.247490Z INFO runtime::metrics_server: Spice Runtime Metrics listening on 127.0.0.1:9090
2024-08-05T13:02:40.247949Z INFO runtime: Initialized results cache; max size: 128.00 MiB, item ttl: 1s
2024-08-05T13:02:40.248611Z INFO runtime::http: Spice Runtime HTTP listening on 127.0.0.1:8090
2024-08-05T13:02:40.252356Z INFO runtime::opentelemetry: Spice Runtime OpenTelemetry listening on 127.0.0.1:50052
spice install ai
```

The runtime is now started and ready for queries.

**Step 4.** In a new terminal window, add the `spiceai/quickstart` Spicepod. A Spicepod is a package of configuration defining datasets and ML models.
**Step 4.** Add the `spiceai/quickstart` Spicepod. A Spicepod is a package of configuration defining datasets and ML models.

```bash
spice add spiceai/quickstart
Expand All @@ -84,14 +79,53 @@ 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.
**Step 6.** Add an [OpenAI] model to the Spicepod, with tools enabled to enable the model to access the data:

[OpenAI]: /docs/components/models/openai

```yaml
models:
- from: openai:gpt-4o-mini
name: openai_model
params:
openai_api_key: ${ env:OPENAI_API_KEY }
tools: auto
```

Add your OpenAI API key to a `.env` file that will be automatically loaded:

```bash
2024-08-05T13:04:56.742779Z INFO runtime: Dataset taxi_trips registered (s3://spiceai-demo-datasets/taxi_trips/2024/), acceleration (arrow, 10s refresh), results cache enabled.
2024-08-05T13:04:56.744062Z INFO runtime::accelerated_table::refresh_task: Loading data for dataset taxi_trips
2024-08-05T13:05:03.556169Z INFO runtime::accelerated_table::refresh_task: Loaded 2,964,624 rows (421.71 MiB) for dataset taxi_trips in 6s 812ms.
echo "OPENAI_API_KEY=sk-..." > .env
```

Start the Spice runtime:

```bash
spice run
```

Example output:

```bash
Spice.ai runtime starting...
2024-08-05T13:02:40.247484Z INFO runtime::flight: Spice Runtime Flight listening on 127.0.0.1:50051
2024-08-05T13:02:40.247490Z INFO runtime::metrics_server: Spice Runtime Metrics listening on 127.0.0.1:9090
2024-08-05T13:02:40.247949Z INFO runtime: Initialized results cache; max size: 128.00 MiB, item ttl: 1s
2024-08-05T13:02:40.248611Z INFO runtime::http: Spice Runtime HTTP listening on 127.0.0.1:8090
2024-08-05T13:02:40.252356Z INFO runtime::opentelemetry: Spice Runtime OpenTelemetry listening on 127.0.0.1:50052
```

**Step N.** Start the Spice Chat REPL and ask a question:

```bash
$ spice chat
Using model: openai_model
chat> How many taxi trips were taken?
A total of 2,964,624 trips were taken according to the dataset.
```

The OpenAI model was automatically provided with the `taxi_trips` dataset and was able to answer the question.

**Step 5.** Start the Spice SQL REPL:

```bash
Expand Down Expand Up @@ -149,34 +183,6 @@ Output:
Time: 0.045150667 seconds. 10 rows.
```

### Additional Example

```shell
# Query to display the shortest taxi trips
sql> SELECT trip_distance, total_amount FROM taxi_trips ORDER BY trip_distance ASC LIMIT 10;
```

Output:

```
+---------------+--------------+
| trip_distance | total_amount |
+---------------+--------------+
| 0.0 | 2.5 |
| 0.0 | 2.5 |
| 0.0 | 2.5 |
| 0.0 | 2.5 |
| 0.0 | 2.5 |
| 0.0 | 2.5 |
| 0.0 | 2.5 |
| 0.0 | 2.5 |
| 0.0 | 2.5 |
| 0.0 | 2.5 |
+---------------+--------------+

Time: 0.045150667 seconds. 10 rows.
```

## Next Steps

import DocCardList from '@theme/DocCardList';
Expand Down
2 changes: 1 addition & 1 deletion website/docs/getting-started/spiceai.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: 'Connect to the Spice.ai Cloud Platform to access community dataset
pagination_next: null
---

The [Spice.ai Cloud Platform](https://docs.spice.ai) includes a comprehensive set of free, ready-to-query [sample and blockchain datasets](https://docs.spice.ai/building-blocks/datasets).
The [Spice.ai Cloud Platform](https://docs.spice.ai) includes a comprehensive set of free, ready-to-query [sample datasets](https://spicerack.org/).

The Spice runtime can query these datasets using the [Spice.ai Data Connector](/docs/components/data-connectors/spiceai.md).

Expand Down
2 changes: 1 addition & 1 deletion website/docs/getting-started/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Spice collects anonymous telemetry data, which is used to help understand how to

Data collected includes:

- The version of Spice being used (i.e. `v0.17.2-beta`)
- The version of Spice being used (i.e. `v1.0.0`)
- An anonymous identifier for the Spice instance, computed as `sha256(hostname + spicepod.name)`.
- An anonymous identifier for the Spicepod, computed as `sha256(spicepod.name)`.
- The code to calculate these identifiers is here: [https://github.com/spiceai/spiceai/blob/trunk/crates/telemetry/src/anonymous.rs#L65](https://github.com/spiceai/spiceai/blob/trunk/crates/telemetry/src/anonymous.rs#L65)
Expand Down
10 changes: 6 additions & 4 deletions website/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ Limited = Partial or restricted support

### Watch a 30-sec BI dashboard acceleration demo

<ReactPlayer
controls
url='https://www.youtube.com/watch?v=t3B2AyshVY0&list=PLesJrUXEx3U-dQul0PqLV3TGTdUmr3B6e&index=1&pp=gAQBiAQB'
/>
<div style={{display: 'flex', justifyContent: 'center', marginBottom: '15px'}}>
<ReactPlayer
controls
url='https://www.youtube.com/watch?v=t3B2AyshVY0&list=PLesJrUXEx3U-dQul0PqLV3TGTdUmr3B6e&index=1&pp=gAQBiAQB'
/>
</div>

See more demos on [YouTube](https://www.youtube.com/playlist?list=PLesJrUXEx3U9anekJvbjyyTm7r9A26ugK).

Expand Down
Loading