AlgoGPT is an open-source LLM model train on Indian Derivative and Equity market data.
Python
1
63 commits
updated Oct 15, 2026
AlgoGPT is the first open-source model for financial candlesticks (K-lines). Built with Kronos open-source foundation model. Trained on data from NSE & BSE.
NeoQuasar/Kronos-small & Kronos-Tokenizer-base) with continuous BSQ candlestick tokenization, multi-step autoregressive price path generation, and systematic options derivative backtesting with risk metrics (Sharpe Ratio, Alpha, Max Drawdown).algogpt/
├── model/ # Kronos foundation model (tokenizer, model, predictor)
├── data/ # Data fetching & dataset creation for Indian derivatives
├── training/ # Finetuning pipelines (tokenizer + predictor)
├── trading/ # Feature engineering, signals, backtesting
├── main.py # Main trading pipeline entry point
├── quickstart.py # Quick test with Yahoo Finance
└── requirements.txt # Dependencies
# Install dependencies
pip install -r requirements.txt
# Run quick test (uses Yahoo Finance for NIFTY daily data)
python quickstart.py
| Source | Description | Setup |
|---|---|---|
csv | Local CSV files in ./data/ | Place {SYMBOL}_5min.csv files |
yahoo | Yahoo Finance (free, daily/intraday) | No setup needed |
upstox | Upstox API (live + historical) | Requires API credentials |
nse | NSE via nsepython (daily only) | pip install nsepython |
# Download NIFTY/BANKNIFTY 5min data to ./data/
# Or use Upstox API with credentials
Edit training/config.py or use environment variables:
export SYMBOLS="NIFTY,BANKNIFTY"
export DATA_SOURCE="csv"
export DATA_DIR="./data"
export INTERVAL="5min"
export START_DATE="2020-01-01"
export END_DATE="2024-12-31"
export PREDICTOR_EPOCHS=30
export BATCH_SIZE=50
# Tokenizer finetuning (run first)
torchrun --standalone --nproc_per_node=1 training/train_tokenizer.py
# Predictor finetuning (uses finetuned tokenizer)
torchrun --standalone --nproc_per_node=1 training/train_predictor.py
For multi-GPU:
torchrun --standalone --nproc_per_node=4 training/train_predictor.py
from algogpt.model import KronosPredictor
predictor = KronosPredictor.from_local(
model_path="./outputs/models/finetune_predictor_indian/checkpoints/best_model",
tokenizer_path="./outputs/models/finetune_tokenizer_indian/checkpoints/best_model",
)
# Basic backtest on NIFTY
python main.py --symbol NIFTY --start 2023-01-01 --end 2024-06-01
# With Upstox data
python main.py --symbol BANKNIFTY --data-source upstox \
--upstox-api-key YOUR_KEY --upstox-api-secret YOUR_SECRET \
--upstox-access-token YOUR_TOKEN
# Using finetuned model
python main.py --model ./outputs/models/finetune_predictor_indian/checkpoints/best_model \
--tokenizer ./outputs/models/finetune_tokenizer_indian/checkpoints/best_model
algogpt/model/)algogpt/data/)algogpt/training/)algogpt/trading/)| Symbol | Lot Size | Expiry | Tick Size |
|---|---|---|---|
| NIFTY | 50 | Thursday | 0.05 |
| BANKNIFTY | 15 | Wednesday | 0.05 |
| FINNIFTY | 40 | Tuesday | 0.05 |
| MIDCPNIFTY | 75 | Monday | 0.05 |
Time features: minute, hour, weekday, day, month (IST timezone)
All configs use Python dataclasses with:
export PARAM=value)__post_init__MIT License - See LICENSE file for details.
AlgoGPT is an open-source LLM model train on Indian Derivative and Equity market data.
Python
1
63 commits
updated Oct 15, 2026
AlgoGPT is the first open-source model for financial candlesticks (K-lines). Built with Kronos open-source foundation model. Trained on data from NSE & BSE.
NeoQuasar/Kronos-small & Kronos-Tokenizer-base) with continuous BSQ candlestick tokenization, multi-step autoregressive price path generation, and systematic options derivative backtesting with risk metrics (Sharpe Ratio, Alpha, Max Drawdown).algogpt/
├── model/ # Kronos foundation model (tokenizer, model, predictor)
├── data/ # Data fetching & dataset creation for Indian derivatives
├── training/ # Finetuning pipelines (tokenizer + predictor)
├── trading/ # Feature engineering, signals, backtesting
├── main.py # Main trading pipeline entry point
├── quickstart.py # Quick test with Yahoo Finance
└── requirements.txt # Dependencies
# Install dependencies
pip install -r requirements.txt
# Run quick test (uses Yahoo Finance for NIFTY daily data)
python quickstart.py
| Source | Description | Setup |
|---|---|---|
csv | Local CSV files in ./data/ | Place {SYMBOL}_5min.csv files |
yahoo | Yahoo Finance (free, daily/intraday) | No setup needed |
upstox | Upstox API (live + historical) | Requires API credentials |
nse | NSE via nsepython (daily only) | pip install nsepython |
# Download NIFTY/BANKNIFTY 5min data to ./data/
# Or use Upstox API with credentials
Edit training/config.py or use environment variables:
export SYMBOLS="NIFTY,BANKNIFTY"
export DATA_SOURCE="csv"
export DATA_DIR="./data"
export INTERVAL="5min"
export START_DATE="2020-01-01"
export END_DATE="2024-12-31"
export PREDICTOR_EPOCHS=30
export BATCH_SIZE=50
# Tokenizer finetuning (run first)
torchrun --standalone --nproc_per_node=1 training/train_tokenizer.py
# Predictor finetuning (uses finetuned tokenizer)
torchrun --standalone --nproc_per_node=1 training/train_predictor.py
For multi-GPU:
torchrun --standalone --nproc_per_node=4 training/train_predictor.py
from algogpt.model import KronosPredictor
predictor = KronosPredictor.from_local(
model_path="./outputs/models/finetune_predictor_indian/checkpoints/best_model",
tokenizer_path="./outputs/models/finetune_tokenizer_indian/checkpoints/best_model",
)
# Basic backtest on NIFTY
python main.py --symbol NIFTY --start 2023-01-01 --end 2024-06-01
# With Upstox data
python main.py --symbol BANKNIFTY --data-source upstox \
--upstox-api-key YOUR_KEY --upstox-api-secret YOUR_SECRET \
--upstox-access-token YOUR_TOKEN
# Using finetuned model
python main.py --model ./outputs/models/finetune_predictor_indian/checkpoints/best_model \
--tokenizer ./outputs/models/finetune_tokenizer_indian/checkpoints/best_model
algogpt/model/)algogpt/data/)algogpt/training/)algogpt/trading/)| Symbol | Lot Size | Expiry | Tick Size |
|---|---|---|---|
| NIFTY | 50 | Thursday | 0.05 |
| BANKNIFTY | 15 | Wednesday | 0.05 |
| FINNIFTY | 40 | Tuesday | 0.05 |
| MIDCPNIFTY | 75 | Monday | 0.05 |
Time features: minute, hour, weekday, day, month (IST timezone)
All configs use Python dataclasses with:
export PARAM=value)__post_init__MIT License - See LICENSE file for details.