My application needs translations between multiple languages.
Thus I made this:
hash CallTranslateMulti( string srcLang, list targLangs, string text)
which talks with Gemma directly and returns a hash with the language names as keys and the translations as values.
DeepL API also has such a possibility, and it is at least economical, as it can save a large fraction of the traffic to be paid.
In addition to this, there is a pretty big efficiency gain at least with Gemma, as the tokenization needs to be done only once. Each added translation output language adds about 25-30% of the processing time of a translation request with only one target language. So, with separate translation requests for, say, 8 output languages, your processing time is 800%, while it is about 300% if Gemma is allowed to return all 8 translations in a single response.
If there is any interest in implementing this, I’ll happily supply my prompt and the Perl code for dealing with Gemma’s output.