Spice.ai Cookbook - Recipes for Data and AI Apps | Spice AI

🧑‍🍳 Spice.ai Cookbook

78 guides and samples to help you build data-grounded AI apps and agents with Spice.ai Open-Source. Find ready-to-use examples for data acceleration, AI agents, LLM memory, and more.

Featured Recipes

Most popular cookbook recipes for SQL federation, local models, acceleration, and LLM memory.

Federated SQL Query

Join S3, PostgreSQL, and Dremio data in one SQL query.

View recipe

Run Llama3 Locally

Use Llama models from HuggingFace with Spice. Includes video walkthrough.

View recipe Watch video

Data Acceleration with DuckDB

Speed up queries using DuckDB. Includes video walkthrough.

View recipe Watch video

Core Features

Discover core capabilities like data federation, acceleration, search, and LLM inference to enhance your applications.

Federated SQL Query

Query data from S3, PostgreSQL, and Dremio in a single query.

View recipe

OpenAI SDK

Use the OpenAI SDK to connect to models hosted on Spice.

View recipe

AI SQL Function

Invoke LLMs directly within SQL queries using the AI SQL function.

View recipe

DuckDB Data Accelerator

Accelerate data locally using DuckDB. Includes video walkthrough.

View recipe Watch video

Amazon S3 Vectors Search

Use Amazon S3 Vectors to store embeddings and run efficient vector search. Includes video walkthrough.

View recipe Watch video

Spice Cayenne Data Accelerator

Accelerate data locally using the Spice Cayenne Data Accelerator.

View recipe

Models, AI, and Agents

Integrate with popular AI models, LLMs, and build intelligent agents using Spice.ai.

Azure OpenAI Models

Connect and use Azure OpenAI models with Spice.

View recipe

Running Llama3 Locally

Use the Llama family of models locally from HuggingFace using Spice. Includes video walkthrough.

View recipe Watch video

OpenAI SDK

Use the OpenAI SDK to connect to models hosted on Spice.

View recipe

OpenAI Responses API

Use the OpenAI Responses API with Spice.

View recipe

OpenAI Models

Use OpenAI LLM and embedding models in Spice.

View recipe

LLM Memory

Persistent memory for language models.

View recipe Watch video

Text to SQL (NSQL)

Ask natural language (NLP) questions of your datasets using the built-in text-to-SQL tool.

View recipe

AI SQL Function

Invoke LLMs directly within SQL queries using the AI SQL function.

View recipe

Generative Visualizations

Generate SQL queries and Chart.js visualizations from natural language using AI.

View recipe

Nvidia NIM on Kubernetes

Deploy Nvidia NIM infrastructure on Kubernetes with GPUs connected to Spice.

View recipe

Nvidia NIM on AWS EC2

Deploy Nvidia NIM on AWS GPU-optimized EC2 instances connected to Spice.

View recipe

Searching GitHub Files

Search GitHub files with embeddings and vector similarity search. Includes video walkthrough.

View recipe Watch video

Hybrid-Search with RRF

Combine multiple search methods using Reciprocal Rank Fusion (RRF) for improved search results.

View recipe

xAI Models

Use xAI models such as Grok. Includes video walkthrough.

View recipe Watch video

DeepSeek Model

Use DeepSeek model through Spice.

View recipe

Filesystem Hosted Model

Use models hosted directly on filesystems.

View recipe

Web Search Tools using Perplexity

Provide LLMs with web search access for more informed answers.

View recipe

Language Model Evaluations

Use Spice to evaluate language models.

View recipe

LLM as a Judge

Define LLM judge models to evaluate the performance of other language models.

View recipe

Model-Context-Protocol (MCP)

Use Spice to connect to or host MCP servers.

View recipe

Amazon S3 Vectors

Use Amazon S3 Vectors to store embeddings and perform efficient vector search. Includes video walkthrough.

View recipe Watch video

Data Acceleration, Materialization, and Federation

Optimize query performance with local acceleration, data materialization, and federation techniques.

DuckDB Data Accelerator

Accelerate data locally using DuckDB. Includes video walkthrough.

View recipe Watch video

PostgreSQL Data Accelerator

Accelerate data locally using PostgreSQL.

View recipe

SQLite Data Accelerator

Accelerate data locally using SQLite.

View recipe

Apache Arrow Data Accelerator

Accelerate data using Apache Arrow.

View recipe

Hashed Partitioning with DuckDB

Use hashed partitioning for performance with DuckDB.

View recipe

Dataset Partitioning

Partition accelerated datasets to improve query performance.

View recipe

Database Snapshots

Bootstrap DuckDB accelerations from object storage to skip cold starts.

View recipe

Accelerated Views

Use view materialization for improved performance.

View recipe

Indexes on Accelerated Data

Create and manage indexes on accelerated data.

View recipe

Search & Embeddings

Implement advanced search capabilities and leverage embeddings for vector similarity search.

Searching GitHub Files

Search GitHub files with embeddings and vector similarity search. Includes video walkthrough.

View recipe Watch video

Hybrid-Search with RRF

Combine multiple search methods using Reciprocal Rank Fusion (RRF) for improved search results.

View recipe

Amazon S3 Vectors

Use Amazon S3 Vectors to store embeddings and perform efficient vector search. Includes video walkthrough.

View recipe Watch video

Data Connectors

Connect to various data sources and systems to query, analyze, and manage your data efficiently.

PostgreSQL Connector

Connect to and query PostgreSQL databases.

View recipe

AWS RDS PostgreSQL

Connect to AWS RDS PostgreSQL instances.

View recipe

Supabase PostgreSQL

Connect to Supabase PostgreSQL databases.

View recipe

MySQL Connector

Connect to and query MySQL databases.

View recipe

AWS RDS Aurora MySQL

Connect to AWS RDS Aurora with MySQL compatibility.

View recipe

PlanetScale MySQL

Connect to PlanetScale MySQL databases.

View recipe

Clickhouse Connector

Connect to and query Clickhouse databases.

View recipe

Databricks Connector

Connect to and query Databricks instances using Delta Lake or Spark Connect.

View recipe

Delta Lake Connector

Query data from Delta Lake tables.

View recipe

Debezium CDC from Postgres

Stream changes from PostgreSQL using Debezium CDC.

View recipe

Debezium CDC with SASL/SCRAM

Stream MySQL changes using Debezium with SASL/SCRAM authentication.

View recipe

Dremio Connector

Connect to and query Dremio.

View recipe

DuckDB Connector

Query DuckDB databases with sample TPCH data.

View recipe

File Connector

Query data from local files.

View recipe

FTP Connector

Query data from FTP servers.

View recipe

GitHub Connector

Connect to and query GitHub data. Includes video walkthrough.

View recipe Watch video

GraphQL Connector

Query data from GraphQL endpoints.

View recipe

HTTP Connector

Query data from HTTP(s) endpoints like REST APIs.

View recipe

MSSQL Connector

Connect to Microsoft SQL Server databases.

View recipe

ODBC Connector

Connect to databases using ODBC.

View recipe

Redshift Connector

Read and write TPC-H data with Amazon Redshift.

View recipe

Oracle Connector

Connect to and query Oracle databases.

View recipe

Glue Connector

Connect to AWS Glue.

View recipe

S3 Connector

Query data from S3 compatible storage.

View recipe

ScyllaDB Connector

Query data from ScyllaDB clusters using federated SQL.

View recipe

SharePoint Connector

Connect to SharePoint and OneDrive for Business.

View recipe

SMB Connector

Query data files from SMB/CIFS network shares.

View recipe

Snowflake Connector

Connect to and query Snowflake databases.

View recipe

Spice.ai Cloud Connector

Connect to the Spice.ai Cloud Platform.

View recipe

Apache Spark Connector

Connect to and query Apache Spark.

View recipe

IMAP Emails

Federated SQL query of mail across IMAP email servers.

View recipe

IMAP Outlook Mailbox

Connect Spice to an Outlook mailbox via IMAP.

View recipe

MongoDB Connector

Connect to and query MongoDB databases.

View recipe

Live Orders Analytics with Apache Kafka Data Connector

Combine real-time data streaming from Kafka with other datasets using Spice.

View recipe

Catalog Connectors

Connect to data catalogs to discover, manage, and utilize your data assets effectively.

Spice.ai Cloud Platform Catalog

Connect to the Spice.ai Cloud Platform catalog.

View recipe

Databricks Unity Catalog

Connect to Databricks Unity catalog.

View recipe

Unity Catalog

Connect to Unity catalog.

View recipe

Iceberg Catalog Connector

Connect to Iceberg catalog with support for reading and writing Iceberg tables.

View recipe

Glue Catalog Connector

Connect to AWS Glue Catalog.

View recipe

Visualization

Visualize data with BI and analytics tools.

Sales BI with Apache Superset

Visualize data in Spice with Apache Superset.

View recipe

Grafana Datasource

Add Spice as a Grafana datasource.

View recipe

API Clients

Use API clients for data access and integration.

Python ADBC Client

Query Spice using ADBC and Parameterized Queries with Python.

View recipe

Java JDBC Client

Query Spice.ai using the Java JDBC client.

View recipe

Scala JDBC Client

Query Spice.ai using the Scala JDBC client.

View recipe

Deployment

Deploy Spice.ai in different environments.

Deploying to Kubernetes

Deploy Spice.ai on Kubernetes.

View recipe

Running in Docker

Run Spice.ai in Docker containers.

View recipe

Sidecar Deployment Architecture

Deploy Spice as a sidecar alongside your application.

View recipe

Microservice Deployment Architecture

Deploy Spice as a standalone microservice architecture.

View recipe

Advanced Topics

Explore advanced deployment and data architecture patterns for production workloads.

Local Dataset Replication

Link datasets in a parent/child relationship within the current Spicepod.

View recipe

Distributed Query

Run queries distributed across multiple nodes for large datasets.

View recipe

Performance and Benchmarking

Measure and optimize performance with benchmarks and best practices for your Spice.ai deployment.

TPC-H Benchmarking

Benchmark performance using TPC-H.

View recipe

Results Caching

Cache query results for improved performance.

View recipe

Caching Accelerator

Use intelligent HTTP response caching with stale-while-revalidate (SWR).

View recipe

Indexes on Accelerated Data

Create and manage indexes on accelerated data.

View recipe

Configuration

Fine-tune your Spice.ai deployment with advanced configuration options for optimal performance.

Data Retention Policy

Configure data retention policies.

View recipe

Refresh Data Window

Configure data refresh windows.

View recipe

Advanced Data Refresh

Advanced configuration for data refresh.

View recipe

Data Quality with Constraints

Add data quality constraints.

View recipe

Cron Dataset Schedules

Schedule dataset refreshes using cron syntax.

View recipe

SDKs

Use SDKs for different programming languages.

OpenAI SDK

Use the OpenAI SDK to connect to models hosted on Spice.

View recipe

Rust SDK

Query Spice.ai using the Rust SDK.

View recipe

Python SDK

Query Spice.ai using the Python SDK.

View recipe

Go SDK

Query Spice.ai using the Go SDK.

View recipe

Spice.js JavaScript (Node.js) SDK

Query Spice.ai using the JavaScript (Node.js) SDK with examples.

View recipe

Java SDK

Query Spice.ai using the Java SDK.

View recipe

Security

Secure your Spice.ai deployment and data access with robust security practices and configurations.

Intelligent Security Copilot

Analyze real-time data access patterns with Spice.ai.

View recipe

TLS Encryption

Enable encryption in transit using TLS.

View recipe

API Key Authentication

Secure access with API key authentication.

View recipe

FAQs

Common questions about using the Spice.ai OSS Cookbook and choosing the right recipe to start with.

What is the Spice.ai OSS Cookbook?

The cookbook is a curated set of practical, ready-to-run recipes for Spice.ai Open Source. Recipes cover connectors, federation, acceleration, hybrid search, model integration, and deployment patterns.

Which recipe should I start with?

If you are new to Spice, start with a recipe that matches your immediate goal: federated SQL for multi-source queries, DuckDB acceleration for faster performance, or OpenAI SDK and MCP recipes for AI agent use cases.

Do cookbook recipes work with Spice Cloud?

Yes. Cookbook patterns are based on Spice OSS capabilities and can be adapted to Spice Cloud workflows. You can start locally with OSS and move to managed deployments as workloads grow. See Spice Cloud pricing.

Build faster with Spice

See how teams use Spice to turn cookbook patterns into production data and AI applications.