Skip to main content
Python 3.11+ on Linux, macOS, or Windows. Tables, computed columns, and endpoints live in one file. When you insert a row, computed columns run automatically.

Install

[serve] pulls in FastAPI and uvicorn, which pxt service needs. Skip [serve] and pxt service update if you insert from Python; pip install pixeltable is enough. pxt schema example --brief writes models only. Self-hosting.

Write the file, create tables, start the endpoints

1

Write the file

pxt service example writes a working application file: models and a FastAPIRouter in one place.
pxt service example writes this application file.
title: pxt.String is a value you insert. title_upper = ... is computed on insert and on update. id is a uuid7() primary key: filled on insert, required for pxt get and the errors view. The same file can hold pxt.Image, pxt.Video, pxt.Audio, or pxt.Document: media pipelines, RAG.
2

Create tables, then start the endpoints

pxt init marks this directory as a project root. pxt schema update errors if you have not run it in this directory or a parent. my_app, the last argument, is a catalog inside Pixeltable, not a folder beside app.py. pxt schema update creates that catalog and its tables. It does not start the endpoints. Run it before pxt service update, which starts the endpoints and does not create tables.
3

Insert a row

Send a row with HTTP POST. Pixeltable computes title_upper during that insert. pxt service list prints the URL (the port is assigned):

The CLI

pxt ships with the package. The first pxt schema or pxt service command starts a background process on 127.0.0.1:22089, and that process keeps running after you close the terminal. pxt health confirms it. pxt schema and pxt service both have diff, update, and prune subcommands. Full flags: CLI. Tables live under ~/.pixeltable (pgdata, media, file_cache). That path is not the project directory. Project layout and pixeltable.toml: Infrastructure.

Same file, other first runs

To run this same file on Pixeltable Cloud, create an API key in the Cloud dashboard, set PIXELTABLE_API_KEY, create the hosted database with pxt db update, create tables with pxt schema update, then start hosted endpoints with pxt service update. Try changes by inserting from the dashboard and running pxt schema diff.
Deploy to Pixeltable Cloud.
This quickstart uses a TableModel in app.py and creates the tables with pxt schema update. Notebooks and tests can still call pxt.create_table(), add_computed_column(), and add_embedding_index(). The skill writes that TableModel. If the agent writes create_table in app code, names the file schema.py, or writes the removed command pxt serve, the installed skill is stale: this page wins. Reinstall: npx skills add pixeltable/pixeltable-skill.

Next

How it works

What pxt schema and pxt service do, including diff, update, and prune.

Cloud

The same app.py. pxt db update, then pxt schema update and pxt service update against pxt://org:mydb.
Last modified on September 16, 2026