๐Ÿค– Software ยท LARZ-501 · Session 7 of 8

From LLM Calls to AI Agents

Go beyond single LLM calls: build tool-calling agents that can run your Python functions, with the zero-dependency larzagent library.

⏱ 10 min read📅 Updated 2026-07-25📊 Code examples throughout

Calling an LLM is one thing; letting it act โ€” calling your functions to look things up or take steps โ€” is where AI products get useful. The Larz Stack's larzagent gives you that tool-calling loop, zero-dependency, against any OpenAI-compatible API.

Define a tool, run an agent

from larzagent import tool

@tool
def order_status(order_id: str) -> str:
    """Look up an order's status."""
    return db.status(order_id)

# via the framework's contrib adapter:
from larz.contrib import agents
agents.enable(app, base_url='https://gateway.larzpay.com/v1')
app.ask('Where is order 42?', tools=[order_status])   # the model calls it

Takeaways

  • larzagent turns Python functions into tools the model can call, with a defensive agent loop.
  • larz.contrib.agents wires it into your app as app.agent() / app.ask().
  • It works against any OpenAI-compatible API and is testable offline. More in the Larz Stack course.

More in this course

Course home → · Browse all courses →