Skip to content

Commit f7f123a

Browse files
authored
Merge branch 'trunk' into jeadie/openapi-10272
2 parents 89676c1 + 7725c89 commit f7f123a

252 files changed

Lines changed: 8684 additions & 1236 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

website/docs/api/HTTP/mcp-event.api.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: mcp-event
33
title: "Send message to MCP server"
4-
description: "Send message to the MCP endoint, for a given session."
4+
description: "Send a message to the MCP endpoint for a given session. Include the Mcp-Session-Id header to identify the session."
55
sidebar_label: "Send message to MCP server"
66
hide_title: true
77
hide_table_of_contents: true
@@ -29,15 +29,15 @@ import Heading from "@theme/Heading";
2929

3030
<MethodEndpoint
3131
method={"post"}
32-
path={"/v1/mcp/sse"}
32+
path={"/v1/mcp"}
3333
context={"endpoint"}
3434
>
3535

3636
</MethodEndpoint>
3737

3838

3939

40-
Send message to the MCP endoint, for a given session.
40+
Send a message to the MCP endpoint for a given session. Include the `Mcp-Session-Id` header to identify the session.
4141

4242
<Heading
4343
id={"request"}
@@ -48,7 +48,7 @@ Send message to the MCP endoint, for a given session.
4848
</Heading>
4949

5050
<ParamsDetails
51-
parameters={[{"name":"sessionId","in":"query","required":true}]}
51+
parameters={[{"name":"Mcp-Session-Id","in":"header","required":true}]}
5252
>
5353

5454
</ParamsDetails>
@@ -63,7 +63,7 @@ Send message to the MCP endoint, for a given session.
6363
<StatusCodes
6464
id={undefined}
6565
label={undefined}
66-
responses={{"202":{"description":"Message accepted. Response will stream via SSE."},"404":{"description":"Session not found. No active session for the given `session_id`."},"413":{"description":"Payload too large. Maximum allowed size is 4MB."},"500":{"description":"Internal server error. An unexpected issue occurred."}}}
66+
responses={{"202":{"description":"Message accepted. Response will stream via the Streamable HTTP connection."},"404":{"description":"Session not found. No active session for the given `Mcp-Session-Id`."},"413":{"description":"Payload too large. Maximum allowed size is 32 MiB."},"500":{"description":"Internal server error. An unexpected issue occurred."}}}
6767
>
6868

6969
</StatusCodes>

website/docs/api/HTTP/operation-id.api.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
id: operation-id
3-
title: "Establish an MCP SSE Connection"
4-
description: "Initiates a Server-Sent Events (SSE) connection using the Model Context Protocol (MCP) to interact with Spice tools."
5-
sidebar_label: "Establish an MCP SSE Connection"
3+
title: "Establish an MCP Streamable HTTP Connection"
4+
description: "Initiates a Streamable HTTP connection using the Model Context Protocol (MCP) to interact with Spice tools."
5+
sidebar_label: "Establish an MCP Streamable HTTP Connection"
66
hide_title: true
77
hide_table_of_contents: true
88
api: eJzlU8Fu2zAM/RWCpxZwnGanzbchCIYCKxrA2akLGlVmYmKypEm0t8Lwvw90tjbrPmHWxdYT36Men0cUc8pYPWBnI+4LbCjbxFE4eKzw1rOwEcpgoKY0UFrU5AU2A3nJcFXXm2uwwXuyWgF9Zn8CaQnuQkMO1sEL/RTYpiDBBgdXd+vtNUgA9kLJWIEfLC3UkS2BhOBy+dXrgsvn3lv6I0NNAdbxrG+Nh0y+gY5yNifKMLCBw/a+3sFyWC07G5c50wGMbyCRJR4IEuUYfKYM0qbQn1qQljPU9QayJDJdiQWGSMnolW4brF6/HrnBAl8YsBqnAjuSNuixEwkWGI20WOGFPhaYZ/PU6BH75LDCViRWy6UL1rg2ZKne33y4wbcD+KwwNDSQC7FT689MpVp75FOf6OzgYbFQxkOJ017lbJ9Ynmc9E/nxG+n7XjH2x4DViMLiCCtMvRfu6B/pXUuQdS4NvB5xbMln0npvOi3/GI1tafGu1Oa5IS98ZEp/I1OBev0z8apcrcqbRe+zmCdHCsaQpTP+gnYzg5xbMB7u1tt5PuuXpL3tdkSrUfPyP4dWnqNap80vozPs1do5bePvVD7gsMJi/tcL1GTuC9TwKTKOTybTl+SmSbe/95TmzBQ4mMTzpDRBF3n/tNnhNP0CfeNyCQ==
@@ -23,24 +23,24 @@ import Heading from "@theme/Heading";
2323
<Heading
2424
as={"h1"}
2525
className={"openapi__heading"}
26-
children={"Establish an MCP SSE Connection"}
26+
children={"Establish an MCP Streamable HTTP Connection"}
2727
>
2828
</Heading>
2929

3030
<MethodEndpoint
3131
method={"get"}
32-
path={"/v1/mcp/sse"}
32+
path={"/v1/mcp"}
3333
context={"endpoint"}
3434
>
3535

3636
</MethodEndpoint>
3737

3838

3939

40-
Initiates a Server-Sent Events (SSE) connection using the Model Context Protocol (MCP) to interact with Spice tools.
40+
Initiates a Streamable HTTP connection using the Model Context Protocol (MCP) to interact with Spice tools.
4141

4242

43-
Once connected, clients can send messages via `POST /v1/mcp/sse` and receive responses through this SSE stream.
43+
Once connected, clients can send messages via `POST /v1/mcp` with an `Mcp-Session-Id` header and receive responses through this stream.
4444

4545
<ParamsDetails
4646
parameters={undefined}

website/docs/cli/reference/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,18 @@ spice [command] [--help]
3232
| [install](reference/install) | Install or reinstall the Spice.ai runtime |
3333
| [login](reference/login) | Login to Spice.ai or configure credentials for data sources |
3434
| [models](reference/models) | Lists models loaded by the Spice runtime |
35-
| nsql | Text-to-SQL REPL - translate natural language to SQL |
35+
| [nsql](reference/nsql) | Text-to-SQL REPL - translate natural language to SQL |
3636
| [pods](reference/pods) | Lists Spicepods loaded by the Spice runtime |
3737
| [query](reference/query) | Submit an async query or start an interactive async query REPL |
3838
| [refresh](reference/refresh) | Refresh a dataset loaded by the Spice runtime |
3939
| [run](reference/run) | Run Spice - starts the Spice runtime, installing if necessary |
4040
| [search](reference/search) | Search datasets with embeddings |
4141
| [sql](reference/sql) | Start an interactive SQL query session against the Spice runtime |
42+
| [spiced](reference/spiced) | Spice runtime binary — direct invocation reference |
4243
| [status](reference/status) | Spice runtime status |
4344
| [trace](reference/trace) | Return traces for operations that occurred in Spice |
4445
| [upgrade](reference/upgrade) | Upgrades the Spice CLI and runtime to the latest release |
46+
| [validate](reference/validate) | Validate a spicepod.yaml without starting the runtime |
4547
| [version](reference/version) | Spice CLI version |
4648
| workers | Lists workers loaded by the Spice runtime |
4749

website/docs/cli/reference/init.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,21 @@ spice init [app_name]
2323
```
2424
> spice init taxi-trips
2525
26-
2025/01/09 16:43:02 INFO Initialized taxi-trips/spicepod.yaml
26+
Initialized taxi-trips/spicepod.yaml
27+
28+
Next steps:
29+
cd taxi-trips
30+
spice dataset configure # add a dataset interactively
31+
spice run # start the runtime
32+
33+
Docs: https://spiceai.org/docs/
2734
```
2835

29-
The command creates a `spicepod.yaml` with basic initial metadata about the app. For this example, the `spicepod.yaml` file is initialized to the following:
36+
The command creates a `spicepod.yaml` with basic initial metadata about the app, including a `yaml-language-server` schema directive for editor support (VS Code, Neovim, IntelliJ). For this example, the `spicepod.yaml` file is initialized to the following:
3037
```yaml
3138
# File: ./taxi-trips/spicepod.yaml
3239

40+
# yaml-language-server: $schema=https://raw.githubusercontent.com/spiceai/spiceai/trunk/.schema/spicepod.schema.json
3341
version: v2
3442
kind: Spicepod
3543
name: taxi-trips
@@ -40,13 +48,20 @@ If no app name is provided, Spice initializes the Spicepod in the current workin
4048
> spice init
4149

4250
name: (taxi-trips)?
43-
2025/01/09 16:48:37 INFO Initialized spicepod.yaml
51+
Initialized spicepod.yaml
52+
53+
Next steps:
54+
spice dataset configure # add a dataset interactively
55+
spice run # start the runtime
56+
57+
Docs: https://spiceai.org/docs/
4458
```
4559
4660
After execution, the current working directory contains the file `spicepod.yaml` with the same configuration as the previous example:
4761
```yaml
4862
# File: ./spicepod.yaml
4963
64+
# yaml-language-server: $schema=https://raw.githubusercontent.com/spiceai/spiceai/trunk/.schema/spicepod.schema.json
5065
version: v2
5166
kind: Spicepod
5267
name: taxi-trips

website/docs/cli/reference/nsql.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: 'nsql'
3+
sidebar_label: 'nsql'
4+
pagination_prev: null
5+
pagination_next: null
6+
description: 'spice nsql CLI documentation'
7+
---
8+
9+
Text-to-SQL REPL — translate natural language queries into SQL using a model loaded by the Spice runtime. The REPL sends the input to the runtime's `/v1/nsql` endpoint and prints the generated SQL along with the executed results.
10+
11+
## Requirements
12+
13+
- Spice runtime must be running
14+
- At least one [model](../../components/models/) defined in `spicepod.yaml` and ready
15+
16+
## Usage
17+
18+
```shell
19+
spice nsql [flags]
20+
spice nsql [flags] [command]
21+
```
22+
23+
### Flags
24+
25+
- `--model`, `-m <model>` Target model for Text-to-SQL generation. When omitted, the CLI uses the single ready model or prompts for a choice if several models are ready.
26+
- `-h`, `--help` Print usage information.
27+
28+
### Subcommands
29+
30+
- [`analyze`](#analyze) Analyze Text-to-SQL performance by comparing the generated SQL against an expected SQL query.
31+
32+
## Examples
33+
34+
Start an interactive Text-to-SQL session:
35+
36+
```shell
37+
$ spice nsql
38+
Welcome to the Spice.ai NSQL REPL!
39+
40+
Using model:
41+
openai
42+
43+
Enter a query in natural language.
44+
nsql> show the top 5 longest taxi trips
45+
```
46+
47+
Pass `--model` to select a specific model when more than one is ready:
48+
49+
```shell
50+
spice nsql --model openai
51+
```
52+
53+
Type `exit`, `quit`, `.exit`, or `.quit` — or press `Ctrl+D` — to leave the REPL. Inputs are saved to `nsql_history.txt` for recall with the up-arrow key.
54+
55+
## analyze
56+
57+
The `spice nsql analyze` subcommand evaluates Text-to-SQL quality by comparing a generated SQL query against an expected SQL query and reporting accuracy and performance metrics.
58+
59+
### Usage
60+
61+
```shell
62+
spice nsql analyze --query <natural-language-query> --expected <expected-sql> --model <model>
63+
```
64+
65+
### Flags
66+
67+
- `--query <query>` Natural language query to analyze. Required.
68+
- `--expected <sql>` Expected SQL query to compare the generated SQL against. Required.
69+
- `--model`, `-m <model>` Model to use for Text-to-SQL. Required.
70+
71+
### Metrics
72+
73+
Functional metrics (generated vs. expected SQL):
74+
75+
- `exact_match``1.0` if the generated SQL exactly matches the expected SQL, `0.0` otherwise.
76+
- `correct_tables` — Intersection-over-Union (IoU) of tables referenced.
77+
- `correct_projections` — IoU of projected columns/expressions.
78+
- `correct_schema` — IoU of output schema fields.
79+
80+
Performance metrics (read from `runtime.task_history` via the request's W3C trace ID):
81+
82+
- `input_tokens` — Total prompt tokens used by LLM calls.
83+
- `output_tokens` — Total completion tokens generated by the LLM.
84+
- `latency_ms` — End-to-end latency of the nsql request.
85+
- `sql_duration_ms` — Total time spent executing SQL queries.
86+
- `llm_duration_ms` — Total time spent in LLM inference.
87+
- `sql_query_count` — Number of SQL queries executed.
88+
- `llm_count` — Number of LLM completion calls made.
89+
90+
### Example
91+
92+
```shell
93+
spice nsql analyze \
94+
--model openai \
95+
--query "how many taxi trips are there?" \
96+
--expected "SELECT COUNT(*) FROM taxi_trips"
97+
```

website/docs/cli/reference/run.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ pagination_next: null
77

88
Run Spice - starts the Spice runtime, installing if necessary.
99

10+
`spice run` is a wrapper around the [`spiced`](./spiced) runtime binary. It installs `spiced` on first use, applies developer-friendly defaults, and forwards arguments after `--` to the runtime. To invoke the runtime directly (for containers, systemd units, or CI), see the [`spiced` reference](./spiced).
11+
1012
### Usage
1113

1214
```shell
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
title: 'spiced'
3+
sidebar_label: 'spiced'
4+
description: 'Command-line reference for the spiced runtime binary — flags, defaults, and differences from spice run.'
5+
keywords: [spice.ai, cli, spiced, runtime, binary, flags]
6+
pagination_prev: null
7+
pagination_next: null
8+
---
9+
10+
`spiced` is the Spice.ai runtime binary. It hosts the HTTP and Flight servers, loads a Spicepod, and serves queries.
11+
12+
Most users invoke `spiced` indirectly via [`spice run`](./run), which installs the runtime, applies developer-friendly defaults, and forwards CLI arguments. This page documents `spiced` itself for operators who run the binary directly (for example in containers, systemd units, or CI).
13+
14+
### Usage
15+
16+
```shell
17+
spiced [flags] [SPICEPOD_PATH]
18+
```
19+
20+
If `SPICEPOD_PATH` is omitted, `spiced` uses the current working directory.
21+
22+
### Runtime flags
23+
24+
- `--http <BIND_ADDRESS>` — HTTP server bind address. Default: `127.0.0.1:8090`.
25+
- `--flight <FLIGHT_BIND_ADDRESS>` — Arrow Flight server bind address. Default: `127.0.0.1:50051`.
26+
- `--metrics <BIND_ADDRESS>` — Enable the Prometheus scrape endpoint on the given address. Disabled by default.
27+
- `--pods-watcher-enabled` — Watch the Spicepod directory for changes and hot-reload. Disabled by default.
28+
- `--telemetry-enabled <true|false>` — Override anonymous telemetry collection. When unset, the value is taken from `runtime.telemetry.enabled` in the Spicepod.
29+
- `--version` — Print the runtime version and exit.
30+
- `-v`, `--verbose` — Increase log verbosity. Repeat (`-vv`) for debug output.
31+
- `--very-verbose` — Equivalent to `-vv`.
32+
- `--set-runtime <key.subkey=value>` — Override a runtime configuration value. Can be repeated; see [examples in `spice run`](./run#--set-runtime).
33+
34+
### TLS flags
35+
36+
These configure TLS for the HTTP and Flight servers.
37+
38+
- `--tls-enabled` — Enable TLS. Default: `false`.
39+
- `--tls-certificate <PEM>` — TLS certificate as an inline PEM string.
40+
- `--tls-certificate-file <PATH>` — Path to a PEM-encoded certificate file.
41+
- `--tls-key <PEM>` — TLS private key as an inline PEM string.
42+
- `--tls-key-file <PATH>` — Path to a PEM-encoded private key file.
43+
44+
### Cluster flags
45+
46+
Used when running `spiced` as part of a [distributed cluster](../../features/distributed-query). Omit these for standalone operation.
47+
48+
- `--role <scheduler|executor>` — Explicit cluster role. If omitted but `--scheduler-address` is set, the role defaults to `executor`.
49+
- `--scheduler-address <URL>` — URL of the scheduler service. Required on executors.
50+
- `--node-bind-address <BIND_ADDRESS>` — Bind address for the internal cluster gRPC service. Default: `0.0.0.0:50052`.
51+
- `--node-advertise-address <HOST_OR_IP>` — Hostname or IP this node advertises to the rest of the cluster.
52+
- `--node-mtls-ca-certificate-file <PATH>` — CA certificate used to validate peer node identities.
53+
- `--node-mtls-certificate-file <PATH>` — Certificate file used for both server TLS and client mTLS on the node port.
54+
- `--node-mtls-key-file <PATH>` — Private key file for the node certificate.
55+
- `--allow-insecure-connections` — Allow cluster communication without mTLS. Use only in development or testing environments.
56+
57+
### SQL REPL flags
58+
59+
- `--repl` — Start a SQL REPL against the runtime's Flight endpoint instead of serving requests.
60+
- `--repl-flight-endpoint <HTTP_ENDPOINT>` — Flight endpoint the REPL connects to. Default: `http://localhost:50051`.
61+
- `--http-endpoint <HTTP_ENDPOINT>` — HTTP endpoint the REPL connects to. Default: `http://localhost:8090`.
62+
- `--tls-root-certificate-file <PATH>` — Root certificate used to verify the runtime's TLS certificate.
63+
- `--client-tls-certificate-file <PATH>` — Client certificate for mTLS authentication. Must be used with `--client-tls-key-file`.
64+
65+
### Differences from `spice run`
66+
67+
`spice run` is a thin launcher around `spiced`. When it spawns the runtime, it adds a few flags automatically that `spiced` does **not** apply when invoked directly:
68+
69+
| Behavior | `spice run` | `spiced` |
70+
| --------------------------- | ----------------------------------------------------------- | --------------------------------------------------- |
71+
| Runtime installation | Auto-installs `spiced` if missing | Must already be installed |
72+
| Pods watcher | Enabled (`--pods-watcher-enabled`) | Disabled by default |
73+
| Task history captured output | Forced to `truncated` via `--set-runtime` | Uses the Spicepod value (default: `full`) |
74+
| `--endpoint` scheme routing | Supported — `http://…` sets HTTP, `grpc://…` sets Flight | Not supported — use `--http` and `--flight` directly |
75+
76+
Operators running `spiced` directly who want `spice run`-equivalent behavior should pass `--pods-watcher-enabled` and, if desired, `--set-runtime task_history.captured_output=truncated`.
77+
78+
### Examples
79+
80+
#### Start the runtime with a Spicepod in the current directory
81+
82+
```shell
83+
spiced
84+
```
85+
86+
#### Bind the HTTP and Flight servers to all interfaces
87+
88+
```shell
89+
spiced --http 0.0.0.0:8090 --flight 0.0.0.0:50051
90+
```
91+
92+
#### Enable Prometheus metrics
93+
94+
```shell
95+
spiced --metrics 0.0.0.0:9090
96+
```
97+
98+
#### Enable TLS
99+
100+
```shell
101+
spiced --tls-enabled \
102+
--tls-certificate-file /path/to/cert.pem \
103+
--tls-key-file /path/to/key.pem
104+
```
105+
106+
#### Run as a cluster executor
107+
108+
```shell
109+
spiced --role executor \
110+
--scheduler-address https://scheduler.example.internal:50052 \
111+
--node-advertise-address executor-1.example.internal \
112+
--node-mtls-ca-certificate-file /etc/spice/ca.pem \
113+
--node-mtls-certificate-file /etc/spice/node.pem \
114+
--node-mtls-key-file /etc/spice/node.key
115+
```
116+
117+
#### Override runtime configuration at launch
118+
119+
```shell
120+
spiced --set-runtime task_history.captured_output=none \
121+
--set-runtime results_cache.enabled=false
122+
```

0 commit comments

Comments
 (0)