Does not translate with REPORT_LANGUAGE=en set.

Author: neil-patel77Created Sep 22, 2026Updated Sep 22, 2026

Summary

With REPORT_LANGUAGE=en set, the market-review report correctly comes back in English, but the individual stock "决策仪表盘" (Decision Dashboard) analysis report is still generated in Chinese when using a local Ollama model (tested with qwen3:14b).

Root cause (confirmed via debug logs)

The stock-analysis system+user prompt is almost entirely Chinese (trading rules, JSON schema descriptions, field labels, scoring criteria — several thousand characters), with only a short block appended at the very end when REPORT_LANGUAGE=en is set:

### Output language requirements (highest priority)
- Keep every JSON key exactly as defined above; do not translate keys.
- `decision_type` must remain `buy`, `hold`, or `sell`.
- All human-readable JSON values must be in English.
- ...

This instruction is correctly built and sent to the model (confirmed in logs/stock_analysis_debug_*.log — the full prompt with this block immediately precedes the ollama/qwen3:14b LLM call). However, the model still responds entirely in Chinese.

This appears to be a majority-language bias issue: with ~95% of the prompt in Chinese and only a small trailing instruction in English, smaller/local models (tested: qwen3:14b via Ollama) pattern-match to the dominant in-context language rather than following the final instruction. Larger hosted models (GPT/Claude/Gemini-class) are more likely to prioritize explicit instructions over incidental context language, so this may not reproduce with cloud providers — but for anyone running a local model via OLLAMA_API_BASE, this makes REPORT_LANGUAGE=en effectively non-functional for stock-level reports.

Suggested fix

Rather than appending an English override to an otherwise fully-Chinese template, translate the entire stock-analysis prompt template (system + user message) when REPORT_LANGUAGE=en, matching whatever approach already makes the market-review report work correctly in English. Field/key names should of course stay fixed regardless of language.

Environment

  • Deployment: official Docker image (zhulinsen/daily_stock_analysis:latest), server mode
  • LLM: LITELLM_MODEL=ollama/qwen3:14b, local Ollama instance
  • REPORT_LANGUAGE=en

Source: ZhuLinsen/daily_stock_analysis