You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to globally set the language for model thinking and answering #9610
The current preset prompt words are all in English. Even if I ask questions in other languages, the model's thinking process will still contain a lot of English. How to set up models to uniformly think and answer in a certain language
Reacted by hertznsk, yuelwish, Denis Aleshin, HAOHANJI and Treemo
Please refer to the response in #9615 :
This feature is available. Please write this requirement into the global AGENTS.md file, which should be located in the same directory as the opencode.json configuration file
My global AGENTS.md example:
# Output Language
- Output in Chinese
- Generate AGENTS.md in Chinese using the /init command
This is more complicated than it sounds. I used @zer0Black's approach to force OpenCode to answer in my native language (Spanish), even when all the prompts used by OpenCode are in English. It works, sort of. I noticed a drop in quality and certain English cultural biases, like an answer referenced pounds, when every Spanish speaking country in the world uses the metric system.
It turns out there is a price to pay for mixing languages. Benchmarks such as this one show that there is reduction in output quality.
Some solutions have being explored in here or here, the most complex ideas would require some coding, but some of the basic ones can be used in OpenCode as it is today.
This are some of the strategies available in OpenCode:
Ask the LLM to produce output in Spanish
Translate the output to Spanish after the fact
Translate prompts to English, and the answer back to Spanish
Translate the agent prompt
The first 3 can be done by modifying AGENTS.md accordingly, but the back and forth of the translation step will consume extra tokens. The last one requires to modify OpenCode's configuration.
Activity
github-actions commentedon Jan 20, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
zer0Black commentedon Jan 20, 2026
Please refer to the response in #9615 :
This feature is available. Please write this requirement into the global AGENTS.md file, which should be located in the same directory as the opencode.json configuration file
My global AGENTS.md example:
fashen97 commentedon Jan 21, 2026
@zer0Black thanks
pcastellazzi commentedon Mar 27, 2026
This is more complicated than it sounds. I used @zer0Black's approach to force OpenCode to answer in my native language (Spanish), even when all the prompts used by OpenCode are in English. It works, sort of. I noticed a drop in quality and certain English cultural biases, like an answer referenced pounds, when every Spanish speaking country in the world uses the metric system.
It turns out there is a price to pay for mixing languages. Benchmarks such as this one show that there is reduction in output quality.
Some solutions have being explored in here or here, the most complex ideas would require some coding, but some of the basic ones can be used in OpenCode as it is today.
This are some of the strategies available in OpenCode:
The first 3 can be done by modifying AGENTS.md accordingly, but the back and forth of the translation step will consume extra tokens. The last one requires to modify OpenCode's configuration.
github-actions commentedon May 27, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.