Translate
Translate text and detect its language offline with local neural models
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available · $10/month organization minimum
Use with an agent
Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.
npx skills add Query-farm/vgi-skills --skill orchard
Copy this request into your coding agent to get started.
Use https://query.farm/products/orchard/connectors/translate/index.md to help me query Translate with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.
Translate text between languages
Example output · captured
- Connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
SELECT translate.main.translate('The quick brown fox jumps over the lazy dog.', 'es')
| translate.main.translate('The quick brown fox jumps over the lazy dog.', 'es') |
|---|
| El zorro marrón rápido salta sobre el perrito perezoso. |
Quick start
Choose where to run Translate, then follow the steps below.
The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.
1. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach with uvx
Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.
ATTACH 'translate' AS translate (
TYPE vgi,
LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-translate-worker'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'translate' AS translate (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-translate:0.5.0'
);
3. Run a query
SELECT translate.main.translate('The quick brown fox jumps over the lazy dog.', 'es')
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connector’s deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'translate' AS translate
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT translate.main.translate('The quick brown fox jumps over the lazy dog.', 'es')
Query Farm operates Translate for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
SET allow_extension_repositories = 'allowed';
CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
WITH PREFIX 'https://duckdb-extensions.query.farm';
INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use translate as the catalog alias for the query below.
4. Run a query
SELECT translate.main.translate('The quick brown fox jumps over the lazy dog.', 'es')
Technical details
- Verified connector release
- v0.5.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
Pin a version for production
When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.
Attach with uvx
Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.
ATTACH 'translate' AS translate (
TYPE vgi,
LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-translate-worker'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'translate' AS translate (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-translate:0.5.0'
);
Overview
Local neural machine translation and language detection for DuckDB/SQL.
![]()
Translate text between languages and identify the language of any string directly in DuckDB SQL — fully offline, with no API keys, no rate limits, and no data ever leaving your machine. This VGI extension brings local neural machine translation (NMT) and language detection to your queries, so multilingual text processing, localization (i18n), and content normalization become ordinary SQL.
Translation is powered by Argos Translate (project site & docs), an open-source (MIT-licensed) offline translation library built on the OPUS-MT neural models trained on the OPUS parallel corpora. Language packages install lazily on first use and are cached per worker process, so a model loads once and then serves every subsequent query at full speed with zero network access. Because Argos Translate and the OPUS-MT models are permissively licensed, this default backend is commercial-safe (the CC-BY-NC NLLB-200 models are intentionally not the default). Language detection uses py3langid, a fast BSD-licensed identifier that ships its own model and runs entirely offline.
The catalog exposes a small, focused function surface. The scalar translate(text, target) translates a string into an ISO 639-1 target language while auto-detecting the source per row, and the translate(text, target, source) overload lets you pin an explicit source language. detect_lang(text) returns the detected ISO 639-1 language code of each value. For high-throughput workloads, the table function translate_all(rows, id, target, source) streams a whole table of rows through the model in batches — reusing the cached model across the entire scan and carrying an id column through so results join straight back to the source. Typical uses include translating user-generated content, normalizing multilingual product catalogs and support tickets, building localization pipelines, and routing or filtering rows by detected language. Source, issues, and full documentation live in the project repository.
Catalog
Everything translate exposes once attached — read straight from the worker's
released build.
main 1 view · 3 functions
Local neural machine translation and language detection for SQL.
Schema examples (8)
Translate an English sentence into Spanish (auto-detecting the source).
SELECT translate.main.translate('The quick brown fox jumps over the lazy dog.', 'es');
| translate.main.translate('The quick brown fox jumps over the lazy dog.', 'es') |
|---|
| El zorro marrón rápido salta sobre el perrito perezoso. |
Translate a Spanish string back into English with an explicit source.
SELECT translate.main.translate('Hola, mundo.', 'en', 'es');
Detect the ISO 639-1 language code of a French phrase.
SELECT translate.main.detect_lang('Bonjour le monde');
Batch-translate a table of rows, projecting the id and its translation.
SELECT id, translation
FROM translate.main.translate_all((SELECT 1 AS id, 'The quick brown fox jumps over the lazy dog.' AS body), id := 'id', target := 'es', source := 'en');
4 more examples
Look up the ISO 639-1 code for a language by its English name.
SELECT code FROM translate.main.languages WHERE name = 'Spanish';
Detect the language of each message and label it with its English name from the languages reference view (returns fr/French, de/German, es/Spanish, en/English).
WITH detected AS (SELECT id, body, translate.main.detect_lang(body) AS code FROM (VALUES (1, 'Bonjour le monde, comment allez-vous ce matin?'), (2, 'Guten Morgen, wie geht es Ihnen heute?'), (3, 'Hola, mucho gusto en conocerte.'), (4, 'The weather is lovely today.')) AS messages(id, body)) SELECT d.id, d.code, l.name AS language
FROM detected AS d
LEFT JOIN translate.main.languages AS l ON l.code = d.code
ORDER BY d.id;
Use detect_lang to pick out the Spanish rows of a mixed-language review table and translate only those into English with an explicit 'es' source (the English review is filtered out; reviews 1 and 3 come back translated).
SELECT id, body, translate.main.translate(body, 'en', 'es') AS english
FROM (VALUES (1, 'El envío llegó tarde y la caja estaba dañada.'), (2, 'Great product, works as described.'), (3, 'Muy buena calidad, lo recomiendo.')) AS reviews(id, body)
WHERE translate.main.detect_lang(body) = 'es'
ORDER BY id;
Normalize a mixed Spanish/English review table to English in one batch, auto-detecting each row's source and naming it via the languages view (Spanish rows are translated; the English row passes through unchanged).
SELECT t.id, l.name AS source_language, t.text, t.translation
FROM translate.main.translate_all((SELECT id, body FROM (VALUES (1, 'El envío llegó tarde y la caja estaba dañada.'), (2, 'Great product, works as described.'), (3, 'Muy buena calidad, lo recomiendo.')) AS reviews(id, body)), id := 'id', target := 'en', source := 'auto') AS t
LEFT JOIN translate.main.languages AS l ON l.code = t.src_lang
ORDER BY t.id;
languages
Common ISO 639-1 language codes (and English names) accepted by translate and detect_lang.
Look up the ISO 639-1 code for a language by its English name.
SELECT code FROM translate.main.languages WHERE name = 'Spanish';
Count how many reference languages are listed.
SELECT count(*) AS n FROM translate.main.languages;
detect_lang (text VARCHAR)
Detect the ISO 639-1 language code of text
Detect the ISO 639-1 language code of a French phrase (returns 'fr').
SELECT translate.main.detect_lang('Bonjour le monde');
Detect the language of a German greeting (returns 'de').
SELECT translate.main.detect_lang('Guten Morgen');
Detect the language of each message and label it with its English name from the languages reference view (returns fr/French, de/German, es/Spanish, en/English).
WITH detected AS (SELECT id, body, translate.main.detect_lang(body) AS code FROM (VALUES (1, 'Bonjour le monde, comment allez-vous ce matin?'), (2, 'Guten Morgen, wie geht es Ihnen heute?'), (3, 'Hola, mucho gusto en conocerte.'), (4, 'The weather is lovely today.')) AS messages(id, body)) SELECT d.id, d.code, l.name AS language
FROM detected AS d
LEFT JOIN translate.main.languages AS l ON l.code = d.code
ORDER BY d.id;
translate (text VARCHAR, to_lang VARCHAR, from_lang VARCHAR) +1 overload
Translate text into a target language (source auto-detected) using a local neural model
translate(text VARCHAR, to_lang VARCHAR) → VARCHARtranslate(text VARCHAR, to_lang VARCHAR, from_lang VARCHAR) → VARCHAR
Translate an English sentence into Spanish, auto-detecting the source language.
SELECT translate.main.translate('The quick brown fox jumps over the lazy dog.', 'es');
| translate.main.translate('The quick brown fox jumps over the lazy dog.', 'es') |
|---|
| El zorro marrón rápido salta sobre el perrito perezoso. |
Translate a Spanish string into English with an explicit source language.
SELECT translate.main.translate('Hola, mundo.', 'en', 'es');
Use detect_lang to pick out the Spanish rows of a mixed-language review table and translate only those into English with an explicit 'es' source (the English review is filtered out; reviews 1 and 3 come back translated).
SELECT id, body, translate.main.translate(body, 'en', 'es') AS english
FROM (VALUES (1, 'El envío llegó tarde y la caja estaba dañada.'), (2, 'Great product, works as described.'), (3, 'Muy buena calidad, lo recomiendo.')) AS reviews(id, body)
WHERE translate.main.detect_lang(body) = 'es'
ORDER BY id;
3 more examples
SELECT translate.main.translate('The quick brown fox jumps over the lazy dog.', 'es') AS es;
SELECT translate.main.translate('Hola, mundo.', 'en', 'es') AS en;
SELECT translate.main.detect_lang('Bonjour le monde') AS lang;
translate_all (data TABLE, id := VARCHAR, source := VARCHAR, target := VARCHAR)
Translate a table of text rows in batch, carrying an id column through
Batch-translate a table of rows from English to Spanish, carrying the id through and projecting just the id and its translation.
SELECT id, translation
FROM translate.main.translate_all((SELECT 1 AS id, 'The quick brown fox jumps over the lazy dog.' AS body), id := 'id', target := 'es', source := 'en');
Normalize a mixed Spanish/English review table to English in one batch, auto-detecting each row's source and naming it via the languages view (Spanish rows are translated; the English row passes through unchanged).
SELECT t.id, l.name AS source_language, t.text, t.translation
FROM translate.main.translate_all((SELECT id, body FROM (VALUES (1, 'El envío llegó tarde y la caja estaba dañada.'), (2, 'Great product, works as described.'), (3, 'Muy buena calidad, lo recomiendo.')) AS reviews(id, body)), id := 'id', target := 'en', source := 'auto') AS t
LEFT JOIN translate.main.languages AS l ON l.code = t.src_lang
ORDER BY t.id;
Try these queries
Translate a Spanish string back into English with an explicit source.
SELECT translate.main.translate('Hola, mundo.', 'en', 'es')
Uses translate
Detect the ISO 639-1 language code of a French phrase.
SELECT translate.main.detect_lang('Bonjour le monde')
Uses detect_lang
Batch-translate a table of rows, projecting the id and its translation.
SELECT id, translation
FROM translate.main.translate_all((SELECT 1 AS id, 'The quick brown fox jumps over the lazy dog.' AS body), id := 'id', target := 'es', source := 'en')
Uses translate_all
Look up the ISO 639-1 code for a language by its English name.
SELECT code FROM translate.main.languages WHERE name = 'Spanish'
Uses languages
Detect the language of each message and label it with its English name from the languages reference view (returns fr/French, de/German, es/Spanish, en/English).
WITH detected AS (SELECT id, body, translate.main.detect_lang(body) AS code FROM (VALUES (1, 'Bonjour le monde, comment allez-vous ce matin?'), (2, 'Guten Morgen, wie geht es Ihnen heute?'), (3, 'Hola, mucho gusto en conocerte.'), (4, 'The weather is lovely today.')) AS messages(id, body)) SELECT d.id, d.code, l.name AS language
FROM detected AS d
LEFT JOIN translate.main.languages AS l ON l.code = d.code
ORDER BY d.id
Uses detect_langlanguages
Use detect_lang to pick out the Spanish rows of a mixed-language review table and translate only those into English with an explicit 'es' source (the English review is filtered out; reviews 1 and 3 come back translated).
SELECT id, body, translate.main.translate(body, 'en', 'es') AS english
FROM (VALUES (1, 'El envío llegó tarde y la caja estaba dañada.'), (2, 'Great product, works as described.'), (3, 'Muy buena calidad, lo recomiendo.')) AS reviews(id, body)
WHERE translate.main.detect_lang(body) = 'es'
ORDER BY id
Uses translatedetect_lang
6 more examples in the Catalog, each listed under the table or function it uses.
Questions it can answer
Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.
- A user pasted the text 'Bonjour le monde, comment allez-vous ce matin?'. Using this worker, return the ISO 639-1 language code it detects for that text.
- Identify the language of the sentence 'Guten Morgen, wie geht es Ihnen heute?' and return its ISO 639-1 code using this worker.
- Translate the English sentence 'The quick brown fox jumps over the lazy dog.' into Spanish using this worker. The source language is English.
Translate is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.
Related workers
NLP
AI & language
Detect language, score sentiment, extract entities and tokenize text from queries
Anthropic
AI & language
Read-only view of your Anthropic organization's members, API keys, token usage and cost
Embed
AI & language
Turn text into embedding vectors on your own machine and rank it by cosine similarity for semantic search and RAG