Categories

Intermediate

Self-hosted Agentic Models and Tool Calling

Run tool-calling models on your own hardware: Nous Hermes 3 and 4, Qwen-Agent, function calling with Ollama, which open models support tools, and the structured-output libraries Instructor, Outlines and DSPy.

  • 8 resources
  • ~65 min read
  1. Nous Hermes 3: an open-weight agentic model

    Hermes 3 is Nous Research's family of open-weight models, fine-tuned on Llama 3.1 in 8B, 70B and 405B sizes. Its strength is tool use through JSON-formatted function calls. You can run it on your own machine with Ollama or vLLM and give it agentic capabilities without depending on a paid API.

    • 8 min
  2. Nous Hermes 4: The Agentic Model with Hybrid Reasoning

    Hermes 4 is the family of open-weight models Nous Research released in August 2025, in 14B, 70B and 405B parameter sizes. Its headline change is hybrid reasoning: one model answers directly or deliberates with think tags before replying, and it keeps the Hermes tool-calling format for agents.

    • 8 min
  3. Qwen-Agent: tool use with Qwen models

    Qwen-Agent is the Qwen team's official framework for giving their models tools: function calling, a sandboxed code interpreter, RAG and MCP. It is on version 0.0.34, released in February 2026, has around 16,800 GitHub stars and holds the canonical implementation of Qwen3 tool calling, both in the cloud and on your own machine.

    • 8 min
  4. Function calling with Ollama on your own machine

    Function calling lets a model you run with Ollama on your own machine ask your code to call a function (check the weather, query a database) and use the result to answer. Ollama has supported tools since July 2024; in 2026 models such as qwen3 and llama3.3 do it with reasonable reliability.

    • 8 min
  5. Open models with tool calling: which to choose

    Not every open model calls tools equally well: the Qwen3 family, Nous Hermes, Llama 3.1 and Mistral stand out because they were trained for it. To choose, check the Berkeley Function-Calling Leaderboard, make sure a parser exists for the model's template, and match it to your GPU's VRAM.

    • 9 min
  6. Instructor: reliable structured outputs

    Instructor is the most widely used Python library for getting reliable structured outputs from a language model: you define the result you expect as a Pydantic model, Instructor patches the client so the model honours it, and it retries on its own, with the validation error included, until it returns a valid, already-typed object.

    • 8 min
  7. Constrained generation with Outlines

    Outlines is a Python library for constrained generation: it forces the model to produce output that conforms to a JSON schema, a regular expression or a grammar, with a guarantee by construction rather than statistics. It works with vLLM, Transformers, Ollama and llama.cpp, and its Rust engine adds barely any overhead per token.

    • 8 min
  8. DSPy: optimizing prompts and LLM programs

    DSPy is a Python framework from Stanford that treats calls to an LLM as code: you define signatures with typed inputs and outputs, pick a module such as chain of thought, and let an optimizer write the prompts for you from examples and a metric. That way you compile programs instead of hand-tuning prompts.

    • 8 min