Mini Agent
Mini Agent is a minimal AI agent example built with nothing but Python, the OpenAI SDK and a while loop, written to accompany a blog article series that explains how agent frameworks work under the hood.
The agent calls tools when needed, observes their results, and loops until it produces a final answer, in three selectable modes: a fully local mode using only an Ollama model, a fully remote mode using a cloud provider such as OpenAI, Anthropic or Gemini, and a mixed mode where the local model orchestrates the loop and delegates complex subtasks to a remote model through its own helper function.
In mixed mode, simple tool calls such as arithmetic or getting the date stay local, while knowledge-heavy questions are delegated to the remote model, illustrating a concrete cost and capability trade-off rather than only a coding pattern.
It requires a Python virtual environment and, for local or mixed modes, a running Ollama installation with a function-calling-capable model pulled locally.