Chat & LLM
Dagu can call language models from workflows, let models invoke DAGs as tools, or run external agent CLIs. This section helps choose the right approach; exact chat.completion syntax lives in the LLM action reference.
Choose an Approach
| Goal | Use |
|---|---|
| Send prompts or message lists directly to a model provider | chat.completion |
| Let a model call DAG workflows as functions | Tool Calling |
| Run an external coding-agent CLI inside a workflow | harness.run |
| Let an external AI client inspect and operate Dagu | MCP Server |
LLM Completions
Use action: chat.completion for provider API calls, multi-turn sessions, model fallback, reasoning, web search, and response routing.
- LLM Completion — quick start and complete field reference
- Providers & Endpoints — credentials, shared defaults, and compatible endpoints
- Local Models — Ollama, vLLM, and LM Studio
- OpenCode — OpenCode provider setup
- Outputs & Routing — sessions, captured responses, artifacts, and branching
- Reasoning & Web Search — provider reasoning and search capabilities
- Reliability — provider retries and model fallback
Agents and Tools
Tool calling turns selected DAGs into functions that a model can invoke during a completion. Use it when the model should choose and sequence workflow operations.
Use harness.run instead when the workflow should launch an external agent such as Claude Code, Codex, Copilot, or OpenCode. Use the MCP server for the inverse relationship: an external AI client connects to Dagu and operates workflows through Dagu's tools and resources.
