Skip to main content

Configuration

All persistent state for the CLI lives under ~/.locopilot/.

~/.locopilot/
├── db.sqlite # local inference + training history (Free tier)
├── .env # environment variables loaded by every command
└── config.json # Pro-tier token + tunnel URL cache (mode 0600)

.env — environment variables

Created by locopilot init. Loaded by paths.loadEnv() at the start of every CLI command and by the API server.

VariableDefaultPurpose
API_PORT8080Port the local API listens on
OLLAMA_HOSThttp://localhost:11434Where to reach Ollama
SQLITE_PATH~/.locopilot/db.sqliteLocal DB file
LOCOPILOT_CLOUD_URL(unset)Override for the cloud control-plane URL (legacy / local dev). Wins over INFRARIX_API_URL.
INFRARIX_API_URL(unset)Same role as above on the unified Infrarix Platform backend.
RATE_LIMIT_RPM60Default per-key rate limit for Pro requests (Free tier is unrate-limited locally). The cloud enforces the real limit.

The CLI's cloud client falls back to https://api.infrarix.com when neither override is set — the unified Infrarix Platform backend preserves LocoPilot's /api/* contract end-to-end.

config.json — Pro credentials

Written by locopilot login. Removed by locopilot logout.

{
"token": "qs_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"tunnel": {
"url": "https://something.trycloudflare.com",
"updatedAt": "2026-05-09T14:32:11.000Z"
}
}

The file mode is 0600 so only the current user can read it.

Tier detection

Tier is determined purely client-side by the presence of a qs_… token in config.json:

// src/cloud/client.ts
export function readCloudConfig(): LocoPilotConfig | null {
// ... reads ~/.locopilot/config.json
if (typeof cfg.token === 'string' && cfg.token.startsWith('qs_')) {
return { token: cfg.token };
}
return null;
}

export function isProUser(): boolean {
return getCloudToken() !== null;
}

isProUser() proves the user has logged in, not that they have an active Pro subscription. Subscription status is enforced server-side and may return 403 pro_subscription_required even with a valid token — the cloud client surfaces that as a ProSubscriptionRequiredError with the upgrade URL. There is no offline cache of subscription state.

(locopilot login separately requires the token to be at least 20 characters before saving it — a sanity check on copy-paste, not a security guarantee.)

Server flags

locopilot start accepts a single flag:

locopilot start --port 8081
# or
API_PORT=8081 locopilot start

The flag wins over the env var. See locopilot start.