Skip to main content

LLM Providers Overview

Elftia's LLM provider system lets you connect to multiple large language model services and switch seamlessly between providers through a unified API abstraction, without worrying about differences in underlying API formats.

When to Use

  • You need to connect to a new LLM service (such as OpenAI, Anthropic, DeepSeek, etc.)
  • You want to use models from multiple providers within the same application
  • You need to connect to locally deployed models (such as Ollama or LM Studio)
  • You want to achieve high availability and load balancing through API key pooling

Core Concepts

Provider

A provider is a configuration unit for an LLM API service. Each provider contains the following key information:

ConceptDescriptionExample
NameDisplay name of the providerOpenAI, DeepSeek, Zhipu GLM
API FormatThe API protocol format used by the provideropenai, anthropic, google
Base URLThe base address for API requestshttps://api.openai.com/v1/chat/completions
API KeyAuthentication credentialsk-... or an environment variable reference like $OPENAI_API_KEY
Model listModels available under this providergpt-4o, claude-sonnet-4-5, gemini-3-pro

API Format

Elftia supports 5 API formats, using built-in format transformers (Transformers) to automatically handle request and response format differences:

API FormatDescriptionUsed by
openaiOpenAI Chat Completions format (/v1/chat/completions)OpenAI, DeepSeek, Zhipu, Ollama, Groq, and most other providers
anthropicAnthropic Messages format (/v1/messages)Anthropic official, MiniMax
googleGoogle Gemini formatGoogle Gemini
azure-openaiAzure OpenAI format (same as OpenAI, different authentication)Azure OpenAI Service
openai-responseOpenAI Responses API format (/v1/responses)OpenAI new Responses API

Model

Multiple models can be configured under each provider. Model configuration includes:

  • Model ID: The identifier used when calling the API (e.g. gpt-4o)
  • Display name: The name shown in the UI (e.g. GPT-4o)
  • Category: chat, reasoning, code, image, etc.
  • Capability flags: Whether the model supports vision, function calling, reasoning mode, and web search
  • Context length: Maximum number of input tokens the model supports
  • Max output: Maximum number of tokens the model can generate in a single response

API Key

An API key is the authentication credential for accessing a provider's service. Elftia supports two ways to configure an API key:

  1. Direct input: Paste the API key directly in the settings UI
  2. Environment variable reference: Reference a system environment variable by prefixing the name with $ (e.g. $OPENAI_API_KEY) — useful when you prefer not to store the key in the application configuration

Request Processing Flow

After a user sends a message, Elftia processes the request as follows:

User sends message
|
v
Select provider and model
|
v
Resolve API key (direct value / environment variable / key pool)
|
v
Transformer: convert unified request to target API format
| (openai / anthropic / google / ...)
v
Send request to provider API
|
v
Transformer: convert provider response to unified format
|
v
Render response in chat UI

Default Provider List

Elftia ships with the following provider templates, which are created automatically on first launch (disabled by default — fill in an API key and enable them to use):

ProviderAPI FormatBase URLHighlights
DeepSeekopenaihttps://api.deepseek.com/v1Excellent price-performance ratio, supports reasoning mode
OpenRouteropenaihttps://openrouter.ai/api/v1Aggregates 200+ models with unified billing
SiliconFlowopenaihttps://api.siliconflow.cn/v1Accelerated access in China, hosts open-source models
OpenAIopenaihttps://api.openai.com/v1/chat/completionsGPT series, o-series reasoning models
Anthropicanthropichttps://api.anthropic.com/v1/messagesClaude series, native chain-of-thought
Google Geminigooglehttps://generativelanguage.googleapis.com/v1beta/models/Ultra-long context (1 million tokens)
Zhipu GLMopenaihttps://api.z.ai/api/paas/v4GLM series, supports Coding Plan
Moonshot (Kimi)openaihttps://api.moonshot.ai/v1Kimi K2.5, ultra-long context
Alibaba Cloud Bailianopenaihttps://dashscope.aliyuncs.com/compatible-mode/v1Qwen series, 1 million tokens
Ollamaopenaihttp://localhost:11434/v1Local deployment, fully offline
Groqopenaihttps://api.groq.com/openai/v1Ultra-fast inference, low latency
Claude Codeanthropichttps://api.anthropic.com/v1/messagesClaude Agent SDK integration

In addition to the defaults above, Elftia provides preset templates for more Chinese cloud platforms (Volcengine, Tencent Cloud Hunyuan, Baidu Qianfan, MiniMax, Kuaishou KwaiKAT, Moore Threads, etc.), available in the "Add Provider" dialog.

Configuration Reference

SettingTypeDefaultDescription
Provider nameString(template name)Display name, customizable
API FormatEnumopenaiopenai / anthropic / google / azure-openai / openai-response
Base URLURL(varies by template)API request address
API KeyString(empty)Supports $ prefix to reference environment variables
Model listArray(varies by template)Can be added manually or fetched via model discovery
EnabledBooleanfalseWhether the provider appears in the model selection list
TransformerObject(varies by format)Request/response format transformer configuration
Default parametersObjecttemperature: 0.7Provider-level default generation parameters
API timeoutMilliseconds(global setting)Timeout for a single request
Concurrency limitNumber(varies by provider)Maximum concurrent requests for Agent mode

Behavior Notes

Enabling and Disabling Providers

  • Disabled providers do not appear in the model selection dropdown
  • Disabling a provider does not delete its configuration; all settings are preserved when you re-enable it
  • If the current session is using a model from a provider that you then disable, existing sessions are unaffected, but new messages cannot use that model

Model Discovery

Some providers support Model Discovery: Elftia calls the provider's model list API (e.g. /v1/models) to automatically fetch available models. Providers that support model discovery include OpenAI, Anthropic, Gemini, Zhipu, and others.

Environment Variable API Keys

When an API key starts with $, Elftia reads the actual value from the system environment variable at runtime. For example:

  • Configured value $OPENAI_API_KEY → reads process.env.OPENAI_API_KEY at runtime
  • If the environment variable does not exist, the request will fail with an authentication error

Format Transformers

The Transformer is the core mechanism behind Elftia's multi-API-format support. Every provider that uses a non-OpenAI format is assigned a corresponding transformer:

Provider typeTransformerPurpose
Anthropic officialanthropicMaintains Anthropic Messages format, handles chain-of-thought
Google GeminigeminiConverts requests to Gemini format
OpenAI Responsesopenai-responseAdapts to the /v1/responses endpoint
OpenRouteropenrouterHandles provider routing configuration
DeepSeekdeepseekHandles DeepSeek-specific reasoning fields
GroqgroqAdapts to Groq's parameter constraints

Troubleshooting

IssuePossible causeSolution
Provider not in model selection listProvider is disabledGo to provider settings and enable the toggle
Request returns 401 errorAPI key is invalid or expiredCheck and update the API key; confirm the key has sufficient quota
Request returns 403 errorAPI key lacks permissionCheck whether the API key has access to the selected model
Environment variable key is invalidEnvironment variable name is wrong or not setConfirm the environment variable is set in the system, then restart Elftia
Request times outNo network connection or provider service outageCheck network connectivity, verify the Base URL is correct, try using a proxy
Model list is emptyProvider does not support model discovery, or key is invalidAdd models manually, or check whether the API key is correct
Unusual response formatTransformer configuration mismatchConfirm the API format selection is correct; check whether a specific transformer is needed
Slow connection to Chinese providersNetwork latencyConfirm you are using the correct domestic Base URL; check proxy settings