Skip to content

Latest commit

 

History

History
194 lines (138 loc) · 7.03 KB

File metadata and controls

194 lines (138 loc) · 7.03 KB

Providers

LLxprt Code works with multiple AI providers. You can switch between them mid-session, set up failover across accounts, or create your own provider aliases.

Built-in Providers

LLxprt Code ships with aliases for these providers — just use /provider <name> to switch:

Provider Alias Default Model Auth
Anthropic anthropic claude-opus-4-8 OAuth or API key
Google Gemini gemini gemini-2.5-pro API key or Vertex AI
OpenAI (API) openai gpt-5.5 API key
OpenAI (ChatGPT subscription) codex gpt-5.6-sol OAuth
Qwen qwen qwen3-coder-plus API key
xAI xai grok-4 API key
Kimi kimi kimi-for-coding API key
DeepSeek deepseek deepseek-v4-flash API key
Z.AI zai glm-5 API key
Synthetic Synthetic hf:zai-org/GLM-4.7 API key
Chutes.ai chutes-ai zai-org/GLM-5-TEE API key
Mistral mistral mistral-large-latest API key
Cerebras Code cerebras-code qwen-3-coder-480b API key
OpenRouter openrouter nvidia/nemotron-nano-9b-v2 API key
Fireworks fireworks fireworks/minimax-m3 API key
Makora makora nvidia/Kimi-K2.6-NVFP4 API key
Ollama Cloud ollama-cloud kimi-k2.6 API key
LM Studio lm-studio gemma-3b-it None (local)
llama.cpp llama-cpp local-model None (local)

Switching Providers

/provider anthropic
/provider gemini
/provider Synthetic

From the command line:

llxprt --provider anthropic
llxprt --provider Synthetic

Authentication

OAuth (Recommended for Subscriptions)

If you have an existing subscription with Anthropic or OpenAI (via Codex), use OAuth — no API key needed:

/auth anthropic enable
/auth codex enable

From the command line:

llxprt --provider codex

Each enable command sets up lazy OAuth — a browser opens automatically when you make your first request to that provider. Use /auth <provider> login to open the browser immediately. See OAuth Setup for details.

API Keys (Keyring)

Use /key save to store an API key in your system keyring. You only need to do this once — the key is stored securely and never exposed to the LLM. Keys are automatically masked when you paste them.

/key save anthropic sk-ant-***your-key***
/key save openai sk-***your-key***
/key save synthetic syn-***your-key***
/key save xai xai-***your-key***

Then load a saved key:

/key load anthropic
/key load synthetic

From the command line, use --key-name to load a saved key:

llxprt --provider anthropic --key-name anthropic
llxprt --provider Synthetic --key-name synthetic

After saving a key once, you only need /key load <name> (or --key-name <name>) in future sessions.

Note: Avoid environment variables for API keys when possible. The keyring is more secure — keys aren't visible in your shell environment, process list, or shell history, and the LLM never has access to them. See Authentication for details on all key methods and why the keyring is preferred.

Model Selection

Select a model with /model:

/model claude-opus-4-8
/model gemini-2.5-pro
/model grok-4

From the command line:

llxprt --provider anthropic --model claude-opus-4-8

Use /model with no arguments to see available models for the current provider.

Custom Base URL

Some providers or self-hosted endpoints need a custom base URL. Use /baseurl:

/provider openai
/baseurl https://my-company-proxy.example.com/v1/
/model my-custom-model

From the command line:

llxprt --provider openai --base-url https://my-company-proxy.example.com/v1/ --model my-custom-model

This is useful for corporate proxies, self-hosted inference servers, or any OpenAI-compatible endpoint.

Creating Your Own Provider Alias

If you frequently use a provider that isn't built in, or a custom endpoint, save it as an alias so you don't have to reconfigure each time.

Using the CLI

Configure your provider, then save:

/provider openai
/baseurl https://api.myprovider.com/v1/
/key save myprovider mp-***your-key***
/key load myprovider
/model my-model
/provider save myprovider

The new alias appears immediately in /provider and persists across sessions.

Manual Alias Files

Create <data>/providers/<alias>.config in LLxprt's data directory (overridable via LLXPRT_DATA_HOME, with LLXPRT_CONFIG_HOME as a compatibility fallback):

{
  "baseProvider": "openai",
  "base-url": "https://api.myprovider.com/v1/",
  "defaultModel": "my-model",
  "description": "My custom provider",
  "apiKeyEnv": "MYPROVIDER_API_KEY"
}

Fields:

  • baseProvider (required) — Base implementation to use (openai, anthropic, gemini).
  • base-url — Endpoint URL. Defaults to the base provider's URL when omitted.
  • defaultModel — Pre-selects the model shown in the UI.
  • description — Optional helper text shown in /provider.
  • apiKeyEnv — Environment variable to read the API key from (fallback if no keyring key is loaded).

Troubleshooting

Authentication Errors

  • Verify your API key is correct with /key load <name>
  • For OAuth, try /auth <provider> logout then /auth <provider> enable
  • Check /auth <provider> status

Model Not Found

  • Use /model with no arguments to list available models
  • Check the provider's documentation for current model names

Rate Limiting and Quotas

  • Use /stats quota to check your current usage
  • Consider switching providers or setting up multi-account failover if you hit limits frequently

Related