Model Adapters
Native opentine agents accept any object implementing the Modelprotocol. The public beta separates validated targets from scoped compatibility targets so support claims stay precise.
The Model Protocol
opentine/runtime.py
1class Model(Protocol):
2 @property
3 def name(self) -> str: ...
4
5 @property
6 def supports_tools(self) -> bool: ...
7
8 @property
9 def supports_thinking(self) -> bool: ...
10
11 async def complete(
12 self,
13 messages: list[dict[str, Any]],
14 tools: list[dict[str, Any]] | None = None,
15 system: str | None = None,
16 temperature: float = 0.0,
17 ) -> dict[str, Any]: ...
18
19 async def stream(
20 self,
21 messages: list[dict[str, Any]],
22 tools: list[dict[str, Any]] | None = None,
23 system: str | None = None,
24 temperature: float = 0.0,
25 ) -> AsyncIterator[dict[str, Any]]: ...
Built-In Adapters
Built-in adapters cover Anthropic, OpenAI, Google, and Ollama. Ollama is live-validated for llama3.1 and qwen3 in the current audit environment; cloud providers have adapter contract tests and require user credentials for live gates.
models.py
1from opentine import Agent
2from opentine.models.anthropic import Anthropic
3from opentine.models.google import Google
4from opentine.models.ollama import Ollama
5from opentine.models.openai import OpenAI
6
7agent = Agent(model=Anthropic("claude-sonnet-4-20250514"))
8agent = Agent(model=OpenAI("gpt-4o"))
9agent = Agent(model=Google("gemini-2.0-flash"))
10agent = Agent(model=Ollama("llama3.1"))
OpenAI-Compatible Wrappers
The opentine.models.compat wrappers reuse the OpenAI adapter with provider-specific base URLs and environment variables. They are scoped compatibility targets until each provider passes its own live gate.
compat.py
1from opentine import Agent
2from opentine.models.compat import DeepSeek, GLM, Groq, Kimi, Mistral, Qwen, Together
3
4agent = Agent(model=Kimi("moonshot-v1-8k"))
5agent = Agent(model=DeepSeek("deepseek-chat"))
6agent = Agent(model=Qwen("qwen-plus"))
7agent = Agent(model=GLM("glm-4-flash"))
8agent = Agent(model=Groq("llama-3.1-70b-versatile"))
9agent = Agent(model=Together("meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo"))
10agent = Agent(model=Mistral("mistral-large-latest"))
Support Matrix
| Target | Status | Notes |
|---|---|---|
| Ollama | Validated | llama3.1 and qwen3 live gates passed in this environment. |
| Anthropic | Scoped | Adapter contract tests; live gate requires ANTHROPIC_API_KEY. |
| OpenAI | Scoped | Adapter contract tests; live gate requires OPENAI_API_KEY. |
| Scoped | Adapter contract tests; live gate requires GOOGLE_API_KEY. | |
| OpenAI-compatible providers | Scoped | Kimi, DeepSeek, Qwen, GLM, Groq, Together, Mistral, and local endpoints need provider-specific gates. |
Next Steps
- Anthropic — Claude adapter.
- OpenAI — OpenAI SDK adapter and custom base URL.
- Google — Gemini adapter.
- Ollama — Local model adapter.
- OpenAI-Compatible — Provider and local endpoint wrappers.