Skip to content

Commit 6db110e

Browse files
authored
Merge branch 'release/1.2.0' into qianqian/spice-chat-message
2 parents 734e6ae + b600b7b commit 6db110e

18 files changed

Lines changed: 405 additions & 48 deletions

File tree

website/docs/api/adbc/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,26 @@ pyarrow.Table
7474
2.0: [[2]]
7575
'Hello, world!': [["Hello, world!"]]
7676
```
77+
78+
## Parameterized Queries
79+
80+
Spice supports parameterized queries when using ADBC clients. Parameterized queries help prevent SQL injection and improve code clarity by separating query logic from data values. The following example demonstrates how to use parameterized queries with the Python ADBC FlightSQL driver:
81+
82+
```python
83+
from adbc_driver_flightsql import DatabaseOptions
84+
from adbc_driver_flightsql.dbapi import connect
85+
86+
with connect(
87+
"grpc://127.0.0.1:50051",
88+
) as conn:
89+
with conn.cursor() as cur:
90+
cur.execute("SELECT $1 + 1 AS the_answer", parameters=(41,))
91+
table = cur.fetch_arrow_table()
92+
print(table)
93+
94+
cur.execute("SELECT 1 AS one")
95+
table = cur.fetch_arrow_table()
96+
print(table)
97+
98+
conn.close()
99+
```

website/docs/api/jdbc/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,7 @@ Replace `<enter-api-key-here>` with the API key value. The `user` and `password`
7979
In the configured application, run a sample query, such as `SELECT * FROM taxi_trips;`
8080

8181
![Query Results](https://imagedelivery.net/HyTs22ttunfIlvyd6vumhQ/0e9f3c0f-2e03-47f9-8d5e-65e078d7e900/public 'Query Results')
82+
83+
## Parameterized Queries
84+
85+
Spice supports parameterized queries with JDBC. Parameterized queries help prevent SQL injection and improve code clarity by separating query logic from data values.

website/docs/api/odbc/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,7 @@ SELECT trip_distance, total_amount FROM taxi_trips ORDER BY trip_distance DESC L
126126
```
127127

128128
<img width="800" alt="Example Query Results" src="/img/odbc/spice-odbc-example-query.png" />
129+
130+
## Parameterized Queries
131+
132+
Spice supports parameterized queries with ODBC. Parameterized queries help prevent SQL injection and improve code clarity by separating query logic from data values.

website/docs/api/overview.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: 'API Overview'
33
sidebar_label: 'Overview'
44
sidebar_position: 1
5-
description: 'API Overview'
5+
description: 'Spice.ai API overview, including SQL query interfaces, OpenAI-compatible endpoints, Iceberg catalog REST APIs, and the Model Context Protocol (MCP) for integrating external tools.'
66
pagination_prev: null
77
pagination_next: null
88
---
@@ -21,3 +21,11 @@ Spice provides high-performance, industry-standard APIs:
2121
### Iceberg Catalog REST APIs
2222

2323
- **HTTP APIs**: Unified API for consuming Apache Iceberg catalogs in data lake architectures.
24+
25+
### MCP API
26+
27+
- **HTTP APIs**: The Model Context Protocol (MCP) helps integrate external tools and services into the Spice runtime. MCP tools can be accessed via HTTP APIs for tool integration and orchestration. For details, see the [MCP documentation](/docs/features/large-language-models/mcp).
28+
29+
:::note
30+
HTTP Streaming support for MCP is coming soon.
31+
:::

website/docs/components/data-connectors/databricks.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ Configure the connection to the object store when using `mode: delta_lake`. Use
7272

7373
### AWS S3
7474

75-
| Parameter Name | Description |
76-
| ---------------------------------- | ---------------------------------------------------------------------------------- |
77-
| `databricks_aws_region` | Optional. The AWS region for the S3 object store. E.g. `us-west-2`. |
78-
| `databricks_aws_access_key_id` | The access key ID for the S3 object store. |
79-
| `databricks_aws_secret_access_key` | The secret access key for the S3 object store. |
80-
| `databricks_aws_endpoint` | Optional. The endpoint for the S3 object store. E.g. `s3.us-west-2.amazonaws.com`. |
75+
| Parameter Name | Description |
76+
| ---------------------------------- | ---------------------------------------------------------------------------------------------- |
77+
| `databricks_aws_region` | Optional. The AWS region for the S3 object store. E.g. `us-west-2`. |
78+
| `databricks_aws_access_key_id` | The access key ID for the S3 object store. |
79+
| `databricks_aws_secret_access_key` | The secret access key for the S3 object store. |
80+
| `databricks_aws_endpoint` | Optional. The endpoint for the S3 object store. E.g. `s3.us-west-2.amazonaws.com`. |
81+
| `databricks_aws_allow_http` | Optional. Enables insecure HTTP connections to `databricks_aws_endpoint`. Defaults to `false`. |
8182

8283
### Azure Blob
8384

@@ -208,15 +209,15 @@ Spice integrates with multiple secret stores to help manage sensitive data secur
208209

209210
- When using `mode: spark_connect`, correlated scalar subqueries can only be used in filters, aggregations, projections, and UPDATE/MERGE/DELETE commands. [Spark Docs](https://spark.apache.org/docs/latest/sql-error-conditions-unsupported-subquery-expression-category-error-class.html#unsupported_correlated_scalar_subquery)
210211

211-
:::warning[Memory Considerations]
212+
:::warning[Memory Considerations]
212213

213-
When using the Databricks (mode: delta_lake) Data connector without acceleration, data is loaded into memory during query execution. Ensure sufficient memory is available, including overhead for queries and the runtime, especially with concurrent queries.
214+
When using the Databricks (mode: delta_lake) Data connector without acceleration, data is loaded into memory during query execution. Ensure sufficient memory is available, including overhead for queries and the runtime, especially with concurrent queries.
214215

215-
Memory limitations can be mitigated by storing acceleration data on disk, which is supported by [`duckdb`](../data-accelerators/duckdb.md) and [`sqlite`](../data-accelerators/sqlite.md) accelerators by specifying `mode: file`.
216+
Memory limitations can be mitigated by storing acceleration data on disk, which is supported by [`duckdb`](../data-accelerators/duckdb.md) and [`sqlite`](../data-accelerators/sqlite.md) accelerators by specifying `mode: file`.
216217

217218
- The Databricks Connector (`mode: spark_connect`) does not yet support streaming query results from Spark.
218219

219-
:::
220+
:::
220221

221222
## Cookbook
222223

website/docs/components/data-connectors/delta-lake.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,13 @@ Use the [secret replacement syntax](../secret-stores/index.md) to reference a se
6363

6464
### AWS S3
6565

66-
| Parameter Name | Description |
67-
| ---------------------------------- | ---------------------------------------------------------------------------------- |
68-
| `delta_lake_aws_region` | Optional. The AWS region for the S3 object store. E.g. `us-west-2`. |
69-
| `delta_lake_aws_access_key_id` | The access key ID for the S3 object store. |
70-
| `delta_lake_aws_secret_access_key` | The secret access key for the S3 object store. |
71-
| `delta_lake_aws_endpoint` | Optional. The endpoint for the S3 object store. E.g. `s3.us-west-2.amazonaws.com`. |
66+
| Parameter Name | Description |
67+
| ---------------------------------- | ---------------------------------------------------------------------------------------------- |
68+
| `delta_lake_aws_region` | Optional. The AWS region for the S3 object store. E.g. `us-west-2`. |
69+
| `delta_lake_aws_access_key_id` | The access key ID for the S3 object store. |
70+
| `delta_lake_aws_secret_access_key` | The secret access key for the S3 object store. |
71+
| `delta_lake_aws_endpoint` | Optional. The endpoint for the S3 object store. E.g. `s3.us-west-2.amazonaws.com`. |
72+
| `delta_lake_aws_allow_http` | Optional. Enables insecure HTTP connections to `delta_lake_aws_endpoint`. Defaults to `false`. |
7273

7374
### Azure Blob
7475

@@ -116,6 +117,19 @@ Use the [secret replacement syntax](../secret-stores/index.md) to reference a se
116117
delta_lake_aws_endpoint: s3.us-west-2.amazonaws.com # Optional
117118
```
118119

120+
### Delta Lake + MinIO
121+
122+
```yaml
123+
- from: delta_lake:s3://my_bucket/path/to/s3/delta/table/ # A reference to a table in MinIO
124+
name: my_delta_lake_table
125+
params:
126+
delta_lake_aws_region: us-east-1 # Best practice for MinIO
127+
delta_lake_aws_access_key_id: ${secrets:aws_access_key_id}
128+
delta_lake_aws_secret_access_key: ${secrets:aws_secret_access_key}
129+
delta_lake_aws_endpoint: http://localhost:9000 # MinIO Endpoint
130+
delta_lake_aws_allow_http: true
131+
```
132+
119133
### Delta Lake + Azure Blob
120134

121135
```yaml
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: 'Databricks Model Provider'
3+
description: 'Instructions for using Databricks Mosaic AI Models'
4+
sidebar_label: 'Databricks'
5+
sidebar_position: 8
6+
---
7+
8+
To use a language model deployed to [Databricks Mosaic AI Model Serving](https://docs.databricks.com/aws/en/machine-learning/model-serving/), specify the model endpoint name prefixed with `databricks:` in the `from` field and include the required parameters in the `params` section.
9+
10+
### Parameters
11+
12+
| Parameter | Description |
13+
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
14+
| `databricks_endpoint` | The Databricks workspace endpoint, e.g., `dbc-a12cd3e4-56f7.cloud.databricks.com`. |
15+
| `databricks_token` | The Databricks API token to authenticate with the Unity Catalog API. Use the [secret replacement syntax](../secret-stores/index.md) to reference a secret, e.g., `${secrets:my_databricks_token}`. |
16+
17+
### Example `spicepod.yaml` Configuration
18+
19+
```yaml
20+
models:
21+
- from: databricks:jeadie
22+
name: food
23+
params:
24+
databricks_endpoint: dbc-46470731-42e5.cloud.databricks.com
25+
databricks_token: ${ secrets:SPICE_DATABRICKS_TOKEN }
26+
```
27+
28+
### Additional Information
29+
30+
Refer to the [Moasic AI Model Serving documentation](https://docs.databricks.com/aws/en/machine-learning/model-serving/) for more details on available models and configurations.

website/docs/components/models/index.md

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ image: /img/og/models.png
77

88
Spice supports various model providers for traditional machine learning (ML) models and large language models (LLMs).
99

10-
| Name | Description | Status | ML Format(s) | LLM Format(s)\* |
11-
| ------------------- | -------------------------------------------- | ----------------- | ------------ | ------------------------------- |
12-
| [`openai`][openai] | OpenAI (or compatible) LLM endpoint | Release Candidate | - | OpenAI-compatible HTTP endpoint |
13-
| [`file`][file] | Local filesystem | Release Candidate | ONNX | GGUF, GGML, SafeTensor |
14-
| [`huggingface`][hf] | Models hosted on HuggingFace | Release Candidate | ONNX | GGUF, GGML, SafeTensor |
15-
| [`spice.ai`][spice] | Models hosted on the Spice.ai Cloud Platform | Alpha | ONNX | OpenAI-compatible HTTP endpoint |
16-
| [`azure`][azure] | Azure OpenAI | Alpha | - | OpenAI-compatible HTTP endpoint |
17-
| [`anthropic`][ant] | Models hosted on Anthropic | Alpha | - | OpenAI-compatible HTTP endpoint |
18-
| [`xai`][xai] | Models hosted on xAI | Alpha | - | OpenAI-compatible HTTP endpoint |
10+
| Name | Description | Status | ML Format(s) | LLM Format(s)\* |
11+
| -------------------------- | -------------------------------------------- | ----------------- | ------------ | ------------------------------- |
12+
| [`openai`][openai] | OpenAI (or compatible) LLM endpoint | Release Candidate | - | OpenAI-compatible HTTP endpoint |
13+
| [`file`][file] | Local filesystem | Release Candidate | ONNX | GGUF, GGML, SafeTensor |
14+
| [`huggingface`][hf] | Models hosted on HuggingFace | Release Candidate | ONNX | GGUF, GGML, SafeTensor |
15+
| [`spice.ai`][spice] | Models hosted on the Spice.ai Cloud Platform | Alpha | ONNX | OpenAI-compatible HTTP endpoint |
16+
| [`azure`][azure] | Azure OpenAI | Alpha | - | OpenAI-compatible HTTP endpoint |
17+
| [`anthropic`][ant] | Models hosted on Anthropic | Alpha | - | OpenAI-compatible HTTP endpoint |
18+
| [`xai`][xai] | Models hosted on xAI | Alpha | - | OpenAI-compatible HTTP endpoint |
19+
| [`databricks`][databricks] | Models deployed to Databricks Mosaic AI | Alpha | - | OpenAI-compatible HTTP endpoint |
1920

2021
[file]: /components/embeddings/local.md
2122
[hf]: ./huggingface.md
@@ -24,6 +25,7 @@ Spice supports various model providers for traditional machine learning (ML) mod
2425
[azure]: ./azure.md
2526
[ant]: ./anthropic.md
2627
[xai]: ./xai.md
28+
[databricks]: ./databricks.md
2729

2830
Spice also tests and evaluates common models and grades their ability to integrate with Spice. See the [Models Grade Report](/docs/reference/models.md).
2931

website/docs/components/views/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ views:
3737
3838
- `name`: The view's identifier, used for referencing in queries.
3939
- `sql`: The SQL query defining the view, supporting joins, subqueries, and aggregations.
40+
- `acceleration`: Views can be [locally accelerated](/docs/features/data-acceleration).
4041

4142
## Limitations and Considerations
4243

43-
- Views do not support acceleration; instead accelerate the underlying dataset(s).
4444
- Views are read-only; insert, update, and delete operations are not supported.
4545
- Performance depends on SQL complexity and underlying data.
4646
- Ensure queries are optimized to prevent slow execution.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: 'Workers Overview'
3+
description: 'Detailed documentation for workers in the Spice runtime.'
4+
sidebar_label: 'Workers Overview'
5+
sidebar_position: 8
6+
---
7+
8+
Workers in the Spice runtime represent configurable units of compute that help coordinate and manage interactions between models and tools. Each worker is defined as a component in the `spicepod.yaml` file, specifying its behavior and interaction logic.
9+
10+
## Configuration
11+
12+
Workers are configured in the `workers` section of the `spicepod.yaml` file. Each worker definition includes a name, description, and a list of models or tools it encapsulates.
13+
14+
**Example `spicepod.yaml` configuration:**
15+
16+
```yaml
17+
workers:
18+
- name: round-robin
19+
description: |
20+
Distributes requests between 'foo' and 'bar' models in a round-robin fashion.
21+
models:
22+
- from: foo
23+
- from: bar
24+
- name: fallback
25+
description: |
26+
Attempts 'bar' first, then 'foo', then 'baz' if previous models fail.
27+
models:
28+
- from: foo
29+
order: 2
30+
- from: bar
31+
order: 1
32+
- from: baz
33+
order: 3
34+
```
35+
36+
## Use-Cases
37+
38+
Workers currently help implement:
39+
40+
- Model fallback and error handling
41+
- Load balancing across multiple models
42+
43+
## Usage
44+
45+
Workers can be invoked using the same API endpoints as individual models. For example, to call a worker named `fallback` using the OpenAI-compatible HTTP API:
46+
47+
```bash
48+
curl http://localhost:8090/v1/chat/completions \
49+
-H "Content-Type: application/json" \
50+
-d '{
51+
"model": "fallback",
52+
"messages": [{ "role": "user", "content": "Tell me a joke"}]
53+
}'
54+
```
55+
56+
## Roadmap
57+
58+
The vision for workers includes support for dynamic serverless compute, enabling execution of user-defined functions within the Spice runtime. This direction aims to help developers define custom logic and orchestration patterns directly in the worker configuration, supporting more advanced workflows and automation. Further details and implementation timelines will be provided in future updates. For ongoing progress, refer to the project repository and documentation.
59+
60+
## Further Reading
61+
62+
For a complete specification of worker configuration, routing rules, and available options, refer to the [Spicepod Workers Reference](/docs/reference/spicepod/workers.md).

0 commit comments

Comments
 (0)