LLM Translator:
The LLM Translator is a specialized node designed to facilitate text translation using a Language Model (LLM) API. Adhering to the Unix philosophy of "Do One Thing and Do It Well," this node focuses solely on translating text efficiently and accurately. It leverages a shared LLMClient for enhanced robustness, ensuring reliable performance across various translation tasks. The node is particularly beneficial for users who need to translate plain text, prompts, subtitles, or any multi-line content into different languages. By utilizing this node, you can achieve consistent and high-quality translations, making it an essential tool for AI artists and content creators who work with multilingual content.
LLM Translator Input Parameters:
provider
The provider parameter specifies the translation service provider to be used. It is crucial for determining which LLM API will handle the translation task. The available options depend on the enabled providers configured in the system. Selecting the right provider can impact the translation quality and speed.
model
The model parameter defines the specific language model to be used for translation. This choice affects the translation's accuracy and style, as different models may have varying capabilities and strengths. The available models are determined by the selected provider.
text
The text parameter is where you input the content you wish to translate. It supports plain text, prompts, subtitles, or any multi-line content. This parameter is essential as it directly influences the translation output. The default value is an empty string, and you can leave it empty to skip translation.
target_language
The target_language parameter allows you to select the language into which the text will be translated. Options include English, Chinese (Simplified), Chinese (Traditional), Japanese, Korean, French, German, Spanish, Russian, Italian, Portuguese, Dutch, and Arabic. The default target language is English. Choosing the correct target language is vital for achieving the desired translation results.
llm_config
The llm_config parameter is optional and allows you to provide specific configuration settings for the LLM. This can include parameters like temperature and max tokens, which can fine-tune the translation process to meet specific needs.
glossary
The glossary parameter is an optional field where you can define domain-specific terms to ensure consistent translation. It supports a format where each entry is on a new line, such as LoRA = LoRA. This parameter is useful for maintaining consistency in translations involving specialized terminology.
LLM Translator Output Parameters:
translated_text
The translated_text parameter is the output of the node, providing the translated version of the input text. This output is crucial as it represents the final product of the translation process, ready for use in multilingual content creation or communication.
LLM Translator Usage Tips:
- Ensure that the
providerandmodelparameters are correctly configured to match your translation needs, as different providers and models may offer varying levels of accuracy and style. - Utilize the
glossaryparameter to maintain consistency in translations involving specialized or domain-specific terms, which can be particularly useful in technical or industry-specific content.
LLM Translator Common Errors and Solutions:
[LLM Translator] ✗ Translation failed
- Explanation: This error indicates that the translation process was unsuccessful, possibly due to issues with the API connection, incorrect configuration, or unsupported text input.
- Solution: Verify that the provider and model are correctly configured and enabled. Check your internet connection and ensure that the API key and base URL are correctly set in the configuration. If the problem persists, review the input text for unsupported characters or formats.
