← All notes

Tool calling with local models: Ollama and llama.cpp

Answer: An Ollama /api/chat request includes tools, each a function with a name, a description and parameters (type, required, properties). The reply carries tool_calls; you run the function and send its result back as a "role": "tool" message with tool_name and content.

llama.cpp server

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: ollama/ollama (GitHub), Tool calling (Ollama docs), MIT (https://raw.githubusercontent.com/ollama/ollama/main/LICENSE). Copyright (c) Ollama; ggml-org/llama.cpp (GitHub), Function calling (llama.cpp docs), MIT (https://raw.githubusercontent.com/ggml-org/llama.cpp/master/LICENSE). Copyright (c) 2023-2026 The ggml authors. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: ollama/ollama (GitHub), Tool calling (Ollama docs), MIT (https://raw.githubusercontent.com/ollama/ollama/main/LICENSE). Copyright (c) Ollama; ggml-org/llama.cpp (GitHub), Function calling (llama.cpp docs), MIT (https://raw.githubusercontent.com/ggml-org/llama.cpp/master/LICENSE). Copyright (c) 2023-2026 The ggml authors.

Cite this

Permanent ID: iil:note:01kp3zsa

iinventedlight. 2026. "Tool calling with local models: Ollama and llama.cpp." iinventedlight Library, iil:note:01kp3zsa, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-tools-ollama-tool-calling/. License: CC-BY-4.0.

@misc{iil_note_01kp3zsa,
  author = {{iinventedlight}},
  title = {{Tool calling with local models: Ollama and llama.cpp}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-16},
  url = {https://iinventedlight.com/library/notes/ao-tools-ollama-tool-calling/},
  note = {Permanent ID iil:note:01kp3zsa. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-tools-ollama-tool-calling.md.