General Approach
If a request works with one provider and fails with another:- Remove any provider-specific fields from
options. - Test with plain text output (no tools, no response format, no streaming).
- Add features back one at a time to identify which one causes the failure.
options entries are passed through to the provider as-is, which can cause errors if the target provider does not recognize them.
OpenAI
Organization and Project IDs
If you use a shared OpenAI account, you may need to set the organization ID in the preset metadata:API Changes
OpenAI periodically updates its API. If requests that previously worked start failing, check OpenAI’s changelog for breaking changes. Model deprecations are the most common cause.OpenAI Responses API
Polyglot also supports the OpenAI Responses API through theopenai-responses driver and preset. This uses a different endpoint (/responses) and message format. Make sure you use the correct preset:
Anthropic
Message Format
Anthropic uses a different message format than OpenAI. Polyglot handles this translation automatically through theanthropic driver. You do not need to format messages differently — just use the standard Polyglot API.
API Version Header
The Anthropic API requires ananthropic-version header. This is configured in the preset metadata:
apiVersion value in your preset.
System Messages
Anthropic handles system messages differently from OpenAI — they are sent as a separatesystem parameter rather than as a message in the conversation. Polyglot’s Anthropic driver handles this automatically.
Google Gemini
Polyglot supports Gemini through two drivers:gemini— uses Google’s native Generative AI API with its own message formatgemini-oai— uses Google’s OpenAI-compatible endpoint
Mistral
Rate Limits on Free Tier
Mistral enforces strict rate limits on free-tier accounts. If you see HTTP 429 errors frequently, consider upgrading your plan or implementing more aggressive throttling in your application.Model Names
Mistral model identifiers can change between versions. Verify that the model name in your preset matches a currently available model.Ollama (Local Models)
Service Must Be Running
Ollama runs as a local service. Ensure it is installed and running before making requests:Pull Models Before Use
Models must be downloaded before they can be used:Default Endpoint
The Ollama preset uses the OpenAI-compatible endpoint athttp://localhost:11434/v1/chat/completions. If Ollama is running on a different host or port, update the apiUrl in your preset.
Feature Limitations
Local models through Ollama may not support all features that cloud providers offer. Tool calling, JSON schema mode, and streaming behavior can vary by model. Test each feature individually.Azure OpenAI
Azure OpenAI uses a different URL structure and authentication mechanism. Theazure driver handles these differences:
endpoint field includes the correct deployment name.
AWS Bedrock
Use thebedrock-openai driver for Bedrock’s OpenAI-compatible endpoint.
The current 2.0 implementation authenticates with a bearer API key. AWS
SigV4 credential signing is not implemented in Polyglot yet.
Cohere
Thecohere driver supports Cohere’s v2 Chat API. Cohere uses a different message and usage format that the driver translates automatically.
Other Providers
Polyglot includes drivers for many additional providers including Deepseek, Fireworks, Groq, HuggingFace, Cerebras, Perplexity, SambaNova, Together, XAI, Qwen, GLM, Inception, and MiniMaxi. Each has a corresponding preset file in theconfig/llm/presets/ directory.
For providers that follow the OpenAI API format, the openai-compatible driver provides broad compatibility. If a provider does not have a dedicated driver, try configuring it with driver: openai-compatible and adjusting the apiUrl, endpoint, and apiKey fields.