Skip to content

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.

tether.providers.base

Base provider protocol and 9B fallback tool-call parser.

parse_tool_arguments(raw_args)

Parse tool arguments from a dict or JSON string into an ActionCall.

extract_fallback_action(text)

Extract an ActionCall when a small 9B model emits tool syntax inside plain text.

tether.providers.ollama

Native Ollama /api/chat httpx adapter with num_ctx and keep_alive support.

OllamaProvider

Thin async adapter for Ollama /api/chat.

aclose() async

Close the underlying HTTP connection pool.

tether.providers.openai

OpenAI-compatible /v1/chat/completions httpx adapter (GPT, OpenRouter, vLLM, Groq).

OpenAIProvider

Thin async adapter for OpenAI-compatible /v1/chat/completions endpoints.

aclose() async

Close the underlying HTTP connection pool.

tether.providers.anthropic

Native Anthropic /v1/messages httpx adapter.

AnthropicProvider

Thin async adapter for Anthropic /v1/messages.

aclose() async

Close the underlying HTTP connection pool.