Page updated:

AI Analysis Push

TrendRadar can connect to AI large language models to automatically analyze the trending topics it collects and generate an insight report attached to the push message. Once enabled, what you receive is no longer just a list of headlines, but an intelligence brief with in-depth analysis.
AI Analysis Push example

The five sections of AI analysis

The AI analyzes your trending topics in depth across the following five sections:
1. Core trends & sentiment landscape (core_trends) : automatically reads every trending topic that matches your keywords and distills the topics drawing the most attention right now along with the overall sentiment landscape.
2. Sentiment direction & controversy (sentiment_controversy) : analyzes the emotional direction, the distribution of opinions, and the focal points of controversy in public discussion, helping you grasp where public sentiment is heading.
3. Anomalies & weak signals (signals) : surfaces unusual fluctuations and emerging weak signals, catching early signs of events that may grow into significant developments.
4. RSS deep insights (rss_insights) : performs in-depth analysis on RSS feed content, extracting valuable information and trends.
5. Outlook & strategic recommendations (outlook_strategy) : synthesizes an overall assessment of how trending events may develop and provides strategic recommendations and actionable suggestions.

How to enable

Enabling AI analysis requires the following three mandatory settings. Start by checking the fields in config/config.yaml. Docker and GitHub Actions can override them with environment variables; store API keys in GitHub Actions Secrets rather than committing them.
Required configuration
config.yaml fieldEnvironment overrideExample valueDescription
ai_analysis.enabledAI_ANALYSIS_ENABLEDtrueMaster switch for enabling AI analysis
ai.api_keyAI_API_KEYsk-xxxxxxYour AI service API key
ai.modelAI_MODELopenai/deepseek-v4-flashModel identifier (format: provider/model-name)
The fragment below only shows where the fields belong. Edit the existing ai and ai_analysis sections in config/config.yaml one field at a time:
ai:
  model: "openai/deepseek-v4-flash"
  api_key: "sk-xxxxxx"
  api_base: "https://api.deepseek.com"
  timeout: 120
  temperature: 1.0
  max_tokens: 5000
  num_retries: 1
  fallback_models: []

ai_analysis:
  enabled: true
  language: "Chinese"

Choose an integration mode first

Most relays—and many official model APIs—expose an OpenAI-compatible endpoint. Prefer the first mode: it requires only the exact model ID, API key, and API base URL, without first looking up a LiteLLM provider name. Use LiteLLM provider mode only when the compatible route does not work or a dedicated adapter is required.
Integration modeai.model / AI_MODEL exampleNotes
OpenAI-compatible API (recommended)openai/<exact endpoint model ID>Set api_base; works with most relays and official services that expose a compatible API
LiteLLM provider mode (fallback)<provider prefix>/<model ID>If the compatible route fails, look up the provider prefix in LiteLLM documentation
Ollama (local deployment)ollama_chat/<local model name>Set api_base; TrendRadar requires any non-empty placeholder api_key

Integration configuration examples

The four tabs below cover common setup scenarios. The first two use DeepSeek to demonstrate cloud API patterns; local Ollama and deployment-time environment overrides are explained separately.
DeepSeek example
Prefixing the model ID with openai/ forces LiteLLM to send an OpenAI Chat Completions request to api_base. The address and model ID below come from the official DeepSeek API documentation:
ai:
  model: "openai/deepseek-v4-flash"
  api_key: "<DeepSeek API key>"
  api_base: "https://api.deepseek.com"

Partner integration examples

The following optional model services are provided by project partners. They follow the same configuration rules described above, so choose one only when it fits your needs.
Partner
One OpenAI-compatible model configuration powers TrendRadar analysis, smart filtering, and headline translation.
Start with a model and an API keyChoose a text model, then sign in to the console to create an API key.

Configure TrendRadar

Update these fields in your existing config/config.yaml, keeping all other settings. Do not add duplicate ai or ai_analysis sections.
ai:
  model: "openai/deepseek-v4-flash"
  api_key: "<ApiSmart API Key>"
  api_base: "https://gw.apismart.ai/v1"

ai_analysis:
  enabled: true
Model ID
The example deepseek-v4-flash comes from the official API guide. Keep the openai/ prefix and use the exact text model ID, including case, punctuation, and version.
API base URL
Use the base URL above, keeping /v1 without appending /chat/completions. Image and video models are not used for news analysis.
Partner
Connect a text model through DeepSider API’s OpenAI-compatible interface. The same configuration supports TrendRadar analysis, smart filtering, and headline translation.
Choose a model and create an API keyCheck API Usage in the model details for Chat Completions support, then create a key with access to that model.

Configure TrendRadar

Update these fields in your existing config/config.yaml and keep all other settings. Do not add duplicate ai or ai_analysis sections. Replace both the model ID and API key placeholders before use.
ai:
  model: "openai/YOUR_CHAT_MODEL"
  api_key: "<DeepSider API Key>"
  api_base: "https://www.deepsiderapi.com/v1"

ai_analysis:
  enabled: true
Model ID
Keep openai/ and replace YOUR_CHAT_MODEL with an exact Chat Completions model ID available to your key. Match its case, punctuation, and version. Image and video models are unsuitable for news analysis.
API base URL
Use the www address above with a single /v1 suffix. Do not append /chat/completions. The endpoint follows the official quickstart.
VolcenginePartner
Volcengine Ark supports both an OpenAI-compatible endpoint and LiteLLM provider mode. Both use an Ark API key:
Integration modeai.model / AI_MODELai.api_base / AI_API_BASE
OpenAI-compatible (recommended)openai/doubao-seed-2-1-pro-260628https://ark.cn-beijing.volces.com/api/v3
LiteLLM Volcengine (fallback)volcengine/doubao-seed-2-1-pro-260628Empty (uses the default endpoint)
The example uses Doubao Seed 2.1 Pro. You may replace it with another exact model ID from the console, such as deepseek-v4-flash-260425, or with an Endpoint ID for a custom inference endpoint. Use an Ark API key, not an IAM Access Key / Secret Key pair.
This integration guide is sponsored by Volcengine.Partnership details and offer

Optional configuration

The settings below all have sensible defaults and usually don't need to be changed. If you have special needs (for example using a proxy or adjusting the output length), set them as needed.
Optional settings
Configuration fieldDefaultDescription
ai.api_baseEmptyAPI base URL; follow the service docs on whether /v1 is required, never append /chat/completions; AI_API_BASE can override it
ai.temperature1.0Sampling temperature (0-2); configurable only in config.yaml
ai.max_tokens5000Maximum generated tokens; set to 0 to omit max_tokens from the provider request
ai.timeout120Request timeout in seconds; AI_TIMEOUT can override it
ai.num_retries1Retries after a failed request; configurable only in config.yaml
ai.fallback_models[]Backup models tried in order when the primary model fails
ai_analysis section settings
The following settings are configured in the ai_analysis section of config.yaml, controlling the content and scope of the analysis report.
Configuration fieldDefaultDescription
languageChineseOutput language of the analysis report
max_news_for_analysis150Maximum number of news items included in the analysis (controls token cost)
include_rssfalseWhether to include RSS content in the analysis
include_standalonetrueWhether to include standalone display section data
include_rank_timelinetrueRank timeline detail level (true = full trajectory, false = simplified format to save tokens)

Push modes

Once AI analysis is enabled, you can choose what the push message contains:
The push message contains both the news list and the AI analysis report. This is the default mode and suits most users.
push:
  mode: both    # news list + AI analysis report

Analysis modes

AI analysis supports four modes, each with a different analysis scope. In timeline.yaml, every time period can set its own analysis mode independently — for example, incremental analysis in the morning and a full-day summary in the evening.
ModeAnalysis scopeBest for
follow_reportFollows the current push contentAutomatically follows the value of report.mode. For example, when report.mode=daily the AI analyzes the full day's data; when report.mode=incremental it only analyzes new content
dailyThe full day's dataGreat for an evening recap of the whole day's trending topics
currentA snapshot of the current rankingsAnalyzes what is hot across platforms right now
incrementalNew entries onlyAnalyzes only what is new since the last push
# Set a different analysis mode per time period in timeline.yaml
periods:
  morning:
    start: "08:00"
    end: "10:00"
    analysis: incremental    # morning: analyze new content only

  evening:
    start: "19:00"
    end: "21:00"
    analysis: daily           # evening: recap the whole day's trends

Customizing the analysis prompt

You can adjust the style and angle of the AI analysis by editing the prompt file. Edit config/ai_analysis_prompt.txt to customize the AI's persona and analysis style.