Bir sonraki

$0 Financial AI: Scraping Live Yahoo Finance with Local LLM & Pydantic

0 Görünümler· 10/27/26
nimda
nimda
1 Aboneler
1
İçinde

Welcome to Lab 4 of our Local Agentic AI Masterclass! In this series finale, we give our local Gemma 3 (4B) model access to the open web to build StockAgent — an autonomous financial market screener and investment copilot.

Commercial financial APIs charge hundreds or thousands of dollars a month, while traditional stock screeners trap you in rigid dropdown menus. In this tutorial, we build a 100% local, zero-cost financial copilot that scrapes live market data directly from Yahoo Finance, enforces an automated Penny Stock Purge ( $5 share price, $1B market cap), and generates institutional-grade investment memos with verified catalysts and stop-loss levels.

Crucially, we solve one of the biggest hidden traps in LLM development: Date Hallucination. Learn how our Temporal Grounding architecture anchors Gemma 3 to the live hardware clock, eliminating stale dates forever.

📥 DOWNLOAD THE FREE JUPYTER NOTEBOOK:
Follow along step-by-step with the exact code used in this video:
👉 https://github.com/MysteryByte....s-Labs/agentic_ai/bl

---

⏱️ TIMESTAMPS / CHAPTERS:
00:00 - Introduction to StockAgent & Zero-Cost Financial AI
00:54 - Traditional Screeners vs. Autonomous Financial Copilots
01:18 - 3-Phase Execution Architecture (Routing, Scraping, Synthesis)
02:18 - Environment Setup: BeautifulSoup, Ollama & Hardware Clock
03:09 - Eliminating Financial Hallucinations with Pydantic
03:56 - YahooScraperParams Schema (Literal & Boundary Bounds)
04:48 - Master Routing Contract: The StockAgentDecision Schema
05:18 - Compiling Master Decision Schema for Constrained Decoding
06:21 - The Date Hallucination Problem: Why Pretrained LLMs Guess 2023
07:55 - Modular Helper Primitives: Price, MCap Normalization & Purge
08:49 - Live Yahoo Finance Scraper & Hardware Clock Injection
09:41 - Orchestrating the 3-Phase run_stock_agent() Execution Engine
10:14 - Compiling Autonomous Loop with Triple-Injection Prompting
11:23 - Scenario 1 Benchmark: Live Most Active Screen ($5 Purged)
11:47 - Live Execution 1: NVDA, AGNC & Top-3 Investment Memo
13:00 - Scenario 2 Benchmark: Top Percentage Gainers ($10 & $2B Floor)
13:21 - Live Execution 2: Momentum Plays & Adaptive Pydantic Bounds
14:06 - Scenario 3 Benchmark: Conceptual Inquiry into Penny Stock Risk
14:28 - Live Execution 3: Grounded Explanation of Slippage & Manipulation
15:19 - Summary & Roadmap: Preview of Lab 5 Multi-Agent Trading
15:47 - Lab 4 Verification & 100% Schema Compliance Check
16:12 - Deep Dive: First Principles of Temporal Grounding in Local LLMs
17:12 - Final Verification Benchmark: Date Confirmation & System Safeguards

---

💡 WHAT YOU WILL BUILD & LEARN:
1. $0 Market Data: Extracting live HTML market tables from Yahoo Finance using BeautifulSoup4.
2. The 3-Phase Autonomous Architecture: Intent Analysis ➔ Sandboxed Scraping ➔ Financial Synthesis.
3. Solving Date Hallucination: Why frozen LLM weights default to 2023, and how Temporal Grounding injects hardware clock timestamps at ingestion.
4. The Penny Stock Purge: Implementing strict institutional floors (purging tickers $5 price or $1B MCap).
5. Triple-Injection Prompting: Forcing the LLM to preserve real-world timestamps in generated briefings.
6. Generating Top-3 Stock Recommendations complete with financial thesis, catalysts, and stop-loss levels.

---

🛠️ TECH STACK:
- Model: Google Gemma 3 (4B-IT via Ollama)
- Scraping Engine: requests, beautifulsoup4
- Validation & Schemas: Pydantic v2 (BaseModel, Field, Literal)
- Hardware Clock Anchoring: Python datetime
- Host Environment: 100% Local Inference (Apple Silicon Metal / NVIDIA CUDA)

---

🔗 THE FULL 4-PART LOCAL AGENTIC AI SERIES:
◀️ Lab 1: Local Gemma 3 Setup & Token Streaming: https://youtu.be/xbgdVSNG04s
◀️ Lab 2: Pydantic Schemas & Constrained Tool Calling: https://youtu.be/xfMGtXuYGj0
◀️ Lab 3: OpsAgent — Autonomous DevOps & Hardware Copilot: https://youtu.be/0p4uzniuMKw
▶️ Lab 4 (This Video): StockAgent — Autonomous Financial Market Screener
📺 Full Series Playlist: https://www.youtube.com/playli....st?list=PLYQsMDf_uaa

#FinancialAI #StockAgent #Gemma3 #Ollama #Pydantic #WebScraping #Python #AlgorithmicTrading #LocalLLM #OpenSourceAI

Daha fazla göster
Facebook Yorumları

Bir sonraki