Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

ProviderConfig NameEnv VariableFeatures
AnthropicanthropicANTHROPIC_API_KEYStreaming, tools, vision
OpenAIopenaiOPENAI_API_KEYStreaming, tools, vision, model discovery
Google GeminigeminiGEMINI_API_KEYStreaming, tools, vision, model discovery
DeepSeekdeepseekDEEPSEEK_API_KEYStreaming, tools, model discovery
MistralmistralMISTRAL_API_KEYStreaming, tools, model discovery
GroqgroqGROQ_API_KEYStreaming
xAI (Grok)xaiXAI_API_KEYStreaming
OpenRouteropenrouterOPENROUTER_API_KEYStreaming, tools, model discovery
CerebrascerebrasCEREBRAS_API_KEYStreaming, tools, model discovery
MiniMaxminimaxMINIMAX_API_KEYStreaming, tools
Moonshot (Kimi)moonshotMOONSHOT_API_KEYStreaming, tools, model discovery
VeniceveniceVENICE_API_KEYStreaming, tools, model discovery
Z.AI (Zhipu)zaiZ_API_KEYStreaming, tools, model discovery

OAuth Providers

ProviderConfig NameNotes
OpenAI Codexopenai-codexOAuth flow via web UI
GitHub Copilotgithub-copilotRequires active Copilot subscription

Local

ProviderConfig NameNotes
OllamaollamaLocal or remote Ollama instance
LM StudiolmstudioLocal LM Studio or any OpenAI-compatible server
Local LLMlocal-llmRuns 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

  1. Open Moltis in your browser.
  2. Go to SettingsProviders.
  3. Choose a provider card.
  4. Complete OAuth or enter your API key.
  5. 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-preview-05-20", "gemini-2.0-flash"]
# 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:

OptionDefaultDescription
enabledtrueEnable or disable the provider
api_keyAPI key (overrides env var)
base_urlOverride API endpoint URL
models[]Preferred models shown first in the picker
fetch_modelstrueDiscover available models from the API
stream_transport"sse""sse", "websocket", or "auto"
aliasCustom 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.

  1. Get an API key from Google AI Studio.
  2. Set GEMINI_API_KEY in your environment (or use GOOGLE_API_KEY).
  3. Gemini models appear automatically in the model picker.
[providers.gemini]
enabled = true
models = ["gemini-2.5-flash-preview-05-20", "gemini-2.0-flash"]

Gemini supports native tool calling, vision/multimodal inputs, streaming, and automatic model discovery.

Anthropic

  1. Get an API key from console.anthropic.com.
  2. Set ANTHROPIC_API_KEY in your environment.

OpenAI

  1. Get an API key from platform.openai.com.
  2. Set OPENAI_API_KEY in your environment.

OpenAI Codex

OpenAI Codex uses OAuth-based access.

  1. Go to SettingsProvidersOpenAI Codex.
  2. Click Connect and complete the auth flow.
  3. 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.

Docker and cloud deployments

The OAuth flow redirects your browser to localhost:1455. In Docker, make sure port 1455 is published (-p 1455:1455). On cloud platforms where localhost cannot reach the server, authenticate via the CLI instead:

# Docker
docker exec -it moltis moltis auth login --provider openai-codex

# Fly.io
fly ssh console -C "moltis auth login --provider openai-codex"

The CLI opens a browser on your machine and handles the callback locally. If automatic callback capture fails, the CLI prompts you to paste the callback URL (or code#state) directly in the terminal. Tokens are saved to the config volume and picked up by the gateway automatically.

GitHub Copilot

GitHub Copilot uses OAuth authentication.

  1. Go to SettingsProvidersGitHub Copilot.
  2. Click Connect.
  3. Complete the GitHub OAuth flow.

Docker and cloud deployments

GitHub Copilot uses device-flow authentication (a code you enter on github.com), so it works from the web UI without extra port configuration. If you prefer the CLI:

docker exec -it moltis moltis auth login --provider github-copilot

Info

Requires an active GitHub Copilot subscription.

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.

  1. Go to SettingsProvidersLocal LLM.
  2. Choose a model from the local registry or download one.
  3. 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, provider models = [...], and [chat].priority_models in moltis.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.