Skip to content
Courses/Claude Code + Local AI/Tool calling with local models

Tool calling with local models

When a local agent fails, sometimes the model isn't "dumb": it simply isn't emitting tool calls in the format your runtime expects. The fix starts with small tests and clear traces.

  • Distinguish reasoning failure, parser failure, and permissions failure.
  • Test tools with a minimal case before using real repos.
  • Choose when to use Ollama, Open WebUI, Hermes, MCP, or vLLM.

Layered diagnosis

  • Model: does it know how to follow JSON/tool format?
  • Runtime: do Ollama, Hermes, Open WebUI, or vLLM expect the same format?
  • Parser: does it extract arguments or stick with free text?
  • Permissions: does the tool exist and can it run?
Terminal
Minimal test:
Available tool: get_time({ "timezone": "Europe/Madrid" })

Prompt:
"Use the get_time tool to tell me the time in Madrid.
Don't make up the time. If you can't call the tool, say so."

Expected result:
- structured call to get_time
- valid arguments
- response based on actual output

Common failures

  • The model describes the tool in text but doesn't invoke it.
  • It generates invalid JSON or with made-up fields.
  • The runtime hides the error and it seems like "nothing happens".
  • A quantization or conversion has degraded tool behavior.
  • The tool executes arbitrary code without human review.
Terminal
Checklist:
- Full prompt log
- Tool schema log
- Model output log before parser
- Parsed arguments log
- Actual execution log
- Human approval rule for writes

Official sources

  • Ollama API
  • Open WebUI: Tools & Functions
  • MCP specification: tools
  • Hermes Agent documentation
Complete Aulafy mapSee how this lesson fits without leaving your path.

Complete Aulafy map

How all courses connect

This is not a checklist. Start with the foundation, choose an outcome, and go deeper only when your project needs more control.

  1. 1Understand
  2. 2Apply or build
  3. 3Operate with confidence
01

Choose an application

Turn the foundation into a visible outcome: a website, a business improvement, media, or an interactive experience.

Continue into the technical branch when you need to maintain code, data, or infrastructure.

02

Build with code

Prepare your environment, work with coding agents, and run models while keeping control of your projects.

This branch prepares you to design and operate reliable AI systems.

03

Take systems to production

Combine retrieval, agents, evaluation, security, deployment, and model adaptation when the problem requires it.

You do not need every course: choose the component your system needs and return as it grows.

View full catalogue