Qwen 3.5 vs Claude Haiku: agent tool calling tutorial

Learn tool search and sandboxed tool calling in a Python agent, with Qwen 3.5 27B tested through Ollama on an RTX 5090 with 32GB VRAM.

Player not loading? Watch on YouTube

This tutorial adds tool search and programmatic tool calling to a custom Python and React AI agent. Tool search defers loading tool definitions until the model needs them. In the presenter's greeting test, this reduces the initial context from about 13,000 to 6,300 tokens. Discovered tools remain available for follow-up questions.

A budget compliance task compares individual tool calls with model-written Python scripts. The traditional Claude Haiku run reports three over-budget employees instead of four after 56 tool calls and about 76,000 tokens. Two sandbox runs find all four, but require code corrections and use about 58,000 and 116,000 prompt tokens. These results do not reproduce Anthropic's reported 85% token saving.

The presenter then tests Qwen 3.5 27B as a local LLM through Ollama, using a 100,000-token context setting and an RTX 5090 with 32GB VRAM. That run returns the expected answer at about 45,000 tokens.

The architecture uses LLM Sandbox with Docker. Generated Python calls tools through a bridge to the backend; the sandbox receives neither API credentials nor direct access to external services. The presenter recommends gVisor for stronger isolation because Docker shares the host kernel. The final section explains how tool-use examples can clarify parameter formats that a JSON schema alone leaves ambiguous. The public repository provides project requirements; the full codebase and course are available through the creator's community.