mirror of
https://github.com/primedigitaltech/market-assistant.git
synced 2026-07-22 08:01:34 +08:00
LiteLLM rejects when max_tokens exceeds context minus measured input tokens. Estimate input from prompt length and clamp max_tokens; allow LLM_CONTEXT_WINDOW override. Prevents ContextWindowExceededError on long Chinese/JSON prompts (e.g. regenerate-report §8.5). Made-with: Cursor