Skip to content

How to globally set the language for model thinking and answering #9610

Closed as not planned

Description

@fashen97

Question

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

Activity

  1. github-actions commented on Jan 20, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  2. zer0Black commented on Jan 20, 2026

    @zer0Black

    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
    
  3. fashen97 commented on Jan 21, 2026

    @fashen97
    Author

    @zer0Black thanks

  4. pcastellazzi commented on Mar 27, 2026

    @pcastellazzi

    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.

  5. assigned and unassigned on May 19, 2026
  6. github-actions commented on May 27, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions