New Tool Radar

Local Model Setup

How to Let Other Machines on Your Network Call Jan’s API Server

Change Jan's local API server host from 127.0.0.1 to 0.0.0.0 and set trusted hosts, so devices on your network can call it.

Schematic diagram with four steps: change the host to 0.0.0.0, set the trusted hosts list, set the API key, then call the server from another device on the network.

Jan’s server binds to 127.0.0.1 by default, which means only the same machine can call it. To let a phone or another computer on your network call it, change the host to 0.0.0.0 — and set trusted hosts so the server does not answer just anyone.

Change the host and set trusted hosts

In Jan’s local API server settings, change the host from 127.0.0.1 to 0.0.0.0 and set the trusted hosts list to the devices you expect — the server’s trusted-hosts setting controls which origins it answers. The port stays 1337 and the API prefix stays /v1, so clients on the network call http://<your-machine-ip>:1337/v1.

Host: 0.0.0.0   (was 127.0.0.1)
Port: 1337
API prefix: /v1
# clients call http://<your-machine-ip>:1337/v1

Binding to 0.0.0.0 exposes the server to your whole network, and to anything else that can reach the machine: set the API key first, and check your firewall. A server open to the network without a key is an open model for anyone on it.

Try it: four checks

Check What you should see If you do not see it
Host changed The host is 0.0.0.0 127.0.0.1 only serves this machine
Trusted hosts set The trusted hosts list has your devices Do not leave it open
Network call works Another device calls /v1/models Use the machine’s network IP
API key on The call needs the Bearer key Set the key before exposing

Expected result. We checked the Jan local API server docs, which give the default host 127.0.0.1 versus 0.0.0.0, the default port 1337, the /v1 prefix, and the trusted hosts setting. We did not change the host on this machine.

Limits

This guide covers the host and trusted-hosts settings only. Network exposure needs a firewall and an API key. We did not test any setting ourselves.

Sources

See all