Skip to main content
Open in Kaggle  Open in Colab  Download Notebook
This documentation page is also available as an interactive notebook. You can launch the notebook in Kaggle or Colab, or download it for use with an IDE or local Jupyter installation, by clicking one of the above links.
Automatically translate content into multiple languages using LLMs.

Problem

You have content that needs to be available in multiple languages—product descriptions, documentation, user-generated content. Manual translation is slow and expensive.

Solution

What’s in this recipe:
  • Translate text using OpenAI models
  • Create multiple language columns from one source
  • Handle batch translation efficiently
You add computed columns for each target language. Translations are generated automatically when you insert new content and cached for future queries.

Setup

Connected to Pixeltable database at: postgresql+psycopg://postgres:@/pixeltable?host=/Users/pjlb/.pixeltable/pgdata
Created directory ‘translate_demo’.
<pixeltable.catalog.dir.Dir at 0x31f62aa90>

Create translation pipeline

Created table ‘content’.
Added 0 column values with 0 errors.
Added 0 column values with 0 errors.
No rows affected.
Added 0 column values with 0 errors.
Added 0 column values with 0 errors.
No rows affected.

Translate content

Inserting rows into `content`: 3 rows [00:00, 198.43 rows/s]
Inserted 3 rows with 0 errors.
3 rows inserted, 18 values computed.

Explanation

How it works: Each target language is a computed column with a translation prompt. When you insert new content:
  1. The English text is processed
  2. Translation prompts are generated for each language
  3. All translations run in parallel
  4. Results are cached—no re-translation needed
Adding more languages:
Cost optimization:

See also

Last modified on June 24, 2026