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:
| Concept | Description | Example |
|---|---|---|
| Name | Display name of the provider | OpenAI, DeepSeek, Zhipu GLM |
| API Format | The API protocol format used by the provider | openai, anthropic, google |
| Base URL | The base address for API requests | https://api.openai.com/v1/chat/completions |
| API Key | Authentication credential | sk-... or an environment variable reference like $OPENAI_API_KEY |
| Model list | Models available under this provider | gpt-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 Format | Description | Used by |
|---|---|---|
openai | OpenAI Chat Completions format (/v1/chat/completions) | OpenAI, DeepSeek, Zhipu, Ollama, Groq, and most other providers |
anthropic | Anthropic Messages format (/v1/messages) | Anthropic official, MiniMax |
google | Google Gemini format | Google Gemini |
azure-openai | Azure OpenAI format (same as OpenAI, different authentication) | Azure OpenAI Service |
openai-response | OpenAI 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:
- Direct input: Paste the API key directly in the settings UI
- 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):
| Provider | API Format | Base URL | Highlights |
|---|---|---|---|
| DeepSeek | openai | https://api.deepseek.com/v1 | Excellent price-performance ratio, supports reasoning mode |
| OpenRouter | openai | https://openrouter.ai/api/v1 | Aggregates 200+ models with unified billing |
| SiliconFlow | openai | https://api.siliconflow.cn/v1 | Accelerated access in China, hosts open-source models |
| OpenAI | openai | https://api.openai.com/v1/chat/completions | GPT series, o-series reasoning models |
| Anthropic | anthropic | https://api.anthropic.com/v1/messages | Claude series, native chain-of-thought |
| Google Gemini | https://generativelanguage.googleapis.com/v1beta/models/ | Ultra-long context (1 million tokens) | |
| Zhipu GLM | openai | https://api.z.ai/api/paas/v4 | GLM series, supports Coding Plan |
| Moonshot (Kimi) | openai | https://api.moonshot.ai/v1 | Kimi K2.5, ultra-long context |
| Alibaba Cloud Bailian | openai | https://dashscope.aliyuncs.com/compatible-mode/v1 | Qwen series, 1 million tokens |
| Ollama | openai | http://localhost:11434/v1 | Local deployment, fully offline |
| Groq | openai | https://api.groq.com/openai/v1 | Ultra-fast inference, low latency |
| Claude Code | anthropic | https://api.anthropic.com/v1/messages | Claude 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
| Setting | Type | Default | Description |
|---|---|---|---|
| Provider name | String | (template name) | Display name, customizable |
| API Format | Enum | openai | openai / anthropic / google / azure-openai / openai-response |
| Base URL | URL | (varies by template) | API request address |
| API Key | String | (empty) | Supports $ prefix to reference environment variables |
| Model list | Array | (varies by template) | Can be added manually or fetched via model discovery |
| Enabled | Boolean | false | Whether the provider appears in the model selection list |
| Transformer | Object | (varies by format) | Request/response format transformer configuration |
| Default parameters | Object | temperature: 0.7 | Provider-level default generation parameters |
| API timeout | Milliseconds | (global setting) | Timeout for a single request |
| Concurrency limit | Number | (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→ readsprocess.env.OPENAI_API_KEYat 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 type | Transformer | Purpose |
|---|---|---|
| Anthropic official | anthropic | Maintains Anthropic Messages format, handles chain-of-thought |
| Google Gemini | gemini | Converts requests to Gemini format |
| OpenAI Responses | openai-response | Adapts to the /v1/responses endpoint |
| OpenRouter | openrouter | Handles provider routing configuration |
| DeepSeek | deepseek | Handles DeepSeek-specific reasoning fields |
| Groq | groq | Adapts to Groq's parameter constraints |
Troubleshooting
| Issue | Possible cause | Solution |
|---|---|---|
| Provider not in model selection list | Provider is disabled | Go to provider settings and enable the toggle |
| Request returns 401 error | API key is invalid or expired | Check and update the API key; confirm the key has sufficient quota |
| Request returns 403 error | API key lacks permission | Check whether the API key has access to the selected model |
| Environment variable key is invalid | Environment variable name is wrong or not set | Confirm the environment variable is set in the system, then restart Elftia |
| Request times out | No network connection or provider service outage | Check network connectivity, verify the Base URL is correct, try using a proxy |
| Model list is empty | Provider does not support model discovery, or key is invalid | Add models manually, or check whether the API key is correct |
| Unusual response format | Transformer configuration mismatch | Confirm the API format selection is correct; check whether a specific transformer is needed |
| Slow connection to Chinese providers | Network latency | Confirm you are using the correct domestic Base URL; check proxy settings |
Related Pages
- Adding a Provider - Add a new provider from a preset template or custom configuration
- API Key Pools - Multi-key load balancing and automatic failover
- Custom Endpoints - Connect to local services like Ollama and LM Studio
- Model Parameters - Configure generation parameters such as temperature and max_tokens