Model Providers¶
Structured history¶
The harness passes neutral messages (assistant tool_calls with id and dict arguments, then {"role": "tool", "tool_call_id": ...}) to providers whose structured_history attribute is true, and each adapter translates: Ollama sends them as-is (plus tool_name), OpenAI-compatible JSON-encodes arguments, Anthropic maps them to tool_use and tool_result blocks (merging consecutive same-role messages). A custom provider without the attribute gets the textual act('...') / Observation: form. Adapter payloads are unit-tested with mock transports; they have not been verified live against OpenAI or Anthropic.
tether.providers¶
Model provider resolver and custom SDK provider registry for Tether.
AnthropicProvider
¶
Thin async adapter for Anthropic /v1/messages.
aclose()
async
¶
Close the underlying HTTP connection pool.
OllamaProvider
¶
Thin async adapter for Ollama /api/chat.
aclose()
async
¶
Close the underlying HTTP connection pool.
OpenAIProvider
¶
Thin async adapter for OpenAI-compatible /v1/chat/completions endpoints.
aclose()
async
¶
Close the underlying HTTP connection pool.
extract_fallback_action(text)
¶
Extract an ActionCall when a small 9B model emits tool syntax inside plain text.
parse_tool_arguments(raw_args)
¶
Parse tool arguments from a dict or JSON string into an ActionCall.
register_provider(prefix, factory)
¶
Register a custom SDK model provider under <prefix>/<model_name>.
resolve_provider(model, *, num_ctx=8192)
¶
Resolve <provider>/<model_name> into an async ModelProvider instance.