The ai_provider_litellm module does not implement the translate_text operation type, which means it cannot be selected as a provider for AI-powered content translation (e.g. with the ai_translate module).
The translate_text operation type is missing from getSupportedOperationTypes(), there is no translateText() method, and TranslateTextInterface is not implemented. As a result, LiteLLM does not appear as an option in the AI module's provider settings for text translation.
Steps to reproduce:
Install ai_provider_litellm and configure a valid LiteLLM server.
Go to /admin/config/ai/settings.
Look at the "Translate text" operation type row.
Expected behavior:
LiteLLM appears as a selectable provider for the "Translate text" operation, with chat-capable models available.
Actual behavior:
LiteLLM is not listed as an option for "Translate text".
Proposed solution:
Implement TranslateTextInterface in LiteLlmAiProvider. The translateText() method can delegate to the existing chat() method by building a translation prompt — the same pattern used by the Gemini provider. Any model that supports chat can handle translation. The translate_text case in getModels() should return chat-capable models.
Issue fork ai_provider_litellm-3614792
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3614792-translate-text
changes, plain diff MR !26
- 3614792-ttulo-litellm-provider
compare
Comments
Comment #2
carlos romero commentedComment #5
carlos romero commentedComment #6
dan2k3k4 commentedThanks, merged!