Delegated completion
completeDelegate inference to a chosen local model for cost savings and privacy, with system prompts, JSON-schema validation, vision inputs, and token streaming.
Instructions
DELEGATED INFERENCE: Offload a completion to a model you choose for cost savings and privacy. Without provider, runs on the live LOCAL provider that has the model (never a hosted API unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set); the result's 'provider', 'host' and 'local' fields say where it ran. Supports system prompts, JSON / JSON-Schema output (validated 'parsed' field), seed/topP/topK, image inputs for vision models, and contextLength for long inputs. Streams tokens via MCP progress notifications when the client sends a progressToken.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"model": "<model>"
},
"name": "complete"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | Seed for reproducible sampling | |
| stop | No | Stop sequences | |
| topK | No | ||
| topP | No | ||
| model | Yes | Model id/name to run the completion on | |
| prompt | No | Plain prompt text (alternative to messages) | |
| stream | No | Stream tokens (default true). Progress notifications are sent when the client provides a progressToken. | |
| system | No | System instruction | |
| options | No | Provider-specific extras passed through as-is | |
| messages | No | Chat messages; content may be a string or text/image parts (vision models) | |
| provider | No | Provider instance name. Omit to let the server choose (local providers only, unless LOCAL_AI_ALLOW_HOSTED_FALLBACK is set). | |
| maxTokens | No | Maximum tokens to generate | |
| temperature | No | Sampling temperature | |
| contextLength | No | Context window to run with (Ollama num_ctx). Raise it for long inputs to avoid truncation. | |
| repeatPenalty | No | ||
| repairAttempts | No | With a json_schema responseFormat: if the output fails validation, send the errors back to the same model and ask for corrected JSON, up to this many times (default 0, max 2). Token usage covers every attempt. | |
| responseFormat | No | Constrain output to JSON (json_object) or a JSON Schema (json_schema); the result includes a validated 'parsed' value |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| text | Yes | ||
| local | Yes | ||
| model | Yes | ||
| parsed | No | ||
| provider | Yes |