Deploy TradingAgents

Run LLM analyst, researcher and risk agents on any stock ticker.

Deploy TradingAgents

/data

Deploy and Host TradingAgents on Railway

TradingAgents logo

TradingAgents is an open source multi-agent LLM framework for stock analysis from Tauric Research. It models a small trading firm: analyst agents study fundamentals, news, sentiment and technical indicators; bullish and bearish researchers debate the findings; a trader drafts a plan; and a risk team and portfolio manager settle on a final rating such as Buy, Hold or Sell, with every report kept. It works with OpenAI, Anthropic Claude, Google Gemini, xAI Grok, DeepSeek, OpenRouter and any OpenAI-compatible endpoint, and pulls market data from Yahoo Finance or Alpha Vantage. The framework is Apache-2.0 licensed with about 122,000 GitHub stars, and v0.7.1 shipped in October 2026. This template wraps it in a small FastAPI server with a web form, live logs and downloadable reports, plus a volume for results, cache and agent memory. Hosting costs about $5/month on Railway plus the LLM tokens each run uses. It is a research tool, not financial advice.


What This Template Deploys

ServicePurpose
TradingAgentsPython 3.12 image built from a Railway wrapper that installs TradingAgents from upstream main. FastAPI server and web UI on port 8000 with a public domain. Health check on /health.
Persistent VolumeMounted at /data. Holds decision logs and full JSON reports in /data/logs, the market data cache in /data/cache, the agents' memory file in /data/memory, and the job list, so history survives redeploys.

Important: The Web UI Has No Login

Read this before adding any keys. The wrapper's web page and API are public and have no password. Anyone who finds your Railway URL can start analyses, see past jobs and read their reports.

If you set a provider key such as OPENAI_API_KEY as a variable, any visitor can run analyses on your account. A visitor can also send a custom base URL with a request, which makes the server send that key to a server they control.

The safe way to run it: leave every provider key variable empty and paste your key into the form's API key field for each run. That key is held in memory only while that run is going and is not written to disk. Keep the domain private, and remove the public domain in Settings when you are not using it. For a shared or long-running setup, put an authenticating proxy in front of the service.


About Hosting TradingAgents

A single chatbot prompt about a stock gives you one opinion. TradingAgents splits the job into roles and makes them argue, which surfaces risks a single answer often skips.

Analyst team. The fundamentals analyst reads financial statements and filings, the sentiment analyst gauges social and news mood, the news analyst follows company and macro events, and the market analyst computes indicators such as MACD, RSI and moving averages. You choose which analysts run.

Researcher debate. A bull and a bear researcher argue over the analyst reports for as many rounds as you set, and a research manager writes the investment plan.

Trader and risk team. The trader turns the plan into a proposal. Aggressive, neutral and conservative risk analysts debate it, and the portfolio manager makes the final call.

Two model tiers. A deep-thinking model handles the debates and final decisions, while a cheaper quick model handles data gathering, so you can balance quality and cost.

Memory. The agents keep a decision log on the volume and can learn from how earlier calls played out.

Full reports. Every run stores each agent's report and both debates. The web UI shows them when the job finishes, and you can download the whole run as JSON.


Deploy TradingAgents in Under 5 Minutes

  1. Click Deploy on Railway. Leave the provider key variables empty for now; see the warning above.
  2. Wait for the build and the /health check. The first build takes a few minutes because it installs TradingAgents and its data libraries.
  3. Open the public domain. Pick a provider, paste your API key, enter a ticker such as NVDA and an analysis date.
  4. Choose the deep and quick models, the debate rounds and the analysts, then start the run.
  5. Watch the live log. A run usually takes 3 to 10 minutes, then the rating and full reports appear.

Common Use Cases

  • Second opinion on a stock: see bull and bear cases and a risk review before you do your own research.
  • Model comparison: run the same ticker and date with different LLMs and compare their reasoning and ratings.
  • Research and teaching: show how multi-agent LLM systems debate and reach decisions.
  • Historical case studies: pick a past date to see what the agents would have concluded with the data available then.
  • Automation: call POST /api/analyze from a script or scheduler and fetch the report from the jobs API.

Configuration

VariableRequiredDefaultDescription
OPENAI_API_KEYOptionalemptyOpenAI key. Leave empty on a public URL
ANTHROPIC_API_KEYOptionalemptyAnthropic Claude key
GOOGLE_API_KEYOptionalemptyGoogle Gemini key
XAI_API_KEYOptionalemptyxAI Grok key
DEEPSEEK_API_KEYOptionalemptyDeepSeek key
OPENROUTER_API_KEYOptionalemptyOpenRouter key
ALPHA_VANTAGE_API_KEYOptionalemptyRoutes all market data through Alpha Vantage instead of Yahoo Finance
TRADINGAGENTS_RESULTS_DIROptional/data/logsReports and job history
TRADINGAGENTS_DATA_CACHE_DIROptional/data/cacheMarket data cache
TRADINGAGENTS_MEMORY_LOGOptional/data/memory/trading_memory.mdAgent decision memory
PORTAuto-set8000HTTP port

Choosing models. The form defaults to gpt-4o and gpt-4o-mini. Type any model your provider offers. Stronger deep-thinking models give better debates but cost more per run.

Other providers. Choose custom with a base URL to use Groq, Mistral, vLLM, LM Studio or any OpenAI-compatible server.

Using the API. POST /api/analyze returns a job ID. Poll GET /api/jobs/ID for status, read GET /api/jobs/ID/logs for progress, and fetch GET /api/jobs/ID/report or /report/download when it completes. The same no-login warning applies to every route.


TradingAgents vs. Alternatives

FeatureTradingAgents on RailwayAI stock rating servicesChatGPT chatFinRobot
HostingSelf-hostedHosted SaaSHostedSelf-hosted, code only
LicenseApache-2.0ProprietaryProprietaryApache-2.0
Multi-agent debate✅❌❌✅
Choose your LLM✅❌❌✅
Full reasoning reports✅Scores onlyOne answer✅
Web UI✅ via wrapper✅✅❌
PriceAbout $5/month plus tokensMonthly subscriptionSubscriptionYour compute plus tokens

Rating services give quick scores without showing their reasoning. A chat assistant gives one answer with no structured debate. FinRobot is a capable open source agent platform but has no ready web app.


Dependencies for TradingAgents Hosting

  • A Railway account.
  • An API key from at least one LLM provider. Alpha Vantage is optional; Yahoo Finance needs no key.

Deployment Dependencies

Implementation Details

The Dockerfile installs TradingAgents from the upstream main branch at build time, so each rebuild picks up the newest code. That brings fixes, but a breaking upstream change can also break a build. Jobs run in the background on one worker; the UI polls for progress and logs. The server keeps the newest 100 jobs. Reports for finished runs are written to the volume.


Frequently Asked Questions

What is TradingAgents? An Apache-2.0 multi-agent LLM framework from Tauric Research that analyzes a stock with analyst, researcher, trader and risk agents.

How much does it cost to run? About $5/month on Railway, plus LLM tokens for each run, which depend on the models and debate rounds you choose.

Is my API key safe? Only if you paste it in the form per run and leave the key variables empty. The UI has no login, so keys stored as variables can be used by anyone with the URL.

Does TradingAgents place real trades? No. It produces a rating and reports. It is a research tool, not financial advice.

Which data sources does it use? Yahoo Finance by default. Set ALPHA_VANTAGE_API_KEY to route market, fundamentals and news data through Alpha Vantage.

How long does one analysis take? Usually 3 to 10 minutes, depending on the models, analysts and debate rounds.


Why Deploy and Host TradingAgents on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying TradingAgents on Railway, you get a multi-agent AI stock research lab with any LLM provider, saved reports and live logs, without installing Python locally.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1