IBM Granite 4.2: Ollama setup and financial agent tutorial
Learn to set up Granite 4.2 in Ollama and build a Python financial agent using a 3B 4-bit model, stock quotes and five-day momentum calculations.
Player not loading? Watch on YouTube
This tutorial covers IBM Granite 4.2 as a local LLM and walks through a financial AI agent built with Ollama and Python. The presenter describes 3B, 8B and 30B dense models, with adjustable thinking modes for different tasks. High thinking mode spends more time on reasoning; disabled mode answers directly but, according to the speaker, struggles with complex mathematics and logic.
The setup uses a 3B model with 4-bit quantization. The presenter reports a 2.2 GB download and estimates a minimum of 2 GB of VRAM, using a computer with 4 GB for the demonstration. These are the tutorial's stated figures rather than a guarantee for every configuration. A custom Ollama model file loads the downloaded weights.
The Python project registers tools for Yahoo Finance quotes and relative momentum calculations. An OpenAI-compatible tool registry describes each function and its inputs. The agent sends requests to a local Ollama URL and writes tool calls and the final response to Markdown reports. Running python main.py starts the pipeline.
The example compares Nvidia and Apple using five-day returns. Inference runs locally, while the stock data comes from an external API, so this workflow requires network access. The presenter recommends the 8B or 30B versions for more complex workflows; the demonstrated 3B model handles a simple tool-calling task.