An open-source, enterprise-grade financial market intelligence assistant powered by the IBM Granite 4.2 dense reasoning model family. Demonstrates native agentic tool calling by passing function schemas to Ollama, dynamically routing model-emitted tool requests, and fetching live stock data via Yahoo Finance.
| Step 1: User Request | Step 2: Native Tool Call Emission | Step 3: Dynamic API Routing |
|---|---|---|
| User inputs stock query | Model emits tool_calls JSON |
Executes tools & synthesizes response |
- 🧠 Dynamic Chain-of-Thought Reasoning: Uses IBM Granite 4.2 adjustable thinking toggle to step through multi-turn logic before taking actions.
- 🛠️ Native Ollama Agentic Tool Loop: Passes JSON function schemas directly to Ollama
/api/chatand dynamically executestool_callsreturned by the model. - 📈 Real-Time Financial Intelligence: Integrates live stock quote APIs (Yahoo Finance) for price, 52-week metrics, and 5-day return calculations.
- 💻 100% Local PC Privacy: Runs dense GGUF models locally on consumer GPUs and laptops via Ollama.
- ⚡ Lightweight Hardware Footprint: 3B Q4 model uses only 2.24 GB RAM/VRAM for instant local execution.
| Model Size | Quantization (Q4_K_M) | Minimum RAM / VRAM | Recommended Hardware Setup |
|---|---|---|---|
| IBM Granite 4.2 3B | ~2.24 GB | 4 GB VRAM / 8 GB RAM | Laptops, budget PCs, integrated graphics, edge devices |
| IBM Granite 4.2 8B | ~5.30 GB | 8 GB VRAM / 16 GB RAM | Mid-range GPUs (RTX 3060/4060) & MacBooks (16GB) |
| IBM Granite 4.2 30B | ~18.50 GB | 24 GB VRAM / 32 GB RAM | High-end GPUs (RTX 3090/4090) & Mac Studio (32GB+) |
| Quantization Variant | File Size | Recommended Target | Target Hardware Setup |
|---|---|---|---|
granite-4.2-3b-Q2_K.gguf |
1.46 GB | 2 GB RAM | Edge microcontrollers & mobile devices |
granite-4.2-3b-Q3_K_M.gguf |
1.84 GB | 3 GB RAM | Low-spec laptops & integrated GPUs |
granite-4.2-3b-Q4_K_M.gguf |
2.24 GB | 4 GB VRAM / 8 GB RAM | Recommended local setup (Default) |
granite-4.2-3b-Q5_K_M.gguf |
2.61 GB | 4 GB VRAM / 8 GB RAM | High-precision local inference |
granite-4.2-3b-Q8_0.gguf |
3.89 GB | 6 GB VRAM / 16 GB RAM | Near-lossless FP16 quality testing |
granite-4.2-3b-bf16.gguf |
7.32 GB | 10 GB VRAM | Unquantized reference evaluation |
Granite 4.2/
├── models/
│ └── granite-4.2-3b-Q4_K_M.gguf
├── Modelfile
├── main.py
└── README.md
Download the recommended Q4_K_M model weight into the models/ directory:
curl.exe -L -o models/granite-4.2-3b-Q4_K_M.gguf "https://huggingface.co/ibm-granite/granite-4.2-3b-GGUF/resolve/main/granite-4.2-3b-Q4_K_M.gguf"Create the local Ollama model instance using the included Modelfile:
ollama create granite4.2:3b -f ModelfileRun the main agent execution script:
python main.pyThe output report will be automatically generated inside outputs/outputs.md.
- 📈 Stock Market Intelligence Agent: Analyzes live ticker quotes, 52-week ranges, and relative performance ratios between stocks.
- 📊 Financial Portfolio Researcher: Evaluates market cap, P/E ratios, and earnings momentum with step-by-step CoT reasoning.
- ⚙️ Automated System Diagnostics: Calls local CLI tools, monitors memory, and suggests performance tweaks.
- 📬 Email & Schedule Manager: Parses incoming calendar requests and coordinates meeting times across global timezones.
- 🔍 Web Search & Fact Checker: Queries web APIs to verify breaking news with step-by-step logic.
- 🎛️ Granular CoT Effort Dial: Add a CLI switch to toggle between High, Low, and Disabled reasoning modes at runtime.
- 🔄 Multi-Turn Agent Memory: Support stateful multi-step conversations with local vector storage.
- 📦 Multi-Model Routing: Automatically dispatch simple tasks to 3B and complex logic to the 30B variant.
- 🌐 Extended Web Search Tool: Integrate Brave or DuckDuckGo search APIs for live web browsing.
- 📱 Mobile Edge Deployment: Package the 3B Q2 model variant for direct execution on Android and iOS devices.
IBM Granite 4.2 Open Source LLM Adjustable Thinking Local AI Model Ollama Tool Calling Reasoning Model Chain of Thought Dense Reasoning Model Apache 2.0 AI Stock Market AI Agent