Documentation Index
Fetch the complete documentation index at: https://smithers.sh/llms.txt
Use this file to discover all available pages before exploring further.
AnthropicAgent and OpenAIAgent are thin wrappers around the AI SDK ToolLoopAgent with class-style ergonomics matching the CLI agents.
Import
Quick Start
Model Input
Both classes accept a model ID string ("claude-opus-4-6", "gpt-5.3-codex") or a prebuilt AI SDK language model instance.
Options
Constructors forward standard AI SDKToolLoopAgent settings: instructions, tools, stopWhen, maxOutputTokens, temperature, providerOptions, prepareCall. The wrapper adds model, which resolves model-ID strings automatically.
For OpenAIAgent, pass baseURL and apiKey directly when targeting an OpenAI-compatible endpoint instead of the default OpenAI API. This is the simplest path for local servers such as llama.cpp:
apiKey: "none" in the OpenAIAgent config when your local server accepts OpenAI-compatible requests but does not require a real key.
Some OpenAI-compatible local servers accept chat requests but do not reliably implement JSON schema structured output. For those servers, keep the output schema on the Smithers task and disable native structured output on the agent so Smithers uses prompt-based JSON extraction instead:
OpenAIAgent:
createOpenAI path when you need provider-level configuration beyond baseURL and apiKey; in that form, apiKey: "none" belongs in the createOpenAI config.
Hijack Support
SDK agents do not reopen a provider-native CLI. Smithers persists the agent conversation and reopens it through a Smithers-managed REPL viasmithers hijack <runId>.
Live-run behavior:
- Smithers captures response history after each step via
onStepFinish. smithers hijackwaits until history is durable, cancels the live run, and opens the REPL.- On clean REPL exit, Smithers writes updated message history back and resumes the workflow automatically.
- Conversation hijack stays on the same agent implementation. Cross-engine hijack is not supported.
- Smithers reconstructs the original task agent from the workflow source.
CLI vs SDK
Pass a raw
ToolLoopAgent directly if you prefer — the wrappers are convenience, not a separate runtime.