Multi-Provider Abstraction
JAATO decouples agentic logic from any specific AI vendor through a provider-agnostic type system and a ModelProviderPlugin protocol. Seven provider implementations — Google GenAI, Anthropic, GitHub Models, Antigravity, Claude CLI, Ollama, and ZhipuAI — each adapt their SDK into this common interface, allowing sessions to switch providers at runtime.
Provider-Agnostic Type System
All provider communication flows through a set of provider-agnostic types defined in shared/plugins/model_provider/types.py. These types ensure that agentic logic — tool execution, conversation management, streaming — never depends on a specific vendor's data structures.
| Type | Purpose |
|---|---|
ToolSchema | Vendor-neutral tool definition (name, description, parameters as JSON Schema) |
Message | Conversation message with role, parts (text, function calls, attachments), and metadata |
ProviderResponse | Unified response: messages returned, token usage, finish reason, raw SDK response |
FunctionCall / FunctionResponse | Tool invocation and result representation |
TokenUsage | Input/output/total token counts with cache hits |
CancelToken | Thread-safe cancellation signaling for streaming |
ModelProviderPlugin Protocol
Each provider implements the ModelProviderPlugin protocol defined in shared/plugins/model_provider/base.py. The protocol specifies 20+ methods organized into lifecycle, session management, messaging, streaming, token management, capabilities, and error classification groups.
Key methods include connect() for SDK initialization, send_message() for synchronous chat, send_message_streaming() for streamed responses, and translate_tool_schemas() for converting vendor-neutral schemas to SDK-specific formats.
Provider Inventory
| Provider | SDK | Auth | Streaming | Tool Calling |
|---|---|---|---|---|
| Google GenAI | google-genai | Service account / ADC | Yes | Yes |
| Anthropic | anthropic | API key / OAuth PKCE | Yes | Yes |
| GitHub Models | azure-ai-inference | PAT / Device Code OAuth | Yes | Yes |
| Antigravity | httpx (raw) | Google OAuth PKCE | Yes | Yes |
| Claude CLI | subprocess | CLI login | Yes | Delegated / Passthrough |
| Ollama | anthropic (compat) | None (local) | Yes | Yes |
| ZhipuAI | anthropic (compat) | API key | Yes | Yes |
Provider Discovery
Providers are discovered via Python entry points (jaato.model_providers) and fallback directory scanning of shared/plugins/model_provider/*/. The load_provider(name, config) factory instantiates a provider by name and tracks import errors for actionable diagnostics when an SDK dependency is missing.
Cross-Provider Sessions
JaatoRuntime maintains a registry of provider configurations (_provider_configs dict). Each JaatoSession can target a different provider, enabling scenarios like a main session on Anthropic Claude with subagents on Google Gemini — all sharing the same runtime resources (tool registry, permissions, token ledger).
Schema Translation
Each provider translates ToolSchema objects into its SDK's native format. For example, Google GenAI uses google.genai.types.FunctionDeclaration, Anthropic uses its tool input schema format, and GitHub Models uses the Azure AI Inference tool definition. This translation happens transparently during send_message().