LLM Providers
Moltis supports multiple LLM providers through a trait-based architecture. Configure providers through the web UI or directly in configuration files.
Available Providers
API Key Providers
| Provider | Config Name | Env Variable | Features |
|---|---|---|---|
| Anthropic | anthropic | ANTHROPIC_API_KEY | Streaming, tools, vision |
| OpenAI | openai | OPENAI_API_KEY | Streaming, tools, vision, model discovery |
| Google Gemini | gemini | GEMINI_API_KEY | Streaming, tools, vision, model discovery |
| DeepSeek | deepseek | DEEPSEEK_API_KEY | Streaming, tools, model discovery |
| Mistral | mistral | MISTRAL_API_KEY | Streaming, tools, model discovery |
| Groq | groq | GROQ_API_KEY | Streaming |
| xAI (Grok) | xai | XAI_API_KEY | Streaming |
| OpenRouter | openrouter | OPENROUTER_API_KEY | Streaming, tools, model discovery |
| Cerebras | cerebras | CEREBRAS_API_KEY | Streaming, tools, model discovery |
| MiniMax | minimax | MINIMAX_API_KEY | Streaming, tools |
| Moonshot (Kimi) | moonshot | MOONSHOT_API_KEY | Streaming, tools, model discovery |
| Venice | venice | VENICE_API_KEY | Streaming, tools, model discovery |
| NEAR AI Cloud | nearai | NEARAI_API_KEY | Streaming, TEE-aware model discovery |
| Z.AI (Zhipu) | zai | Z_API_KEY | Streaming, tools, model discovery |
| Z.AI Coding Plan | zai-code | Z_CODE_API_KEY | Streaming, tools, model discovery (Coding plan billing endpoint) |
OAuth Providers
| Provider | Config Name | Notes |
|---|---|---|
| OpenAI Codex | openai-codex | OAuth flow via web UI |
| GitHub Copilot | github-copilot | Requires active Copilot subscription |
Local
| Provider | Config Name | Notes |
|---|---|---|
| Ollama | ollama | Local or remote Ollama instance |
| LM Studio | lmstudio | Local LM Studio or any OpenAI-compatible server |
| Local LLM | local-llm | Runs GGUF models directly on your machine |
Custom OpenAI-Compatible
Any OpenAI-compatible endpoint can be added with a custom- prefix:
[providers.custom-myservice]
enabled = true
api_key = "..."
base_url = "https://my-service.example.com/v1"
models = ["my-model"]
Configuration
Via Web UI (Recommended)
- Open Moltis in your browser.
- Go to Settings → Providers.
- Choose a provider card.
- Complete OAuth or enter your API key.
- Select your preferred model.
Via Configuration Files
Configure providers in moltis.toml:
[providers]
offered = ["anthropic", "openai", "gemini"]
[providers.anthropic]
enabled = true
[providers.openai]
enabled = true
models = ["gpt-5.3", "gpt-5.2"]
stream_transport = "sse" # "sse", "websocket", or "auto"
[providers.gemini]
enabled = true
models = ["gemini-2.5-flash", "gemini-2.5-pro"]
# api_key = "..." # Or set GEMINI_API_KEY / GOOGLE_API_KEY env var
# fetch_models = true # Discover models from the API
# base_url = "https://generativelanguage.googleapis.com/v1beta/openai"
[chat]
priority_models = ["gpt-5.2"]
Provider Entry Options
Each provider supports these options:
| Option | Default | Description |
|---|---|---|
enabled | true | Enable or disable the provider |
api_key | — | API key (overrides env var) |
base_url | — | Override API endpoint URL |
models | [] | Preferred models shown first in the picker |
fetch_models | true | Discover available models from the API |
stream_transport | "sse" | "sse", "websocket", or "auto" |
alias | — | Custom label for metrics |
tool_mode | "auto" | "auto", "native", "text", or "off" |
Provider Setup
Google Gemini
Google Gemini uses an API key from Google AI Studio.
- Get an API key from Google AI Studio.
- Set
GEMINI_API_KEYin your environment (or useGOOGLE_API_KEY). - Gemini models appear automatically in the model picker.
[providers.gemini]
enabled = true
models = ["gemini-2.5-flash", "gemini-2.5-pro"]
Gemini supports native tool calling, vision/multimodal inputs, streaming, and automatic model discovery.
Anthropic
- Get an API key from console.anthropic.com.
- Set
ANTHROPIC_API_KEYin your environment.
OpenAI
- Get an API key from platform.openai.com.
- Set
OPENAI_API_KEYin your environment.
NEAR AI Cloud
NEAR AI Cloud exposes an OpenAI-compatible chat completions API with a public model catalog that includes TEE and attestation metadata. The API accepts OpenAI-compatible tool schemas, but the public model catalog does not currently expose per-model tool capability metadata. Moltis therefore does not mark auto-discovered NEAR AI Cloud models as tool-capable.
- Get an API key from cloud.near.ai.
- Set
NEARAI_API_KEYin your environment. - Models are discovered from
https://cloud-api.near.ai/v1/model/list.
[providers.nearai]
enabled = true
models = ["zai-org/GLM-5.1-FP8"]
# api_key = "..." # Or set NEARAI_API_KEY
# base_url = "https://cloud-api.near.ai/v1"
OpenAI Codex
OpenAI Codex uses OAuth-based access.
- Go to Settings → Providers → OpenAI Codex.
- Click Connect and complete the auth flow.
- Choose a Codex model.
If the browser cannot reach localhost:1455, Moltis now supports a manual
fallback in both Settings and Onboarding: paste the callback URL (or
code#state) into the OAuth panel and submit it.
Once OpenAI Codex OAuth is connected, agents can use the built-in
generate_image tool to create gpt-image-2 images without an OPENAI_API_KEY.
Generated images are delivered through the same channel media path as
screenshots and send_image, so supported chat channels receive the image as a
native attachment.
GitHub Copilot
GitHub Copilot uses OAuth authentication.
- Go to Settings → Providers → GitHub Copilot.
- Click Connect.
- Complete the GitHub OAuth flow.
Ollama
Ollama auto-detects when running at http://127.0.0.1:11434. No API key needed.
[providers.ollama]
enabled = true
# base_url = "http://127.0.0.1:11434/v1" # Override for remote Ollama
LM Studio
LM Studio auto-detects when running at http://127.0.0.1:1234. No API key needed.
Also works with llama.cpp or any OpenAI-compatible local server.
[providers.lmstudio]
enabled = true
# base_url = "http://127.0.0.1:1234/v1" # Override for different port/host
Local LLM
Local LLM runs GGUF models directly on your machine.
- Go to Settings → Providers → Local LLM.
- Choose a model from the local registry or download one.
- Save and select it as your active model.
Switching Models
- Per session: Use the model selector in the chat UI.
- Per message: Use
/model <name>in chat. - Global defaults: Use
[providers].offered, providermodels = [...], and[chat].priority_modelsinmoltis.toml.
Troubleshooting
”Model not available”
- Check provider auth is still valid.
- Check model ID spelling.
- Check account access for that model.
”Rate limited”
- Retry after a short delay.
- Switch provider/model.
- Upgrade provider quota if needed.
”Invalid API key”
- Verify the key has no extra spaces.
- Verify it is active and has required permissions.