Configure the gateway
From the application checkout on the model host:INFERENCE_GATEWAY_TOKEN. The worker uses the same value in NGRAM_INFERENCE_GATEWAY_TOKEN, along with the public gateway root in NGRAM_INFERENCE_BASE_URL.
Operate the stack
127.0.0.1:8010; the tunnel handles remote connectivity.
To stop the gateway while preserving Ollama:
Cloudflare Access
When the route also requires Cloudflare Access service authentication, the worker acceptsNGRAM_CF_ACCESS_CLIENT_ID and NGRAM_CF_ACCESS_CLIENT_SECRET. Supply both privately; a partial pair is rejected.
The Access credentials and the gateway bearer token serve different checks. Keep both sides aligned and do not put them in a shell’s public manifest.
Diagnose each hop
Confirm the local model endpoint, local gateway, tunnel, and remote worker in that order. A reachable tunnel with a rejected bearer token is an authentication problem; an authenticated gateway that cannot reach Ollama is a backend problem. Use gateway status and worker logs to identify the failing hop before changing model IDs or memory configuration. Hosted providers use different health and catalog paths, so do not use a gateway/health assumption for every API provider.