Bilingual AI assistant in Uzbek and Russian: how to set one up
A bilingual bot is not a matter of 'turning on translation'. The real problems start with Uzbek Cyrillic, transliteration and token cost, not with translation itself.
Three scripts, not two languages
In practice you serve four input variants: Russian, Uzbek Latin, Uzbek Cyrillic and mixed text. The older generation and parts of the public sector write in Cyrillic, younger users in Latin, and a single message may contain both.
You do not need separate dialogue branches per script. Normalizing input is enough: convert Uzbek Cyrillic to Latin before matching against catalogues and dictionaries, keeping the original text for the model call.
The bot must reply in the script it was addressed in. A Latin reply to a Cyrillic message reads as machine output and erodes trust, particularly with government bodies and the 40+ audience.
Language detection in practice
Frequency-based detection breaks on short messages: 'salom', 'narxi qancha', 'сколько' — two words are not enough for a reliable verdict. Do not build the logic on a standalone detection library.
The working approach: instruct the system prompt to answer in the language and script of the last user message, and store the interface button language in the user profile, asked once at start.
The stored choice must be overridden by behaviour: if a user writes three consecutive messages in Russian while the profile says Uzbek, switch automatically and say so in one line.
Model quality in Uzbek
Large models understand Uzbek confidently but generate it noticeably worse than Russian or English: calques from Russian, unnatural word order and case ending errors all appear.
Hence the rule: anything that can be fixed as a template should be a template. Greetings, service descriptions, delivery terms, buttons and legal wording are static texts proofread by a native speaker, not on-the-fly generation.
Reserve free generation in Uzbek for unpredictable branches, and have a native speaker review a sample of logs at least every two weeks in the early period.
Token cost in Uzbek
Uzbek text, especially in Cyrillic, tokenizes far worse than English: the same message can cost two to three times more tokens. In Latin the gap is smaller but still present.
In practice that means you cannot drag a long trilingual system prompt into every request. Keep one compact English prompt with an instruction to answer in the required language — it is cheaper and works just as well.
Cap the conversation history at the last six to eight messages plus a compressed summary. Without that, spend on long consultations grows non-linearly.
What to test before launch
Assemble a set of real phrases in both scripts, including typos and mixed input, and run the bot against it after every prompt change. Twenty to thirty cases are enough to catch regressions.
Test numbers and prices separately: models like to reformat amounts and lose digits. Sums in UZS must be injected from your database by template, not reproduced by the model from memory.
Test mixed messages, half Russian and half Uzbek. That is the most common real case and the one that most often breaks a naive implementation.