Skip to Content

Providers

Sarek AI Accountability supports 14 AI providers. You wrap your existing client with monitor() and the SDK detects the provider automatically. The original client is never mutated, and the AI response is returned unchanged.

Supported providers

ProviderDetection
OpenAI, Anthropic, Gemini, Azure OpenAI, Ollama (native), AWS Bedrock (Converse), Mistral, Cohere (V2)Automatic
Groq, Together AI, OpenRouterAutomatic with the official SDK; hint when using an OpenAI client against their endpoint
Perplexity, FireworksHint required (no official TypeScript SDK)
xAI (Grok)Hint required (wire-identical to OpenAI)

Auto-detection

The SDK duck-types the client object to identify the provider. When you pass an official provider SDK client, detection is automatic and no configuration is needed.

import OpenAI from 'openai' import Anthropic from '@anthropic-ai/sdk' import { AiLogger } from '@sarek/ai-accountability' const sarek = await AiLogger.init() const openai = sarek.monitor(new OpenAI()) const anthropic = sarek.monitor(new Anthropic())

Provider hints

Some providers are wire-compatible with OpenAI: they accept the same request format and return the same response shape, so their client is an OpenAI client with a different baseURL. The SDK cannot distinguish them from OpenAI without a hint.

Pass { provider: '<name>' } when the client connects to a non-OpenAI endpoint:

import OpenAI from 'openai' const grok = sarek.monitor( new OpenAI({ baseURL: 'https://api.x.ai/v1', apiKey: process.env.XAI_API_KEY }), { provider: 'xai' } ) const ollama = sarek.monitor( new OpenAI({ baseURL: 'http://localhost:11434/v1', apiKey: 'ollama' }), { provider: 'ollama' } )

If the client cannot be recognized and no hint is given, monitor() throws (TypeScript) or raises ValueError (Python).

LangChain and LangGraph

LangChain has no client instance to wrap. Instead of monitor(), you use a callback. See LangChain.

SDK reference

For method signatures, return types and the full LogEntry schema:

Last updated on