Skip to main content

Model Providers

All six SDKs route model calls through the shared Rust runtime, supporting OpenAI-compatible APIs (openai_chat, openai_responses), Anthropic (anthropic), Google Gemini (gemini), ordered ModelCascade fallbacks, and offline test backends (MockModel in Python/Rust or host-language callbacks in TypeScript, Go, C#, and Java). Keep provider keys in environment variables or secure runtime configuration rather than source code.

from ish import Agent, AnthropicModel, ModelCascade, OpenAICompatibleModel

cascade = ModelCascade(
[
OpenAICompatibleModel(model="gpt-4o-mini"),
AnthropicModel(model="claude-sonnet-4-6"),
]
)

agent = Agent(name="assistant", model=cascade)

Provider cascades (ModelCascade)​

Configure ordered provider fallbacks evaluated by the Rust runtime:

A cascade configures fallback ordering according to failure classification and retry policy; it does not guarantee uninterrupted provider availability.

Offline model tests​

Use MockModel or ReplayModel (Python), MockModel (Rust), or an in-process host model callback (TypeScript, Go, C#, and Java) to run unit tests without network requests:

from ish import ReplayModel

model = ReplayModel(fixtures=[{"content": "fixture response"}])

See Model integrations for structured decisions (model.decide), endpoint options, retry settings, and pricing rates.

DecisionsClient​

All SDKs expose a typed DecisionsClient over Rust's model.decide. Questions are tagged JSON objects: {type: "predicate", name, instructions}, {type: "choice", name, instructions, choices: string[]}, or {type: "score", name, instructions, levels: string[]}. Do not use the former single_select / options shape. See the integration examples for all six language snippets.