Remote providers
Local Agent defaults to Ollama on the local machine. Remote chat is opt-in through OpenAI-compatible provider profiles. Secrets stay out of YAML: only environment variable names are configured; values are injected at launch (recommended: TinyVault / tvault).
Supported types
type | Meaning |
|---|---|
ollama (default) | Existing local Ollama path |
xai | Grok via https://api.x.ai/v1, key env XAI_API_KEY |
openai_compatible | Any OpenAI-style chat API (OpenAI, OpenRouter, local vLLM, …) |
Remote profiles require privacy.local_only: false (or LOCAL_AGENT_LOCAL_ONLY=false).
SuperGrok / X Premium chat subscriptions are not API credentials. Create a key at console.x.ai. No X Platform developer app is required.
Multi-profile config
Install several providers and pick one with active, /provider, or env:
privacy:
local_only: false
provider:
active: ollama
profiles:
ollama:
type: ollama
xai:
type: xai
model: grok-4.5
openai:
type: openai_compatible
base_url: https://api.openai.com/v1
model: gpt-4.1
api_key_env: OPENAI_API_KEY
openrouter:
type: openai_compatible
base_url: https://openrouter.ai/api/v1
model: anthropic/claude-sonnet-4
api_key_env: OPENROUTER_API_KEYIn the TUI:
/provider # opens the provider picker
/provider list
/provider xai
/provider ollamaAlso: Settings (ctrl+p) → Provider, or complete /provider with profile names.
The last /provider selection is saved in ~/.config/local-agent/runtime-preferences.json and restored on the next launch unless you set LOCAL_AGENT_PROVIDER for that process.
LOCAL_AGENT_PROVIDER=xai selects the profile named xai when a catalog exists; with the flat form it still sets provider.type.
Flat single-provider form
Still supported for one remote backend:
privacy:
local_only: false
provider:
type: xai
model: grok-4.5TinyVault setup
tvault set -p local-agent XAI_API_KEY # from console.x.ai
tvault set -p local-agent OPENAI_API_KEY # optional
tvault set -p local-agent OPENROUTER_API_KEY # optional
tvault list -p local-agent --names-onlyLaunch with every key you might switch to:
tvault run -p local-agent --only XAI_API_KEY,OPENAI_API_KEY,OPENROUTER_API_KEY -- \
env LOCAL_AGENT_LOCAL_ONLY=false local-agentOr only the keys for the active remote:
tvault run -p local-agent --only XAI_API_KEY -- env \
LOCAL_AGENT_PROVIDER=xai \
LOCAL_AGENT_LOCAL_ONLY=false \
local-agentEnvironment overrides
| Variable | Purpose |
|---|---|
LOCAL_AGENT_PROVIDER | Profile name (multi) or type (flat): ollama, xai, openai_compatible, … |
LOCAL_AGENT_PROVIDER_BASE_URL | Override active profile base_url |
LOCAL_AGENT_PROVIDER_MODEL | Override active profile model |
LOCAL_AGENT_PROVIDER_API_KEY_ENV | Override env var name for the key |
LOCAL_AGENT_PROVIDER_CONTEXT_SIZE | Host-side context budget |
LOCAL_AGENT_LOCAL_ONLY | Must be false for non-loopback remotes |
LOCAL_AGENT_MODEL | Also sets the remote model when a remote profile is active |
API key values are read only from os.Getenv(api_key_env).
What stays local
- Default remains Ollama with
privacy.local_only: trueuntil you open remote profiles. - ICE embeddings still use Ollama when ICE is enabled.
- Expert Team/Swarm/MoE stays local-Ollama multi-model and is disabled while a remote profile is active.
- TinyVault MCP is optional for secret tools; provider credentials should use
tvault run --only ….
Safety notes
- Prefer
tvault run --only KEY1,KEY2over dumping the whole vault into the shell. - Do not put API keys in YAML, git, or shell history.
- Remote inference sends prompts and tool receipts to the selected provider once
local_onlyis false.