Pixeltable is open-source data infrastructure for AI. It replaces the patchwork of blob storage, metadata DBs, vector stores, media processing, orchestration, and glue code with a single declarative system. Tables, computed columns, and embedding indexes handle what typically requires stitching together S3, Postgres, Pinecone, FFmpeg, HuggingFace, Airflow, LangChain, and custom scripts to wire them all together.
This starter kit demonstrates three ways to integrate Pixeltable into your stack, plus seven ready-to-scaffold application templates. Tested against Pixeltable 0.6.5 (pixeltable>=0.6.5). Use the pxt CLI for catalog operations and pxt serve for declarative API routes.
Fastest path:
uvx pixeltable-new --template full-stack-showcase myappβcd myapp && uv sync && python app.py
Pick the integration mode that matches your workload:
| Question | Pattern | Folder |
|---|---|---|
| I need a custom API (with optional UI) | API Backend: FastAPI + Pixeltable | backend/ |
| I need batch/background processing (cron, queue, Cloud Run Job) | Batch Processing: pure Python script, no HTTP server | batch/ |
| I want an API with zero web code | Declarative Serving: pxt serve generates routes from TOML |
serving/ |
Pixeltable itself is not an HTTP framework β it's a data engine. The starter kit wraps it in FastAPI where a demo UI is useful, but if your workload is batch processing, you don't need FastAPI at all. batch/ is a plain Python script that inserts data, lets computed columns process it, exports results, and exits.
# ββ Structural Patterns ββββββββββββββββββββββββββββββββββββββ
backend/ FastAPI API (+ reference React UI via frontend/)
serving/ Declarative API from TOML config (pxt serve)
batch/ Batch processing script, no HTTP server
# ββ Application Templates βββββββββββββββββββββββββββββββββββββ
templates/
βββ knowledge-base/ app.py + UI: docs, images, video, audio search
βββ chat-agent/ app.py + UI: persistent agent with memory + tools
βββ audio-transcription/ app.py + UI: transcription, summarization, search
βββ full-stack-showcase/ app.py + React: Gemini, DETR, Whisper, dashboard
βββ video-search/ pxt serve: frames, transcription, detection
βββ media-indexing/ pxt serve + batch: S3 ingest, multi-modal, export
βββ image-dataset/ pxt serve + batch: auto-annotate, curate, export
# ββ Shared βββββββββββββββββββββββββββββββββββββββββββββββββββ
frontend/ React UI for the backend/ pattern
deploy/ Platform deploy configs β deploy/README.md
FastAPI + Pixeltable demonstrating three interactive features via API endpoints: Data (multimodal upload with automatic processing), Search (cross-modal similarity), and Agent (tool-calling pipeline wired as 11 computed columns). This monorepo includes a reference frontend/ for development; uvx pixeltable-new --backend scaffolds the API only. For a full-stack app with UI, use an application template.
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#ffffff', 'primaryTextColor': '#0f172a', 'primaryBorderColor': '#334155', 'lineColor': '#ffffff', 'arrowheadColor': '#ffffff', 'secondaryColor': '#f8fafc', 'tertiaryColor': '#f1f5f9', 'clusterBkg': '#f8fafc', 'clusterBorder': '#94a3b8', 'fontSize': '14px'}}}%%
graph TD
subgraph Frontend["Frontend Β· React + TypeScript"]
D["<b>Data</b><br/>upload docs, images, videos"]
S["<b>Search</b><br/>cross-modal similarity"]
A["<b>Agent</b><br/>AI chat with tools"]
end
API["<b>FastAPI</b>"]
subgraph PXT["Pixeltable: storage Β· orchestration Β· retrieval"]
Tables["<b>Tables</b><br/>documents Β· images Β· videos Β· chat Β· agent"]
Views["<b>Views & Iterators</b><br/>chunks Β· keyframes Β· transcripts"]
CC["<b>Computed Columns</b> Β· @pxt.udf<br/>thumbnails Β· transcription Β· embeddings"]
EI["<b>Embedding Indexes</b> Β· @pxt.query<br/>sentence-transformers Β· CLIP"]
AP["<b>Agent Pipeline</b><br/>11 computed columns<br/>tools β RAG β answer"]
end
D & S & A --> API
API --> Tables
Tables --> Views --> CC --> EI
Tables --> AP
AP -.->|"@pxt.query"| EI
Prerequisites: Python 3.10+, Node.js 18+, uv. Or open in a Dev Container.
git clone https://github.com/pixeltable/pixeltable-starter-kit.git
cd pixeltable-starter-kit
cp .env.example .env # ANTHROPIC_API_KEY, OPENAI_API_KEY
cd backend && uv sync && python main.py # http://localhost:8000 (schema auto-inits)
# Frontend (new terminal)
cd frontend && npm install && npm run dev # http://localhost:5173main.py imports the schema on startup β no separate init step required. To wipe and recreate: RESET_SCHEMA=true python setup_pixeltable.py in backend/.
Production: cd frontend && npm run build then cd ../backend && python main.py β serves UI + API on :8000.
Deploy: Docker Compose, Fly, Render, Railway, Helm, Terraform, CDK β see deploy/README.md.
A Python script that ingests data, lets computed columns process it, exports results to a serving DB via export_sql, and exits. No HTTP server, no FastAPI. Run it as a Cloud Run Job, ECS Task, K8s Job, Lambda, or a cron'd container.
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#ffffff', 'primaryTextColor': '#0f172a', 'primaryBorderColor': '#334155', 'lineColor': '#ffffff', 'arrowheadColor': '#ffffff', 'secondaryColor': '#f8fafc', 'tertiaryColor': '#f1f5f9', 'clusterBkg': '#f8fafc', 'clusterBorder': '#94a3b8', 'fontSize': '14px'}}}%%
graph TD
Trigger["<b>Cron Β· Queue Β· Webhook</b><br/>Cloud Scheduler Β· SQS Β· Pub/Sub"]
subgraph Container["Ephemeral Container Β· Pixeltable"]
Schema["<b>Create Schema</b><br/>tables + computed columns"]
Ingest["<b>Ingest</b><br/>text + media from queue, RDBMS, or S3"]
Process["<b>Computed Columns</b> + @pxt.udf<br/>thumbnails Β· transcription Β· embeddings"]
end
SQL["<b>Serving DB</b> Β· export_sql<br/>Postgres Β· MySQL Β· Snowflake"]
Bucket["<b>Cloud Bucket</b> Β· destination<br/>S3 Β· GCS Β· Azure Blob"]
Trigger --> Schema --> Ingest --> Process
Process -->|"structured data"| SQL
Process -->|"generated media"| Bucket
cd batch && uv sync
PIXELTABLE_HOME=/tmp/pxt uv run python pipeline.pyReady-to-use configs in batch/deploy/:
| Platform | Config | Runtime | Best for |
|---|---|---|---|
| Cloud Run Jobs | cloudbuild.yaml |
Up to 24h | GCP, cron/Pub/Sub triggers |
| Kubernetes Job | job.yaml, cronjob.yaml, keda-scaledjob.yaml |
Unlimited | Any K8s, queue-driven scaling |
| ECS Fargate | task-definition.json |
Unlimited | AWS, Spot pricing (~70% cheaper) |
| Lambda | Dockerfile, handler.py |
Up to 15 min | Small batches, event-driven |
See batch/README.md for full details.
Define your schema in Python, your routes in TOML, and run pxt serve. Pixeltable generates a complete API with no routers, no Pydantic models, no endpoint handlers.
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#ffffff', 'primaryTextColor': '#0f172a', 'primaryBorderColor': '#334155', 'lineColor': '#ffffff', 'arrowheadColor': '#ffffff', 'secondaryColor': '#f8fafc', 'tertiaryColor': '#f1f5f9', 'clusterBkg': '#f8fafc', 'clusterBorder': '#94a3b8', 'fontSize': '14px'}}}%%
graph TD
Schema["<b>schema.py</b><br/>tables Β· views Β· indexes Β· @pxt.query"]
TOML["<b>pyproject.toml</b><br/>[tool.pixeltable] routes"]
Serve["<b>pxt serve</b>"]
API["<b>REST API</b><br/>auto-generated Β· OpenAPI docs"]
Schema --> Serve
TOML --> Serve
Serve --> API
cd serving && uv sync
uv run python schema.py && uv run pxt serve pipeline # http://localhost:8000/docsSee serving/README.md and serving/deploy/pixeltable-cloud/ for Pixeltable Cloud deployment notes.
Scaffold a ready-to-run app with pixeltable-new (no install required β uvx runs it directly):
uvx pixeltable-new --template <name> my-app
cd my-app && uv syncapp.py templates β run python app.py (schema init is automatic). pxt-serve templates β run python schema.py then pxt serve <name>. Run uvx pixeltable-new --list for all options.
| Template | Entry point | What you get |
|---|---|---|
knowledge-base |
python app.py |
Multimodal upload, search, RAG Q&A. Web UI |
chat-agent |
python app.py |
Persistent agent, memory, tools (MCP-ready). Web UI |
audio-transcription |
python app.py |
Transcription, summarization, search. Web UI |
full-stack-showcase |
python app.py |
Gemini + DETR + Whisper, React UI, dashboard |
video-search |
pxt serve videointel |
Frames, transcription, detection, search. API only |
media-indexing |
pxt serve pipeline |
S3 ingest, multi-modal processing, DB export |
image-dataset |
pxt serve datalab |
Auto-annotate, curate, version, export |
| Target | Guide |
|---|---|
| Docker Compose, Fly, Render, Railway, Helm, Terraform, CDK, Vercel | deploy/README.md |
| Batch jobs (Cloud Run, K8s, ECS, Lambda) | batch/deploy/ |
All production deploys need persistent storage for PIXELTABLE_HOME.
Default models use Anthropic (agent) and OpenAI (transcription); embeddings run locally via HuggingFace. Pixeltable supports 20+ providers. To swap, update computed columns in backend/setup_pixeltable.py or your template's schema.py. See LLM tool calling.
- Building with LLMs Β· llms.txt
- MCP Server Β· Claude Code Skill
- AGENTS.md β architecture guide for this repo
Open in VS Code Dev Containers or GitHub Codespaces. Auto-installs Python 3.12, Node 20, uv, and dependencies. VS Code: Dev Containers: Reopen in Container.
Pixeltable Docs Β· 10-Minute Tour Β· Cookbooks
Use cases: ML Data Wrangling Β· Backend for AI Apps Β· Agents & MCP
Migrating from: DIY Pipelines Β· RDBMS & Vector DBs Β· Agent Frameworks
Apache 2.0