{"result":{"depiction_url":null,"edges":{"observes":{"objects":[{"created":"2026-10-06T13:25:44Z","object_id":{"id":1466,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_admin_menu","title":"observe_admin_menu\/3","uri":"https:\/\/zotonic.com\/id\/1466"},"seq":1},{"created":"2026-10-06T13:25:44Z","object_id":{"id":2404,"is_a":["text","documentation","reference","notification"],"name":"doc_notification_translate","title":"observe_translate\/2","uri":"https:\/\/zotonic.com\/id\/2404"},"seq":2}],"predicate":{"id":2550,"is_a":["meta","predicate"],"name":"observes","title":{"_type":"trans","tr":{"en":"Observes"}},"uri":"https:\/\/zotonic.com\/id\/observes"}},"subject":{"objects":[{"created":"2026-10-06T13:25:44Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-10-06T13:25:44Z","object_id":{"id":2561,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_content_editor","title":"Content editor","uri":"https:\/\/zotonic.com\/id\/2561"},"seq":2},{"created":"2026-10-06T13:25:44Z","object_id":{"id":2588,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_localization_and_translation","title":"Localization and translation","uri":"https:\/\/zotonic.com\/id\/2588"},"seq":3},{"created":"2026-10-06T13:25:44Z","object_id":{"id":2592,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_authorization_and_access_control","title":"Authorization and access control","uri":"https:\/\/zotonic.com\/id\/2592"},"seq":4},{"created":"2026-10-06T13:25:44Z","object_id":{"id":2599,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_api_and_integration","title":"API and integration","uri":"https:\/\/zotonic.com\/id\/2599"},"seq":5},{"created":"2026-10-06T13:25:44Z","object_id":{"id":2603,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_configuration","title":"Configuration","uri":"https:\/\/zotonic.com\/id\/2603"},"seq":6},{"created":"2026-10-06T13:25:44Z","object_id":{"id":2635,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_module","title":"Module","uri":"https:\/\/zotonic.com\/id\/2635"},"seq":7},{"created":"2026-10-06T13:25:44Z","object_id":{"id":2668,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_language_code","title":"Language code","uri":"https:\/\/zotonic.com\/id\/2668"},"seq":8},{"created":"2026-10-06T13:25:44Z","object_id":{"id":2669,"is_a":["categorization","keyword","keyword_data_type"],"name":"zotonic_topic_translated_text","title":"Translated text","uri":"https:\/\/zotonic.com\/id\/2669"},"seq":9}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2763,"is_a":["text","documentation","reference","module"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2763"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_external_2_mod_translate_argos","page_url":{"en":"https:\/\/zotonic.com\/docs\/2763\/mod_translate_argos","x-default":"https:\/\/zotonic.com\/docs\/2763\/mod_translate_argos"},"preview_url":null,"resource":{"version":23,"pivot_location_lat":null,"title":"mod_translate_argos","is_authoritative":true,"body":"<p>Provides automatic translation using a local Argos Translate Python worker as\na translation service for Zotonic&#39;s <code>mod_translation<\/code> module.<\/p>\n<h2>Setup and configuration<\/h2>\n<p>Enable <code>mod_translate_argos<\/code>. Installation creates a shared Python virtual\nenvironment under <code>apps\/zotonic_mod_translate_argos\/venv<\/code> in the Zotonic data\ndirectory and installs <code>priv\/python\/requirements.txt<\/code>. Open <strong>System →\nArgos Translate<\/strong> in the admin to refresh the package index and install the\nlanguage packages needed for translation. Package administration requires\n<code>use.mod_admin_config<\/code> permission.<\/p>\n<p>Grant <code>use.mod_translate_argos<\/code> to user groups allowed to request translations.\nThe integration handles the <code>translate<\/code> notification used by the admin&#39;s\nadd-language dialog. Plain text and HTML requests are routed to their matching\nmodel functions. The observer returns <code>{ok, TranslatedTexts}<\/code> on success and\n<code>undefined<\/code> on denied access or translation errors, allowing other providers\nto handle the notification.<\/p>\n<p>Both source and target languages are required. Language variants are normalized\nto their primary language code. Translation runs locally; package installation\nand index updates may need network access.<\/p>\n<p><code>mod_translate_argos.timeout<\/code> sets the worker request timeout in milliseconds;\nthe default is <code>120000<\/code>. The following are Zotonic system configuration keys:<\/p>\n<ul><li><code>translate_argos_python_command<\/code>: override the Python executable used to\ncreate the virtual environment. Otherwise Zotonic&#39;s <code>python_command<\/code> system\nsetting is used, falling back to <code>python3<\/code>. Bare command names are resolved\nwith <code>os:find_executable\/1<\/code>.<\/li><li><code>translate_argos_max_queue<\/code>: maximum queued requests across all sites,\ndefault <code>100<\/code>. Zero disables waiting behind an active request.<\/li><\/ul>\n<p>Set system configuration in <code>zotonic.config<\/code>, for example:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-erlang\">{translate_argos_max_queue, 100}\n<\/code><\/pre>\n<h2>Language packages<\/h2>\n<p>Argos needs installed translation packages for the requested language pair.\nPackages can be managed in the admin or with <code>argospm<\/code> from the module&#39;s virtual\nenvironment. For example, install an English-to-Dutch package with:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-sh\">&lt;zotonic-data-dir&gt;\/apps\/zotonic_mod_translate_argos\/venv\/bin\/argospm update\n&lt;zotonic-data-dir&gt;\/apps\/zotonic_mod_translate_argos\/venv\/bin\/argospm install translate-en_nl\n<\/code><\/pre>\n<p>Replace <code>&lt;zotonic-data-dir&gt;<\/code> with the actual Zotonic data directory. Argos can\nalso translate through intermediate languages when the required packages are\ninstalled. The virtual environment, worker, and language packages are shared\nbetween sites.<\/p>\n<h2>Shared worker<\/h2>\n<p>The model starts the worker on demand under <code>z_system_process<\/code>. One persistent\nPython process serves all sites and serializes requests. Package administration\nhas priority over queued translations. Plain and tagged text are sent in batches\nof at most 16 strings, retaining the input order.<\/p>\n<p>The worker is started lazily on the first translation or package request, not\nat Zotonic startup. The global supervisor keeps it running independently of\nindividual sites. It launches Python using <code>erlexec<\/code> and exchanges\nnewline-delimited JSON over stdin\/stdout; no separate HTTP service is needed.<\/p>\n<p>Package commands (<code>packages<\/code>, <code>install_package<\/code>, and <code>update_packages<\/code>) use a\npriority queue. Translations use a normal FIFO queue. Queued requests are\nremoved when their caller exits and skipped when their caller&#39;s\n<code>gen_server:call<\/code> timeout window has already elapsed.<\/p>\n<h2>GPU and Apple Accelerate support<\/h2>\n<p>Argos uses CTranslate2 for model inference. The module passes <code>auto<\/code> as the\nworker&#39;s device setting; the Python script uses it for <code>ARGOS_DEVICE_TYPE<\/code>\nunless that environment variable is already set. Acceleration depends on the\ninstalled CTranslate2 build and the available hardware and runtime libraries.\nWith automatic device selection, CPU is the fallback when a supported GPU\nbackend is unavailable.<\/p>\n<h3>NVIDIA CUDA<\/h3>\n<p>CUDA acceleration requires a supported NVIDIA GPU, NVIDIA driver, CUDA runtime,\nand a CTranslate2 build with CUDA support. For a custom source build, the\nREADME uses these CMake options from the CTranslate2 build directory:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-sh\">cmake .. -DWITH_CUDA=ON -DWITH_CUDNN=ON\nmake -j\nmake install\n<\/code><\/pre>\n<p>Build the matching CTranslate2 Python wheel and install it into the Argos\nvirtual environment. When using a custom installation prefix, ensure that the\nPython build and runtime can find the CTranslate2 headers and shared libraries.<\/p>\n<h3>macOS and Apple Accelerate<\/h3>\n<p>Modern Apple hardware does not provide the NVIDIA CUDA path. CTranslate2 can\nuse Apple Accelerate for CPU math and linear algebra when its installed wheel\nor source build enables that backend. This is CPU acceleration, not Apple GPU,\nMetal, or MPS execution.<\/p>\n<p>For a custom source build, the README uses:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-sh\">cmake .. -DWITH_ACCELERATE=ON\nmake -j\nmake install\n<\/code><\/pre>\n<p>Build and install the matching Python wheel into the module virtual environment.<\/p>\n<h3>Installing a custom inference build<\/h3>\n<p>The module&#39;s Python requirements normally determine which CTranslate2 build is\ninstalled. After the virtual environment exists, install a custom wheel with:<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-sh\">&lt;zotonic-data-dir&gt;\/apps\/zotonic_mod_translate_argos\/venv\/bin\/pip install \/path\/to\/ctranslate2-*.whl\n<\/code><\/pre>\n<p>Restart Zotonic, or stop the shared Argos worker so it restarts with the new\nPython package. Because the worker is shared, this affects every site using it.<\/p>","slug":"mod_translate_argos","doc_module_config":[{"default":"120000","description":"Maximum translation runtime in milliseconds.","has_default":true,"key":"timeout","module":"mod_translate_argos","type":"integer"}],"is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"268caf448004cda1f487b9a872ccad35217e82b70cd7f4a92433e0bfe7d8a756","doc_module_observers":[{"name":"admin_menu","page_name":"doc_notification_admin_menu"},{"name":"translate","page_name":"doc_notification_translate"}],"is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"external_module_id":{"id":2,"is_a":[],"name":null,"title":null,"uri":"https:\/\/zotonic.com\/id\/2"},"git_url":"https:\/\/github.com\/zotonic\/zotonic_mod_translate_argos","category_id":{"id":320,"is_a":["meta","category"],"name":"module","title":"Modules","uri":"https:\/\/test.zotonic.com\/id\/320"},"doc_source_path":".\/src\/mod_translate_argos.erl","publication_start":"2026-10-06T13:25:44Z","github_url":"https:\/\/github.com\/zotonic\/zotonic_mod_translate_argos","pivot_location_lng":null,"doc_source_kind":"external","name":"doc_external_2_mod_translate_argos","is_unfindable":false,"is_published":true,"pivot_geocode":null,"external_module_title":"Argos Translate","created":"2026-10-06T13:25:44Z","uri":null,"doc_status":"current","is_dependent":false,"is_external_module":true,"publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"307f3989fd0c679722188a1874ccb3dc30571a8c","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-10-06T13:25:44Z","title_slug":"mod_translate_argos"},"uri":"https:\/\/zotonic.com\/id\/2763","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2763"}},"status":"ok"}