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.

Multi-Provider Abstraction Infography
Click to open full-size image in a new tab

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.

TypePurpose
ToolSchemaVendor-neutral tool definition (name, description, parameters as JSON Schema)
MessageConversation message with role, parts (text, function calls, attachments), and metadata
ProviderResponseUnified response: messages returned, token usage, finish reason, raw SDK response
FunctionCall / FunctionResponseTool invocation and result representation
TokenUsageInput/output/total token counts with cache hits
CancelTokenThread-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

ProviderSDKAuthStreamingTool Calling
Google GenAIgoogle-genaiService account / ADCYesYes
AnthropicanthropicAPI key / OAuth PKCEYesYes
GitHub Modelsazure-ai-inferencePAT / Device Code OAuthYesYes
Antigravityhttpx (raw)Google OAuth PKCEYesYes
Claude CLIsubprocessCLI loginYesDelegated / Passthrough
Ollamaanthropic (compat)None (local)YesYes
ZhipuAIanthropic (compat)API keyYesYes

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().

Back to Enterprise Overview