Reading the repo
Reading the repo
How to install on Linux
TradingAgents: Multi-Agents LLM Financial Trading Framework
Saved setup from 2 h ago
Will it work on my device?
Then run bash setup.sh. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
git clone https://github.com/TauricResearch/TradingAgents.git cd TradingAgents
Python >=3.11, Docker
sudo apt install python3 python3.11 python3-venv # Debian/Ubuntu # needs Docker Engine: https://docs.docker.com/engine/install/
Fill in secrets: OPENAI_API_KEY, GOOGLE_API_KEY, ANTHROPIC_API_KEY, XAI_API_KEY, DEEPSEEK_API_KEY, DASHSCOPE_API_KEY, DASHSCOPE_CN_API_KEY, ZHIPU_API_KEY
cp .env.example .env
python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
python main.py
pytest
Clone TradingAgents:
git clone https://github.com/TauricResearch/TradingAgents.git
cd TradingAgents
TradingAgents needs Python 3.11 or later. Create a virtual environment in any of your favorite environment managers:
conda create -n tradingagents python=3.13
conda activate tradingagents
Or with uv:
uv venv --python 3.13
source .venv/bin/activate
Install the package and its dependencies (uv pip install . with uv):
pip install .
Alternatively, run with Docker:
cp .env.example .env # add your API keys
docker compose run --rm tradingagents
After updating the repository, rebuild the image with docker compose build.
Results, reports, the memory log and the cache live in the tradingagents_data volume. To keep them in a folder on the host instead, create the folder and point TRADINGAGENTS_DATA_DIR at it, in .env or the shell: mkdir -p data && TRADINGAGENTS_DATA_DIR=./data docker compose run --rm tradingagents.
For local models with Ollama:
docker compose --profile ollama run --rm tradingagents-ollama
TradingAgents supports multiple LLM providers. Set the API key for your chosen provider:
export OPENAI_API_KEY=... # OpenAI (GPT)
export GOOGLE_API_KEY=... # Google (Gemini)
export ANTHROPIC_API_KEY=... # Anthropic (Claude)
export XAI_API_KEY=... # xAI (Grok)
export DEEPSEEK_API_KEY=... # DeepSeek
export DASHSCOPE_API_KEY=... # Qwen (international, dashscope-intl.aliyuncs.com)
export DASHSCOPE_CN_API_KEY=... # Qwen (China, dashscope.aliyuncs.com)
export ZHIPU_API_KEY=... # GLM via Z.AI (international)
export ZHIPU_CN_API_KEY=... # GLM via BigModel (China, open.bigmodel.cn)
export MINIMAX_API_KEY=... # MiniMax (global, api.minimax.io)
export MINIMAX_CN_API_KEY=... # MiniMax (China, api.minimaxi.com)
export OPENROUTER_API_KEY=... # OpenRouter
export MISTRAL_API_KEY=... # Mistral
export MOONSHOT_API_KEY=... # Kimi (Moonshot)
export GROQ_API_KEY=... # Groq
export NVIDIA_API_KEY=... # NVIDIA NIM
export FRED_API_KEY=... # FRED macro data (free, optional)
export ALPHA_VANTAGE_API_KEY=... # Alpha Vantage
export TYPESAFE_API_KEY=... # Jev social-post screening (optional)
For Azure OpenAI, copy .env.enterprise.example to .env.enterprise and fill in your credentials. With Docker, put these keys in .env instead: the image does not include .env files.
To run on your ChatGPT Plus or Pro plan instead of an API key, choose "Subscription" in the CLI's provider menu, or set llm_provider: "chatgpt". Sign in once with tradingagents login chatgpt: it prints an address to open in your browser, which returns to this machine on 127.0.0.1. When the browser runs on another machine, or TradingAgents runs in Docker (docker compose run --rm tradingagents login chatgpt), paste the address the browser ends up on. The sign-in is kept in ~/.tradingagents/chatgpt-auth.json, and tradingagents logout chatgpt revokes it. Runs count toward your plan's usage limits, and the plan does not accept temperature or max_tokens.
For AWS Bedrock, install the extra with pip install ".[bedrock]", set llm_provider: "bedrock", configure AWS credentials (environment variables, ~/.aws/credentials, or an IAM role) and AWS_DEFAULT_REGION, and use a Bedrock model ID, e.g. us.anthropic.claude-opus-5-5.
For local models, configure Ollama with llm_provider: "ollama". The default endpoint is http://localhost:11434/v1; set OLLAMA_BASE_URL to point at a remote ollama-serve. Pull models with ollama pull <name>, and pick "Custom model ID" in the CLI for any model not listed by default.
For any other OpenAI-compatible server (vLLM, LM Studio, llama.cpp, or a custom relay), use llm_provider: "openai_compatible" and set the endpoint via backend_url (or TRADINGAGENTS_LLM_BACKEND_URL), e.g. http://localhost:8000/v1 for vLLM or http://localhost:1234/v1 for LM Studio. The model is whatever your server serves. No key is needed for local servers; set OPENAI_COMPATIBLE_API_KEY when the endpoint requires one.
With TYPESAFE_API_KEY set, the Sentiment Analyst screens StockTwits and Reddit posts with TypeSafe's Jev before reading them. Posts that are not about the company are dropped, and each source opens with a count of the remaining posts by stance: bullish, bearish, neutral, or unclear. Without the key, posts pass through unscreened. jev-latest moves with new releases; set TYPESAFE_DEFAULT_MODEL to a versioned ID such as jev-1.13.0 to hold it fixed across runs. To reach Jev through OpenRouter, put an OpenRouter key in TYPESAFE_API_KEY and set TYPESAFE_BASE_URL=https://openrouter.ai/api.
Alternatively, copy .env.example to .env and fill in your keys:
cp .env.example .env
…
No reports for Linux yet.
Opens a chat with this manual already filled in, for Linux. It uses your own account; gitmanual sends nothing.