Skip to content

Repository files navigation

ETF Portfolio AI Agent Demo

A fully local demo for a financial AI system internship.

It includes:

  • FastAPI backend
  • SQLite local database
  • Portfolio and ETF API tools
  • LM Studio local LLM integration
  • OpenAI-compatible function calling
  • Streamlit dashboard
  • Swagger / OpenAPI docs
  • Windows 11 scripts
  • Optional Docker Compose

Architecture

User
-> Streamlit Dashboard
-> FastAPI Backend
-> SQLite Local DB
-> Portfolio / ETF / Rebalance Tools
-> LM Studio Local LLM
-> Final answer + visible tool calls

Demo URLs

FastAPI Swagger: http://localhost:8000/docs
Dashboard:       http://localhost:8501
LM Studio API:   http://localhost:1234/v1

Demo token

Use this in Swagger Authorize:

Bearer demo-token

Run on Windows 11

See RUN_WINDOWS.md for full step-by-step instructions.

Quick version:

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\scripts\install_windows.ps1
.\scripts\run_backend_windows.ps1

Open another PowerShell:

.\scripts\run_dashboard_windows.ps1

Then open:

http://localhost:8501

Good demo questions

我個 portfolio 有咩風險?
QQQ 同 SPY 邊個近期表現好啲?
SPY 最新價係幾多?
幫我建議一個 rebalance plan,要講原因。

Demo flow for video recording

  1. Open LM Studio and start local server on port 1234.
  2. Start FastAPI backend.
  3. Start Streamlit dashboard.
  4. Click Seed / Reset Demo Data.
  5. Show Portfolio Dashboard.
  6. Show ETF Data tab.
  7. Ask the AI Agent: 我個 portfolio 有咩風險?
  8. Show answer, tool calls, and tool results.
  9. Open Swagger docs and show API routes.

Optional Docker run

If you use Docker Desktop:

docker compose up --build

Docker backend uses:

LM_STUDIO_BASE_URL=http://host.docker.internal:1234/v1

So LM Studio should still run on your Windows host machine.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages