Skip to content

Configuration

Configuration uses TOML with a schema version. The validator rejects unknown fields and invalid values before the service starts.

The desktop app covers the normal path without editing TOML:

  1. In Providers, add LM Studio, Ollama, OpenAI, Anthropic, or a compatible endpoint. API keys are stored in the macOS credential store.
  2. In Models & routes, create a stable alias, choose its provider, and enter the upstream model name expected by that provider.
  3. Return to Chat and select the alias or a route.

LiteGate starts without fictional providers or models. The gateway may be live at 127.0.0.1:4100, but Chat stays gated until at least one model is configured.

The repository includes tests/fixtures/config/valid-phase1.toml:

version = 1
[server]
listen = "127.0.0.1:4000"
request_timeout_ms = 120000
max_body_bytes = 1048576
max_concurrent_requests = 16
[[providers]]
id = "mock"
kind = "openai-compatible"
base_url = "http://127.0.0.1:4100/v1"
locality = "local"
authentication = "none"
[[models]]
id = "mock-chat"
provider = "mock"
upstream_model = "mock-chat-v1"

The mock destination is example configuration: this file does not start a model server. LiteGate does not run or download user models either.

Use an explicit path for reproducible results:

Terminal window
cargo run -p litegate-cli -- config validate --config tests/fixtures/config/valid-phase1.toml

The LITEGATE_CONFIG environment variable is also available. Selection prioritizes --config, then that variable, and finally the platform path. When getting started, use --config to avoid ambiguity.

Validation does not check network availability, credentials or actual model capabilities. Provider secrets are managed through the operating system’s credential store; do not add them to the example.