Skip to content

Providers Overview

llmist supports multiple LLM providers out of the box with automatic discovery and seamless switching.

llmist automatically discovers available providers from environment variables:

Terminal window
# Set one or more API keys
export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...
export GEMINI_API_KEY=...
export OPENROUTER_API_KEY=sk-or-...
import { LLMist } from 'llmist';
// Providers are auto-discovered from environment
const client = new LLMist();
// Use any available model
const agent = client.createAgent()
.withModel('sonnet') // Uses Anthropic
.ask('Hello!');

Use friendly aliases instead of full model names:

| Alias | Full Model | Provider | |-------|------------|----------| | gpt5 | openai:gpt-5.2 | OpenAI | | gpt5-mini | openai:gpt-5-mini | OpenAI | | gpt5-nano | openai:gpt-5-nano | OpenAI | | sonnet | anthropic:claude-sonnet-4-5 | Anthropic | | haiku | anthropic:claude-haiku-4-5 | Anthropic | | opus | anthropic:claude-opus-4-5 | Anthropic | | flash | gemini:gemini-2.5-flash | Gemini | | flash-lite | gemini:gemini-2.5-flash-lite | Gemini | | pro | gemini:gemini-3-pro-preview | Gemini |

You can also specify the provider explicitly:

// With provider prefix
.withModel('openai:gpt-5')
.withModel('anthropic:claude-sonnet-4-5-20250929')
.withModel('gemini:gemini-2.5-flash')

For advanced use cases, configure providers manually:

import { LLMist, OpenAIChatProvider } from 'llmist';
const client = new LLMist({
autoDiscoverProviders: false,
adapters: [
new OpenAIChatProvider({
apiKey: process.env.MY_OPENAI_KEY,
baseUrl: 'https://my-proxy.com/v1',
}),
],
});