Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🌐 IBM Granite 4.2 Reasoning Agent

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

⚡ Key Highlights & Capabilities

  • 🧠 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/chat and dynamically executes tool_calls returned 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 Family Hardware Requirements (3B, 8B & 30B)

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+)

📊 Granite 4.2 3B GGUF Quantization Table

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

📂 File Architecture

Granite 4.2/
├── models/
│   └── granite-4.2-3b-Q4_K_M.gguf
├── Modelfile
├── main.py
└── README.md

🚀 Quickstart & Installation

1. Download Granite 4.2 3B GGUF Model

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"

2. Register Model in Ollama

Create the local Ollama model instance using the included Modelfile:

ollama create granite4.2:3b -f Modelfile

3. Execute the Financial Agent

Run the main agent execution script:

python main.py

The output report will be automatically generated inside outputs/outputs.md.


🎯 5 Practical Use Cases

  1. 📈 Stock Market Intelligence Agent: Analyzes live ticker quotes, 52-week ranges, and relative performance ratios between stocks.
  2. 📊 Financial Portfolio Researcher: Evaluates market cap, P/E ratios, and earnings momentum with step-by-step CoT reasoning.
  3. ⚙️ Automated System Diagnostics: Calls local CLI tools, monitors memory, and suggests performance tweaks.
  4. 📬 Email & Schedule Manager: Parses incoming calendar requests and coordinates meeting times across global timezones.
  5. 🔍 Web Search & Fact Checker: Queries web APIs to verify breaking news with step-by-step logic.

🔮 5 Planned Future Features

  1. 🎛️ Granular CoT Effort Dial: Add a CLI switch to toggle between High, Low, and Disabled reasoning modes at runtime.
  2. 🔄 Multi-Turn Agent Memory: Support stateful multi-step conversations with local vector storage.
  3. 📦 Multi-Model Routing: Automatically dispatch simple tasks to 3B and complex logic to the 30B variant.
  4. 🌐 Extended Web Search Tool: Integrate Brave or DuckDuckGo search APIs for live web browsing.
  5. 📱 Mobile Edge Deployment: Package the 3B Q2 model variant for direct execution on Android and iOS devices.

🏷️ Keywords & SEO Tags

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

About

IBM Granite 4.2: The First 2GB Local AI With Adjustable Thinking! Enterprise open-source dense reasoning models with dynamic CoT toggle and native Ollama tool calling.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages