Island AI

LLM Polyglot

Universal client for LLM providers with OpenAI-compatible interface

llm-polyglot extends the OpenAI SDK to provide a consistent interface across different LLM providers. Use the same familiar OpenAI-style API with Anthropic, Google, and others.

Provider Support

Native API Support Status:

Provider APIStatusChatBasic StreamFunctions/Tool callingFunction streamingNotes
OpenAIDirect SDK proxy
AnthropicClaude models
GoogleGemini models + context caching
Azure🚧OpenAI model hosting
Cohere----Not supported
AI21----Not supported

Stream Types:

  • Basic Stream: Simple text streaming
  • Partial JSON Stream: Progressive JSON object construction during streaming
  • Function Stream: Streaming function/tool calls and their results

OpenAI-Compatible Hosting Providers:

These providers use the OpenAI SDK format, so they work directly with the OpenAI client configuration:

ProviderHow to UseAvailable Models
TogetherUse OpenAI client with Together base URLMixtral, Llama, OpenChat, Yi, others
AnyscaleUse OpenAI client with Anyscale base URLMistral, Llama, others
PerplexityUse OpenAI client with Perplexity base URLpplx-* models
ReplicateUse OpenAI client with Replicate base URLVarious open models

OpenAI-Compatible Providers

These providers work directly with OpenAI client configuration:

ProviderConfigurationAvailable Models
TogetherbaseURL: "https://api.together.xyz/v1"Mixtral, Llama, OpenChat, Yi
AnyscalebaseURL: "https://api.endpoints.anyscale.com/v1"Mistral, Llama
PerplexitybaseURL: "https://api.perplexity.ai"pplx-* models
// Together.ai example
const client = createLLMClient({
  provider: "openai",
  baseURL: "https://api.together.xyz/v1"
});
 
// Use any Together-hosted model
const completion = await client.chat.completions.create({
  model: "mistralai/Mixtral-8x7B-Instruct-v0.1",
  messages: [{ role: "user", content: "Hello!" }]
});

OpenAI

The llm-polyglot library also provides support for the OpenAI API, which is the default provider and will just proxy directly to the OpenAI sdk.

On this page