Skip to content

Model ​

Overview
What it isA model on a provider, and how agt calls it
CLIagt model
Agent toolsresource_* with kind: "model"
Web consoleResources → Model
Filemodels/<category>/<name>/model.yaml
Cratesagt-model, agt-inference

What it does ​

A model resource gives a name to one model on a provider, with the protocol and settings to use. Native agents refer to a model; changing the model resource changes every agent that uses it from its next run. You can define several model resources for the same underlying model, for example a fast and a careful variant.

agt streams responses, retries transient failures up to 10 attempts, and summarizes old context automatically when a conversation nears the context window.

How to use it ​

Web console: Resources → New resource → Model. Choose the provider, click Fetch model list (获取模型列表) or type the model ID, and choose the API format.

CLI:

bash
agt model create fast --provider openai --model gpt-5-mini --api-format responses --tool-call true
agt model update fast --reasoning-effort low
agt model update fast --clear-reasoning-effort

Agent tools:

json
{"kind":"model","reference":"fast","create":true,
 "data":{"provider":"openai","model":"gpt-5-mini","params":{"api_format":"responses","tool_call":true}}}

Common parameters ​

ParameterMeaning
--modelThe model ID at the provider
--api-formatchat-completions, responses, anthropic-messages or gemini; must match what the provider supports
--tool-call trueRequired for agents that use any tool
--reasoning-effortThinking level for reasoning models
--context-windowInput tokens the model accepts; set it from the provider's documentation

All parameters ​

agt model create <name> ​

OptionRequiredDefaultMeaning
--provider <ref>yesThe provider
--model <id>yesModel ID at the provider
--api-format <f>nochat-completionschat-completions, responses, anthropic-messages or gemini. agt never switches automatically.
--temperature <t>no0.70 to 2. Not sent when a reasoning effort is set.
--max-tokens <n>nonot sentOutput token limit
--timeout <s>no60Seconds to wait for the response to start, for each read, and between output chunks once the reply is streaming; a stalled reply is retried
--reasoning-effort <level>nonot sentnone, minimal, low, medium, high, xhigh, max, or any value the provider accepts
--tool-call <bool>notrue if the model supports function calling
--context-window <n>no272000Input token window, 4096 to 2000000. Used for automatic compaction; does not limit output.
--category <c>nodefaultCategory

agt model update <name> ​

Accepts the same options as create except --provider and --model, plus:

OptionMeaning
--clear-max-tokensStop sending an output limit
--clear-reasoning-effortStop sending a reasoning effort

list, info, delete and category are described in Resources.

File: model.yaml ​

yaml
name: fast
provider: { category: default, name: openai }
model: gpt-5-mini
api_format: responses
params:
  temperature: 0.7
  max_tokens: null
  timeout: 60
  reasoning_effort: null
capabilities:
  context_window: 272000
  tool_call: true

Tool fields (resource_write, kind: "model") ​

On create: provider (required), model (required), and optional params with any of the fields below. On update, give the fields directly in data.

FieldMeaning
temperature0 to 2
max_tokensPositive integer
timeoutSeconds
api_formatchat-completions, responses, anthropic-messages or gemini
reasoning_effortAs for --reasoning-effort
tool_callBoolean
context_window4096 to 2000000

clear: ["max_tokens"] or clear: ["reasoning_effort"] removes those settings.

Request behavior ​

BehaviorDetails
StreamingRequests use streaming. Providers that ignore it still work, without live preview.
RetriesConnection errors, HTTP errors, invalid JSON and empty replies are retried up to 10 attempts in total, waiting from 250 ms up to 4 s. Configuration errors and explicit refusals are not retried.
CompactionAt 90% of the context window, older history is summarized with the same model.
InputText only; images are not supported.
AnthropicSends x-api-key and anthropic-version: 2023-06-01. Marks the system prompt, tools and newest message for prompt caching. Without max_tokens, asks for up to 16384 output tokens. reasoning_effort becomes an extended-thinking budget (low 2048, medium 8192, high 16384, xhigh 32768, max 64000, or a number); thinking is turned off for the one call where a tool is required.
GeminiSends x-goog-api-key. Tool schemas go as JSON Schema (parametersJsonSchema). reasoning_effort becomes a thinking budget (none 0, low 2048, medium 8192, high 16384, max lets the model decide, or a number).
ThinkingProvider reasoning is never shown or stored in records. Thinking blocks and signatures that the provider needs back are kept with the run so the next step can send them; a run suspended on a task saves them in its local checkpoint.

Released under the MIT License.