Dispatch to a local model
ollama_dispatchRun a local Ollama model for summarization, extraction, and reformatting; reads files server-side so only the answer consumes your context.
Instructions
Run one generation on a local Ollama model and return its output. Use for summarization, extraction, reformatting and other mechanical work you do not want to spend your own context on. Supports structured output (format), multi-turn messages, tool definitions, and server-side file reading via files/file_globs so file contents never enter your context. Select the model with model: a literal name, role:NAME, or caps:a+b. Note that reasoning tokens and answer tokens share one num_predict budget — thinking is off by default for that reason. Every response ends with a metrics line naming the model actually used and how it was resolved.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | No | Override the base URL of the local inference server for this call only, e.g. "http://localhost:11434". Omit to use the configured host. | |
| seed | No | RNG seed. Pair with temperature 0 for reproducible output. | |
| stop | No | Up to 8 stop sequences. Generation halts when one is produced. | |
| files | No | Absolute (or cwd-relative) file paths to include as context. THE SERVER READS THESE LOCALLY AND FEEDS THEM STRAIGHT TO THE LOCAL MODEL — the file contents never enter your context. This is the main reason to use this tool: hand off a large file, get back only the answer. Reads are confined to a configured root allowlist. | |
| model | No | Model selector. Three grammars are accepted: (1) a literal installed model name or configured alias, used as-is; (2) "role:NAME" — resolve through the named role, which carries an ordered fallback chain plus its own sampling defaults; (3) "caps:a+b" — pick the best installed model advertising ALL of the named capabilities (e.g. "caps:vision+tools"), ranked by the configured policy. Omit this field entirely to use the configured default role, which is the right choice unless you have a reason. Selectors never name a model in server code — availability is discovered at runtime, so an unknown or un-pulled name is an error, not a silent substitution. | |
| think | No | Enable reasoning on a thinking-capable model: true/false, or an effort level ("low" | "medium" | "high" | "max"). Default is OFF. WARNING: reasoning tokens and answer tokens are drawn from the SAME num_predict budget, so a small num_predict with thinking enabled routinely spends the whole budget reasoning and returns EMPTY content. If you turn thinking on, raise num_predict well above the default. | |
| tools | No | Tool definitions offered to the model, in the standard function-calling format. Requires a model with the "tools" capability. Any tool calls come back to you to execute; this server never executes them. | |
| top_k | No | Top-k sampling cutoff. | |
| top_p | No | Nucleus sampling threshold. | |
| detail | No | Response verbosity. "concise" returns the answer plus minimal provenance; "detailed" adds the resolution trail, token counts, timings and warnings. Default is the configured value. | |
| format | No | Constrain the output shape: "json" for free-form JSON, or a JSON Schema object for structured output matching that schema. Ask for the fields you need in the prompt too — the schema constrains form, not content. | |
| images | No | Base64-encoded images attached to the prompt. Only valid with `prompt`; when using `messages`, attach images to the relevant turn instead. Requires a vision-capable model. | |
| prompt | No | Single-turn user prompt. Provide EITHER prompt OR messages, never both and never neither. Use prompt for one-shot work; use messages when prior turns matter. | |
| system | No | System instruction prepended to the conversation. Applied whether you passed prompt or messages; if messages already begins with a system turn, this is merged ahead of it. | |
| num_ctx | No | Context window in tokens for this call. Raising it costs VRAM; exceeding the model window silently drops the OLDEST content, so the server checks it rather than letting that happen quietly. | |
| options | No | Escape hatch for runtime options this schema does not name. Merged under the typed fields above, which win on conflict. Use when the local server gains an option newer than this tool. | |
| messages | No | Full conversation, oldest turn first. Mutually exclusive with prompt. Prefer this when the model needs earlier turns, tool results, or per-turn images. | |
| file_globs | No | Glob patterns expanded on the server, e.g. "src/**/*.ts". Same token-saving property as `files`: matched contents go to the local model, not to you. Expansion is confined to the root allowlist, skips node_modules/.git/dotdirs, and can NEVER match a sensitive file (.env, keys, credentials) regardless of other settings. | |
| keep_alive | No | How long the model stays resident in VRAM after this call: a duration string such as "10m", or seconds as a number. 0 unloads immediately; a negative number keeps it loaded indefinitely. Keeping a model warm avoids re-paying a multi-second load on the next call. | |
| timeout_ms | No | Per-request timeout in milliseconds. Large models on a cold load can take tens of seconds before the first token, so prefer generous values over retrying. | |
| num_predict | No | Maximum tokens to generate. -1 means unlimited. This budget is shared with reasoning tokens when `think` is on, so size it for both. | |
| temperature | No | Sampling temperature. 0 is near-deterministic; higher is more varied. | |
| allow_sensitive | No | Permit reading a file the deny-list would normally block (.env, *.pem, *.key, ssh/aws material, anything named like a credential or secret). Only ever applies to a path named explicitly in `files`; globs can never pull in a sensitive file. Off by default. | |
| include_thinking | No | Return the reasoning trace alongside the answer. Off by default because traces are long and land in YOUR context. Useful when debugging why an answer went wrong. | |
| max_output_chars | No | Hard cap on the number of characters returned to you. Output beyond this is trimmed and the trim is reported, never hidden. Use it to protect your own context window. | |
| require_capabilities | No | Capabilities the chosen model MUST advertise, e.g. ["vision"], ["tools"], ["thinking"]. Applied on top of whatever `model` selects, and a mismatch is a hard error rather than a silent downgrade. Capability names are whatever the local server reports — the set grows between releases, so unknown names are passed through, not rejected. |