How jason8745/llm-stock-analyzer works
Project type and purpose
• This is a backend API service (“llm-stock-analyzer”) providing LLM-powered stock analysis via HTTP endpoints.
• It uses FastAPI for the API layer, LangChain for LLM orchestration, Pydantic for validation, and integrates with YFinance, Shioaji, and an LLM provider.
File structure
• Top-level:
• app/ – application code
• tests/ – pytest test suite
• .github/ – CI config
• Makefile, pyproject.toml – build and dependency management
• app/ subdirectories:
• api/v1/endpoints.py – HTTP endpoints (LLM analysis, health)
• configs/ – config loader (YAML + Pydantic)
• internal/ – core implementation:
– analysis/indicators.py – indicator functions
– llm/chain.py – LangChain prompt/response chaining
– shioaji/stock_data.py – TW market data adapter
– yfinance/stock_data.py – global market data adapter
• services/analysis/ – business logic and pipelines:
– stock_trend_pipeline.py – data enrichment with indicators
– trend_analysis.py – generate buy/sell signals
• prompts/ – versioned prompt templates for the LLM
• utils/logger.py – structured logging via Loguru
• No persistent database; external dependencies are real-time data APIs and an LLM service.
README for additional insights
• Confirms layered, modular architecture
• Highlights key frameworks: FastAPI, LangChain, Pydantic, YFinance, Shioaji
• Mentions CI pipeline (lint, type check, tests)