You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/docs/api/adbc/index.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,3 +74,26 @@ pyarrow.Table
74
74
2.0: [[2]]
75
75
'Hello, world!': [["Hello, world!"]]
76
76
```
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,))
Spice supports parameterized queries with JDBC. Parameterized queries help prevent SQL injection and improve code clarity by separating query logic from data values.
Spice supports parameterized queries with ODBC. Parameterized queries help prevent SQL injection and improve code clarity by separating query logic from data values.
Copy file name to clipboardExpand all lines: website/docs/api/overview.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: 'API Overview'
3
3
sidebar_label: 'Overview'
4
4
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.'
-**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).
| `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`. |
81
82
82
83
### Azure Blob
83
84
@@ -208,15 +209,15 @@ Spice integrates with multiple secret stores to help manage sensitive data secur
208
209
209
210
- 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)
210
211
211
-
:::warning[Memory Considerations]
212
+
:::warning[Memory Considerations]
212
213
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.
214
215
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`.
216
217
217
218
- The Databricks Connector (`mode: spark_connect`) does not yet support streaming query results from Spark.
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.
|`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}`. |
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.
|[`databricks`][databricks]| Models deployed to Databricks Mosaic AI | Alpha | - | OpenAI-compatible HTTP endpoint |
19
20
20
21
[file]: /components/embeddings/local.md
21
22
[hf]: ./huggingface.md
@@ -24,6 +25,7 @@ Spice supports various model providers for traditional machine learning (ML) mod
24
25
[azure]: ./azure.md
25
26
[ant]: ./anthropic.md
26
27
[xai]: ./xai.md
28
+
[databricks]: ./databricks.md
27
29
28
30
Spice also tests and evaluates common models and grades their ability to integrate with Spice. See the [Models Grade Report](/docs/reference/models.md).
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