docker/README.md
This is a proof of concept for an AI-powered hedge fund. The goal of this project is to explore the use of AI to make trading decisions. This project is for educational purposes only and is not intended for real trading or investment.
This system employs several agents working together:
Note: the system does not actually make any trades.
This project is for educational and research purposes only.
By using this software, you agree to use it solely for learning purposes.
Before you can run the AI Hedge Fund, you'll need to install it and set up your API keys. These steps are common to both the full-stack web application and command line interface.
git clone https://github.com/virattt/ai-hedge-fund.git
cd ai-hedge-fund
Create a .env file for your API keys:
# Create .env file for your API keys (in the root directory)
cp .env.example .env
Open and edit the .env file to add your API keys:
# For running LLMs hosted by openai (gpt-4o, gpt-4o-mini, etc.)
OPENAI_API_KEY=your-openai-api-key
# For getting financial data to power the hedge fund
FINANCIAL_DATASETS_API_KEY=your-financial-datasets-api-key
Important: You must set at least one LLM API key (e.g. OPENAI_API_KEY, GROQ_API_KEY, ANTHROPIC_API_KEY, or DEEPSEEK_API_KEY) for the hedge fund to work.
Financial Data: Data for AAPL, GOOGL, MSFT, NVDA, and TSLA is free and does not require an API key. For any other ticker, you will need to set the FINANCIAL_DATASETS_API_KEY in the .env file.
For users who prefer working with command line tools, you can run the AI Hedge Fund directly via terminal. This approach offers more granular control and is useful for automation, scripting, and integration purposes.
Make sure you have Docker installed on your system. If not, you can download it from Docker's official website.
Navigate to the docker directory:
cd docker
# On Linux/Mac:
./run.sh build
# On Windows:
run.bat build
# Navigate to the docker directory first
cd docker
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA main
# On Windows:
run.bat --ticker AAPL,MSFT,NVDA main
You can also specify a --ollama flag to run the AI hedge fund using local LLMs.
# With Docker (from docker/ directory):
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA --ollama main
# On Windows:
run.bat --ticker AAPL,MSFT,NVDA --ollama main
If you already have an Ollama server running (locally or on your network), point the containers at it instead of starting the bundled instance. You can either pass an explicit base URL or export OLLAMA_BASE_URL before running the scripts.
# Linux / macOS
./run.sh --ticker AAPL,MSFT,NVDA --ollama --ollama-base-url http://localhost:11434 main
# Windows
run.bat --ticker AAPL,MSFT,NVDA --ollama --ollama-base-url http://localhost:11434 main
When OLLAMA_BASE_URL is provided, the Docker compose services reuse that endpoint and the Ollama container is not started. To launch the embedded Ollama service manually with Docker Compose, add the embedded-ollama profile (e.g. docker compose --profile embedded-ollama up).
You can optionally specify the start and end dates to make decisions for a specific time period.
# With Docker (from docker/ directory):
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-03-01 main
# On Windows:
run.bat --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-03-01 main
# Navigate to the docker directory first
cd docker
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA backtest
# On Windows:
run.bat --ticker AAPL,MSFT,NVDA backtest
Example Output:
You can optionally specify the start and end dates to backtest over a specific time period.
# With Docker (from docker/ directory):
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-03-01 backtest
# On Windows:
run.bat --ticker AAPL,MSFT,NVDA --start-date 2024-01-01 --end-date 2024-03-01 backtest
You can also specify a --ollama flag to run the backtester using local LLMs.
# With Docker (from docker/ directory):
# On Linux/Mac:
./run.sh --ticker AAPL,MSFT,NVDA --ollama backtest
# On Windows:
run.bat --ticker AAPL,MSFT,NVDA --ollama backtest
Important: Please keep your pull requests small and focused. This will make it easier to review and merge.
If you have a feature request, please open an issue and make sure it is tagged with enhancement.
This project is licensed under the MIT License - see the LICENSE file for details.