Add a model only after direct execution works
Start with the model-free first tool. When its HTTP contract passes, add models.routing to interpret language. This isolates provider failures from mapping failures.
A provider configuration names the adapter protocol and a real model ID in your account. The model ID is not inferred from the provider name. Hosted providers require an environment key reference; Ollama can use a local base URL. Never copy a model name without verifying that your deployment supports it.
# Root fragment; replace the model placeholder before use.
models:
routing:
provider: openai
model: YOUR_TOOL_CAPABLE_MODEL
api_key: $ENV:OPENAI_API_KEY
timeout_ms: 30000
Use raw presentation first. Then add a separate presentation model only if you need different cost, latency, or wording behavior for results. Without a separate one, presentation falls back to the routing model. Conversation uses the presentation model by default, controlled by assistant.conversation.use_presentation_model.
Capability flags describe reality
nativeTools selects native tool calling when supported. Otherwise structured output or validated JSON fallback may be used. strictSchema, systemMessages, and temperature describe protocol features; they are not guarantees about model intelligence or business correctness.
Do not enable flags to suppress an integration error. Test a valid tool call, malformed arguments, a no-tool answer, an aborted request, and provider timeout. With a custom adapter, return the documented structured shape and usage values; the runtime still validates tool selection and input.
Built-in provider IDs
AGENTO's built-in provider configuration accepts:
- OpenAI
- Anthropic
- Mistral
- Cohere
- Ollama
Provider/model capabilities vary. The adapter exposes capability flags rather than assuming every model supports every protocol feature.
Capability contract
interface ModelCapabilities {
nativeTools: boolean;
structuredOutput: boolean;
strictSchema: boolean;
systemMessages: boolean;
temperature: boolean;
}
Native tool calling takes precedence. If unavailable, AGENTO may use structured output or validated JSON fallback depending on capabilities.
Provider behavior summary
| Provider | Native tool path | Structured fallback |
|---|---|---|
| OpenAI | Chat Completions tools | JSON Schema response format |
| Anthropic | Messages tools/input_schema | conservative validated JSON fallback |
| Mistral | Chat tools | JSON Schema response format |
| Cohere | v2 Chat tools | JSON object/schema path |
| Ollama | /api/chat tools | format JSON Schema |
Treat this table as adapter behavior, not a promise that every model deployment supports every feature.
Custom ModelAdapter
The public interface is small:
interface ModelAdapter {
capabilities(): ModelCapabilities;
generateText(request: GenerationRequest): Promise<TextGenerationResult>;
generateStructured(
request: GenerationRequest & { schema: JsonSchema }
): Promise<StructuredGenerationResult>;
selectTool(request: ToolSelectionRequest): Promise<ToolSelectionResult>;
}
Inject it:
const runtime = await AgentRuntime.create({
config: configObject,
model: myRoutingModel,
presentationModel: myPresentationModel,
});
Adapter requirements
A production adapter should:
- respect
AbortSignal; - return bounded usage metadata;
- never return multiple unreviewed tool calls as one action;
- preserve the model-facing tool schemas;
- surface provider failures rather than smuggling provider error text into normal assistant messages;
- clearly declare unsupported capabilities.
Test your exact deployment
Provider protocols and model support change. Run routing fixtures/evaluations against the exact model IDs and endpoints you plan to deploy.