Nodes/ComfyUI-Ollama-Describer/πŸ€– Ollama Agent πŸ€–
ComfyUI Node

πŸ€– Ollama Agent πŸ€–

A local ReAct agent that can actually use tools

By alisson-anjosΒ·Created 2 years agoΒ·Updated 5 months agoΒ· 125
πŸ€– Ollama Agent πŸ€–
  • tools
  • result
β—„modelβ–Ύβ–Ί
β—„custom_modelβ–Ί
β—„api_hosthttp://localhost:11434β–Ί
β—„timeout300β–Ί
β—„temperature0.2β–Ί
β—„max_tokens2048β–Ί
β—„system_contextYou are a helpful and intelligent agent. You have access to tools that you can call to answer user queries. IMPORTANT: If the user asks for real-time information (like current time, date, local weather, or web searches), DO NOT refuse or say you do not have access. Instead, use the available tools (like 'search_internet') IMMEDIATELY to find the answer. Always prioritize using tools over guessing or refusing.β–Ί
β—„promptWhat time is it right now?β–Ί
β—„thinkfalseβ–Ί

Every other LLM node in this pack does one thing and returns an answer. This one is different: it's a loop. OllamaAgent implements ReAct-style reasoning - the model can decide mid-answer that it needs more information, call a connected tool to go get it, look at what came back, and keep going until it actually has enough to answer for real. It's the newest addition to the pack (added March 2025) and the one that turns this from "a captioner with extra steps" into something closer to a real local agent.

The default prompt it ships with - "What time is it right now?" - is a deliberate demo of the whole point: a base LLM has no idea what time it is and will either refuse or hallucinate. Give it a Web Search tool and the agent will actually go look it up instead of guessing.

How it works

You give the agent a model, a prompt, and optionally one or more tools wired through tools (build a bundle with OllamaToolCombine if you're using more than one). When the model's response indicates it wants to call a tool, the node executes that tool, feeds the result back into the conversation, and lets the model continue - repeating until it produces a final answer instead of another tool call. This is the same agent loop pattern used across the wider LLM tooling world (function calling, then reading the result back in), just running entirely against your local Ollama server instead of a cloud API.

Not every model handles this well. Tool calling is a specific capability a model needs to be trained for, and the pack's own docs are explicit that this works best with models built for it - Llama 3.1 and Qwen 3.5 are called out by name. Point this node at a small general-purpose model with no tool-calling training and it may just ignore the tools entirely and answer (or hallucinate) directly.

The inputs and outputs that matter

  • model / custom_model - this list leans toward tool-calling-capable models: the Qwen3.5 family (0.8b through 27b, plus cloud variants), Llama 3.1/3.2, Mistral. Pick one actually suited for tool use, not just any chat model.
  • prompt and system_context - the default system_context explicitly instructs the model to prefer using tools over refusing or guessing for real-time queries; keep that instinct if you rewrite it, or the agent may stop reaching for its tools.
  • think (default false) - toggles visible reasoning before the final answer, supported on Qwen3, DeepSeek-R1, DeepSeek-v3.1, and GPT-OSS. Worth enabling on a complex multi-step task with one of those models; leave it off for a straightforward question, since reasoning tokens cost time and context for no benefit on simple asks.
  • tools (optional, OLLAMA_TOOL) - connect any of the pack's tool nodes here directly, or run several through OllamaToolCombine first if you're giving the agent more than one capability.
  • max_tokens (default 2048) - cap on the final response length; note this is separate from how much back-and-forth the agent loop itself can do internally.

Output is a single result STRING - the agent's final answer after however many tool calls it made along the way.

How to install it

Requires Ollama running locally with a tool-calling-capable model pulled (ollama pull llama3.1 or ollama pull qwen3.5 are solid starting points). Get the pack via ComfyUI Manager (search "ComfyUI-Ollama-Describer") or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/alisson-anjos/ComfyUI-Ollama-Describer.git
pip install -r requirements.txt   # or install.bat on Windows

Restart ComfyUI.

Common issues & troubleshooting

Same connection-refused error as the rest of the pack if Ollama isn't running - check that first, always. The failure specific to this node is silent underperformance rather than a crash: the agent runs, returns an answer, but never actually calls the tool you gave it. That's almost always a model-capability issue, not a wiring bug - swap to a model explicitly documented as tool-calling-capable (Llama 3.1, Qwen 3.5) before assuming the graph is broken. If responses are slow, that's the ReAct loop doing its job - each tool call is a full extra round-trip to the model, so a multi-tool-call answer will always take longer than a single describer call, and think mode adds further latency on top of that for the visible reasoning pass.

CategoryOllama/Agent

Inputs (10)

NameTypeDefaultDescription
modelCOMBO20 options: qwen3.5:0.8b (1.0GB), qwen3.5:2b (2.7GB), qwen3.5:4b (3.4GB), qwen3.5:9b (6.6GB), qwen3.5:27b (17GB), qwen3.5:cloud, +14
custom_modelSTRINGβ€”
api_hostSTRINGhttp://localhost:11434β€”
timeoutINT3000–18446744073709550000β€”
temperatureFLOAT0.20–10β€”
max_tokensINT20481–18446744073709550000β€”
system_contextSTRINGYou are a helpful and intelligent agent. You have access to tools that you can call to answer user queries. IMPORTANT: If the user asks for real-time information (like current time, date, local weather, or web searches), DO NOT refuse or say you do not have access. Instead, use the available tools (like 'search_internet') IMMEDIATELY to find the answer. Always prioritize using tools over guessing or refusing.β€”
promptSTRINGWhat time is it right now?β€”
thinkBOOLEANfalseEnable reasoning (e.g. for Qwen3, DeepSeek-R1) before outputting final answer.
toolsoptOLLAMA_TOOLConnect OllamaTools nodes here so the Agent can call them to gather real-time data or perform actions.

Outputs (1)

NameTypeDescription
resultSTRINGβ€”