Agents as models

Agent CLIs are first-class models. Name one directly, or route to one via a dynamic group's high:.

Conversation-mapped sessions

an agent, conversation-mapped
curl localhost:8080/v1/chat/completions \
  -H 'X-Conversation-Id: refactor-1' \
  -d '{"model":"devin/claude-opus-4.8",
       "messages":[{"role":"user","content":"draft a refactor plan"}]}'
# next turn, same header → the agent RESUMES its real session, keeps context

Configurable binary + args

Configure where the CLI lives and pass extra flags — no source build needed:

configurable agent binary + args
- name: devin
  type: devin
  provider: cognition
  bin: /opt/homebrew/bin/devin     # optional — defaults to "devin" on PATH
  args: ["--org", "acme"]          # optional — extra CLI flags
  variants: [sonnet, opus]         # → devin --model <variant>
  permission_mode: auto

Same pattern for codex, copilot, claude. Their model lists come from ~/.config/routsi/known-models.json (editable); Devin's is discovered live from the CLI.

Tool calling (function calling)

Agent models speak OpenAI function calling: send tools and the agent decides which to call — your client executes them. Under the hood the schemas are rendered into the prompt with a fenced-JSON protocol and the reply is parsed into wire-correct tool_calls (finish_reason:"tool_calls"); a parse failure degrades to plain text, never a fabricated call. This is how opencode runs with codex or devin as its model — see the opencode guide, including a custom JS decider that picks the agent per request. For devin + large clients prefer the interactive worker (one-shot devin -p has a ~80KB prompt ceiling).

Next: Pull-workers →