ibm-granite-community/granite-snack-cookbook

Granite Snack Cookbook -- easily consumable recipes (python notebooks) that showcase the capabilities of the Granite models

What it solves

The Granite Snack Cookbook provides concise, instructional Jupyter notebooks that demonstrate the essential capabilities of IBM Granite models. It helps you quickly learn how to apply these models to real-world tasks without deep research or manual setup, covering everything from simple text processing to complex agent-building and model tuning.

How it works

Each "recipe" is a self-contained notebook focused on a specific feature or workflow. The recipes are organized into categories:

  • Basic Capabilities: summarization, entity extraction, function calling, contract analysis, tool calling, and structured responses (including Pydantic integration).
  • Compound Systems: RAG pipelines (with LangChain, LlamaIndex, Docling, multimodal, and inference scaling), AI agents (ReAct, agentic RAG, travel planner, GitHub agent), Prompt Declaration Language (PDL), Agent Communication Protocol, and Semantic Kernel chat.
  • Model Context Protocol: notebooks for using MCP, including with Pydantic AI.
  • Intrinsic Functions: RAG using Granite's built-in retrieval capabilities (requires >16GB memory).
  • Tuning: fine-tuning Granite models with LlamaFactory and Unsloth.
  • Model Evaluation: evaluating models with Unitxt, including few-shot strategies and using Granite as a judge.
  • Guardian: quick start for Granite Guardian for safety and risk mitigation.

Most notebooks are designed to run in Google Colab with a one-click link; a few require local resources or specific setups (e.g., Ollama, Colab-incompatible).

Who it’s for

Developers, data scientists, and AI practitioners who want to learn how to build applications with IBM Granite models—whether you're starting with basic tasks or exploring advanced patterns like RAG, agents, and fine-tuning. The notebooks are intended as hands-on tutorials that you can adapt to your own projects.

Highlights

  • Covers a wide range of capabilities in one place: from summarization to agentic workflows.
  • Many notebooks run directly in Google Colab with a single click, lowering the entry barrier.
  • Includes both simple examples and compound systems (RAG, AI agents) to show how pieces fit together.
  • Features fine-tuning tutorials using popular tools (LlamaFactory, Unsloth) and evaluation with Unitxt.
  • Shows how to use Granite Guardian for safety and how to integrate Model Context Protocol.

Related

  • Project
  • Project
  • Project
  • Project