Skip to content

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

typeMeaning
ollama (default)Existing local Ollama path
xaiGrok via https://api.x.ai/v1, key env XAI_API_KEY
openai_compatibleAny 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:

yaml
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_KEY

In the TUI:

text
/provider              # opens the provider picker
/provider list
/provider xai
/provider ollama

Also: 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:

yaml
privacy:
  local_only: false

provider:
  type: xai
  model: grok-4.5

TinyVault setup

bash
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-only

Launch with every key you might switch to:

bash
tvault run -p local-agent --only XAI_API_KEY,OPENAI_API_KEY,OPENROUTER_API_KEY -- \
  env LOCAL_AGENT_LOCAL_ONLY=false local-agent

Or only the keys for the active remote:

bash
tvault run -p local-agent --only XAI_API_KEY -- env \
  LOCAL_AGENT_PROVIDER=xai \
  LOCAL_AGENT_LOCAL_ONLY=false \
  local-agent

Environment overrides

VariablePurpose
LOCAL_AGENT_PROVIDERProfile name (multi) or type (flat): ollama, xai, openai_compatible, …
LOCAL_AGENT_PROVIDER_BASE_URLOverride active profile base_url
LOCAL_AGENT_PROVIDER_MODELOverride active profile model
LOCAL_AGENT_PROVIDER_API_KEY_ENVOverride env var name for the key
LOCAL_AGENT_PROVIDER_CONTEXT_SIZEHost-side context budget
LOCAL_AGENT_LOCAL_ONLYMust be false for non-loopback remotes
LOCAL_AGENT_MODELAlso 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: true until 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,KEY2 over 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_only is false.

Local-first by default. Approval-gated by design.