Work in other languages
Syntic models read and write many languages, so one assistant can serve customers in Lisbon, Lyon and Lagos. This page covers how to control the language of replies, how language affects cost and limits, and how to test quality in each language you support.
Control the reply language
Models tend to answer in the language of the latest user message. Make your intent explicit in the system message:
| Goal | Instruction |
|---|---|
| Mirror the user | ”Reply in the language of the user’s most recent message.” |
| Fixed language | ”Always reply in German, whatever language the user writes in.” |
| Per-customer setting | ”Reply in European Portuguese.”, with the language name filled in from the user’s profile. |
| Mixed audience | ”Reply in the user’s language. Keep product names, code and error messages in English.” |
Name regional variants when they matter: European versus Brazilian Portuguese, Latin American versus European Spanish, Simplified versus Traditional Chinese. Specify the form of address too (“use the informal tu/du/tú form”) in languages that distinguish them.
Write prompts in one language
You can write the system message in English and have the model reply in any language. That keeps one prompt to maintain, and it works well. If you do translate the prompt, translate the whole of it; a prompt that mixes languages tends to produce replies that mix them as well.
Examples in the prompt carry their language with them. If you show English examples, add a line saying replies should still follow the language rule above.
Language affects token counts
Tokens are not words. The same sentence takes a different number of tokens in different languages; languages written in non-Latin scripts and languages with long compound words usually need more tokens per sentence than English. That matters for:
- Cost: budget per language from real
usagefigures, not from English estimates. - Limits: a conversation that fits comfortably in English may approach limits sooner in another language.
max_tokens: a cap that leaves room for a 150-word English answer can cut off the same answer in another language. Set it per language, or generously.
import os
from openai import OpenAI
client = OpenAI(base_url="https://app.syntic.ai/v1", api_key=os.environ["SYNTIC_API_KEY"])
TEXT = "Your order has shipped and should arrive within three working days."
for language in ["English", "German", "Japanese", "Arabic", "Hindi"]:
r = client.chat.completions.create(
model="Amara Quick", stream=False, max_tokens=200,
messages=[{"role": "user", "content": f"Translate into {language}. Reply with the translation only:\n{TEXT}"}],
)
print(f"{language:<9} {r.usage.completion_tokens:>3} output tokens {r.choices[0].message.content}")Keep things that must not change
Tell the model what to leave untouched: product names, code, URLs, placeholders such as {name}, and legal phrases you have approved translations for. For UI strings and other structured content, see Translate and localise, which includes checks for placeholders and length.
Detect the language when you need it
For routing or analytics, ask for the language as a separate, tiny request rather than as part of the answer:
r = client.chat.completions.create(
model="Amara Quick", stream=False, max_tokens=5,
messages=[{"role": "system", "content": "Reply with the ISO 639-1 code of the language of the user's text, nothing else."},
{"role": "user", "content": message}],
)
code = (r.choices[0].message.content or "").strip().lower()[:2]Test each language you support
Quality varies between languages, and a prompt tuned in English can behave differently elsewhere. For every supported language:
- Translate a sample of your English test cases with a native speaker’s review, and add real messages from customers who write in that language.
- Check the reply language, the form of address, terminology from your glossary, and correctness.
- Have a fluent reviewer read a sample of answers for each release. Automated grading helps with scale but misses tone.
See Test your prompts.
The Syntic API does not translate your requests or replies itself; everything happens in the model, according to your instructions.