Run a Spice.ai cookbook recipe to completion by following its README instructions. Use this skill whenever the user wants to test, run, verify, or execute a cookbook recipe — e.g., "run the kafka recipe", "test the localpod recipe", "try out the ai recipe", "does the duckdb connector recipe work?". Also trigger when the user asks to validate, smoke-test, or QA any recipe in this repository, run all recipes, or check which recipes are locally runnable.
You are executing a Spice.ai cookbook recipe end-to-end by following its README.
Each recipe in this cookbook is a self-contained demo in its own directory with a
spicepod.yaml (Spice config) and README.md (step-by-step instructions). Your
job is to follow the README exactly, verify each step produces the expected output,
and report the result.
Determine which recipe to run. The user will name it or you can find it:
# List all recipes
find . -name spicepod.yaml -maxdepth 3 | sort
If the recipe name is ambiguous, ask the user to clarify.
When asked to run "all recipes" or "all locally runnable recipes", triage by checking each recipe directory for:
compose.yaml, docker-compose.yml, or Makefile with
docker commands. Skip if Docker is not running.${secrets:...} in spicepod.yaml or .env.example
files. Skip unless a .env with the required keys already exists.from: URIs like postgres:, mysql:, mongodb:,
clickhouse:, mssql:, dynamodb: etc. require running database servers.Recipes that use only these data sources are locally runnable:
file: or file:// (local files)s3://spiceai-public-datasets/ or s3://spiceai-demo-datasets/ (public S3)duckdb: with a local .db filelocalpod: (references another local dataset)https:// public APIs (e.g., TVMaze)Run locally runnable recipes sequentially, cleaning up between each one. Use tasks to track progress and report a summary table at the end.
Read the recipe's README.md in full. Before executing anything, identify:
duckdb), API keysdocker compose up or make? Check for
compose.yaml, docker-compose.yml, or Makefile in the recipe directory..env files or API keys? Check for .env.example.Before running anything:
Spice CLI -- verify spice is installed: spice version. If not, install:
curl https://install.spiceai.org | /bin/bash
Docker -- if the recipe has a compose.yaml / docker-compose.yml / Makefile,
verify Docker is running: docker info > /dev/null 2>&1
Secrets -- if the recipe needs API keys (check .env.example or README for
SPICE_OPENAI_API_KEY, OPENAI_API_KEY, GITHUB_TOKEN, etc.), check if a .env
file already exists in the recipe directory. If not, ask the user to provide the
required keys before proceeding. Do NOT skip steps that need secrets without
telling the user.
External tools -- if the README requires tools like duckdb, psql, mysql,
etc., verify they're installed.
Port conflicts -- check if Spice's ports are free:
lsof -i :50051 -i :8090 -i :9090 2>/dev/null | grep LISTEN
If port 8090 is occupied (common with VS Code, dev servers, etc.), don't try to
kill the process. Instead, use spiced directly with an alternate HTTP port
(see "Starting Spice runtime" below). Ports 50051 (Flight) and 9090 (metrics)
are less commonly conflicted.
Clean stale acceleration data -- previous runs may have left DuckDB/SQLite
files in nested .spice/ subdirectories that cause schema mismatch errors.
Clean them recursively (the glob *.db misses nested paths like
.spice/data/accelerated_duckdb.db):
find .spice -name '*.db' -delete 2>/dev/null
Follow the README instructions in order. Key patterns:
cd <recipe-dir>
docker compose up -d # or: make
Wait for services to be healthy before proceeding.
If port 8090 is free, use the standard approach:
cd <recipe-dir>
spice run &>/tmp/spice_<recipe>.log &
If port 8090 is occupied, use spiced directly with an alternate HTTP port.
This is the most reliable approach and avoids port conflicts entirely:
cd <recipe-dir>
~/.spice/bin/spiced --http 127.0.0.1:8091 &>/tmp/spice_<recipe>.log &
Always redirect output to a log file so you can inspect it. Wait for readiness by checking the log for key markers:
Spice Runtime Flight listening on 127.0.0.1:50051 -- Flight endpoint readyDataset <name> registered -- datasets being configuredLoaded N rows -- acceleration data loadedAll components are loaded. Spice runtime is ready! -- fully readyGive it 5-10 seconds for simple recipes, longer for recipes that load large datasets from S3 (millions of rows can take 10-60+ seconds).
Note: Hot-reload of spicepod.yaml only works with spice run, not with
spiced directly. If a recipe requires editing spicepod.yaml mid-run (like
sqlite/accelerator), either use spice run or restart spiced after the edit.
For recipes that accelerate large datasets, monitor loading progress rather than blindly sleeping:
# Check the log for completion
grep "Loaded\|All components\|Failed" /tmp/spice_<recipe>.log
For long-running loads (S3 datasets with millions of rows), use the Monitor tool or check the log periodically. Typical load times:
Pipe queries directly rather than using the interactive REPL:
echo "SELECT COUNT(*) FROM my_table;" | spice sql
This avoids interactive mode issues and captures output cleanly.
If the recipe uses API key authentication, pass the key:
echo "SELECT 1;" | spice sql --api-key <key>
Some recipes have generate_data.sh or similar scripts. Run them as documented.
The README shows expected output for each step. How to compare:
External data sources (especially GitHub, S3) may return transient errors like 502 Bad Gateway or rate limit warnings. The Spice runtime automatically retries these. Wait for the retry rather than reporting immediate failure. Only report failure if the dataset never loads after 2-3 minutes of retries.
GitHub-specific: rate limit warnings during comment fetching are normal and
expected. The pulls dataset with github_include_comments can take 1-3 minutes
to load due to per-PR comment fetching with rate limits.
After the recipe completes (pass or fail):
pkill -f spiceddocker compose down (from recipe dir).env files you created (not ones that already existed)spicepod.yaml, restore the original content.Summarize what happened:
PASSED: All README steps executed successfully and output matched expectations. List the key verifications (e.g., "queried 1000 rows from time_series", "AI function returned sentiment analysis").
FAILED: Describe exactly which step failed, what the expected output was, and what actually happened. Include the error message or unexpected output.
SKIPPED: If a prerequisite was missing (e.g., no Docker, no API key) and the user chose not to provide it, note which steps were skipped and why.
For batch runs, report a summary table:
| Recipe | Status | Key Verification |
|--------|--------|-----------------|
| localpod | PASSED | Both datasets loaded 1000 rows |
| github | FAILED | 401 Unauthorized - token expired |
spice run hangs or a query takes more than 60
seconds, that's likely a failure. Exception: large dataset loads from S3 can
legitimately take 1-2 minutes.pkill -f spiced between recipes to
avoid port conflicts.