内容摘录
<picture class="github-only">
<source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/e9bf82b2-cace-4bd8-9523-b65495eb8131">
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/c5ab123e-806c-49bf-93e7-151353719b16">
<img alt="Pixeltable Logo" src="https://github.com/user-attachments/assets/e9bf82b2-cace-4bd8-9523-b65495eb8131" width="40%">
</picture>
<div>
<br>
</div>
The only open source Python library providing declarative data infrastructure for building multimodal AI applications, enabling incremental storage, transformation, indexing, retrieval, and orchestration of data.
License
tests status
nightly status
stress-tests status
PyPI Package
My Discord (1306431018890166272)
**Quick Start** |
**Documentation** |
**API Reference** |
**Sample Apps** |
**Discord Community**
---
Installation
Pixeltable replaces the complex multi-system architecture needed for AI applications with a single declarative table interface that natively handles multimodal data like images, videos, and documents.
Demo
https://github.com/user-attachments/assets/b50fd6df-5169-4881-9dbe-1b6e5d06cede
Quick Start
With Pixeltable, you define your *entire* data processing and AI workflow declaratively using
**computed columns** on
**tables**.
Focus on your application logic, not the data plumbing.
What Pixeltable Handles
When you run the code above, Pixeltable automatically handles data storage, transformation, AI inference, vector indexing, incremental updates, and versioning. See Key Principles for details.
| You Write | Pixeltable Does |
|-----------|-----------------|
| pxt.Image, pxt.Video, pxt.Document columns | Stores media, handles formats, caches from URLs |
| add_computed_column(fn(...)) | Runs incrementally, caches results, retries failures |
| add_embedding_index(column) | Manages vector storage, keeps index in sync |
| @pxt.udf / @pxt.query | Creates reusable functions with dependency tracking |
| table.insert(...) | Triggers all dependent computations automatically |
| table.select(...).collect() | Returns structured + unstructured data together |
| *(nothing—it's automatic)* | Versions all data and schema changes for time-travel |
**Deployment options:** Pixeltable can serve as your full backend (managing media locally or syncing with S3/GCS/Azure, plus built-in vector search and orchestration) or as an orchestration layer alongside your existing infrastructure.
Where Did My Data Go?
Pixeltable workloads generate various outputs, including both structured outputs (such as bounding boxes for detected objects) and unstructured outputs (such as generated images or video). By default, everything resides in your Pixeltable user directory at ~/.pixeltable. Structured data is stored in a Postgres instance in ~/.pixeltable. Generated media (images, video, audio, documents) are stored outside the Postgres database, in separate flat files in ~/.pixeltable/media. Those media files are referenced by URL in the database, and Pixeltable provides the "glue" for a unified table interface over both structured and unstructured data.
In general, the user is not expected to interact directly with the data in ~/.pixeltable; the data store is fully managed by Pixeltable and is intended to be accessed through the Pixeltable Python SDK.
See Working with External Files for details on loading data from URLs, S3, and local paths.
Key Principles
<details>
<summary><b>Store:</b> Unified Multimodal Interface</summary>
<br>
pxt.Image, pxt.Video, pxt.Audio, pxt.Document, pxt.Json – manage diverse data consistently.
→ Type System · Tables & Data
</details>
<details>
<summary><b>Orchestrate:</b> Declarative Computed Columns</summary>
<br>
Define processing steps once; they run automatically on new/updated data. Supports **API calls** (OpenAI, Anthropic, Gemini), **local inference** (Hugging Face, YOLOX, Whisper), **vision models**, and any Python logic.
→ Computed Columns · AI Integrations · Sample App: Prompt Studio
</details>
<details>
<summary><b>Iterate:</b> Explode & Process Media</summary>
<br>
Create views with iterators to explode one row into many (video→frames, doc→chunks, audio→segments).
→ Views · Iterators · RAG Pipeline
</details>
<details>
<summary><b>Index:</b> Built-in Vector Search</summary>
<br>
Add embedding indexes and perform similarity searches directly on tables/views.
→ Embedding Indexes · Semantic Search · Image Search App
</details>
<details>
<summary><b>Extend:</b> Bring Your Own Code</summary>
<br>
Extend Pixeltable with UDFs, reusable queries, batch processing, and custom aggregators.
→ UDFs Guide · Custom Aggregates
</details>
<details>
<summary><b>Agents & Tools:</b> Tool Calling & MCP Integration</summary>
<br>
Register @pxt.udf, @pxt.query functions, or **MCP servers** as callable tools. LLMs decide which tool to invoke; Pixeltable executes and stores results.
→ Tool Calling Cookbook · Agents & MCP · Pixelbot · Pixelagent
</details>
<details>
<summary><b>Query & Experiment:</b> SQL-like Python Querying</summary>
<br>
Familiar syntax combined with powerful AI capabilities. **Test transformations before committing:**
→ Queries & Expressions · Iterative Development
</details>
<details>
<summary><b>Version:</b> Data Persistence & Time Travel</summary>
<br>
All data is automatically stored and versioned. Query any prior version.
→ Version Control · Data Sharing
</details>
<details>
<summary><b>Import/Export:</b> I/O & Integration</summary>
<br>
Import from any source and export to ML formats.
→ Data Import · PyTorch Export · Label Studio · Data Wrangling for ML
</details>
Tutorials & Cookbooks
| Fundamentals | Cookbooks | Providers | Sample Apps |
|:-------------|:----------|:----------|:------------|
| Colab | Colab | OpenAI | Gradio |
| Colab | Colab | Anthropic | GitHub |
| Colab | Colab | Gemini | Discord |
| Colab | Colab | Ollama | Terminal |
| **All →** | **All →** | **All →*…