Connectivity

Consumers must be able to reach your provider over UDP to 3️⃣ list offers, 4️⃣ request a session, and 5️⃣ send a chat request.
flowchart LR
    accTitle: Which provider port must be reachable?
    accDescr: The consumer connects to weftd over UDP. Only weftd connects to the model server over TCP. A cross marks the direct connection the consumer does not need.
    consumer["Consumer"]
    subgraph provider["Provider network"]
        daemon["weftd"]
        backend["Model<br/>server"]
    end
    consumer -->|"✅ QUIC (UDP)"| daemon
    daemon -->|"✅ Private TCP<br/>connection"| backend
    consumer -.-|❌ No direct connection| backend

Listen addresses

In config.yaml, the default 0.0.0.0 makes weftd listen on UDP 4001 on all local IPv4 interfaces:

network:
  listen_addresses:
    - "/ip4/0.0.0.0/udp/4001/quic-v1"

Replace 0.0.0.0 with the host’s local IP address that receives traffic from consumers. For example, if your router forwards UDP to 192.168.1.20, use /ip4/192.168.1.20/udp/4001/quic-v1. One listen address is usually enough; add another only if consumer traffic also arrives at that address.

With bridged Compose, keep 0.0.0.0 inside the container and bind the published UDP port to the consumer-facing host IP in compose.yaml instead (for example, "192.168.1.20:${WEFT_PROVIDER_PORT:-4001}:4001/udp").

Public endpoint

Choose how packets from the internet reach your listener. Add the settings from the matching tab under the existing network: key.

If the host has a public IP, no router mapping is needed. Advertise that IP and the UDP port exposed on the host. Replace 203.0.113.10 with your public IP:

  advertised_addresses:
    - "/ip4/203.0.113.10/udp/4001/quic-v1"

You can also advertise a public hostname, for example /dns4/weft.example.com/udp/4001/quic-v1. If your ISP periodically assigns you a new public IP, dynamic DNS (DynDNS) can keep the hostname pointed at your current IP so consumers can keep using the same address.

With UPnP, Weft asks your router to forward incoming UDP traffic from consumers to weftd. You don’t need to set up the port forward by hand.

Enable UPnP IGD on your router and configure Weft to use it:

  enable_upnp: true
  advertised_addresses: []

Weft advertises the public endpoint returned by the router. You don’t need to know your public IP. For Compose, use the bundled Linux host-network override so weftd can discover the router; it already enables UPnP.

On your router, forward an external UDP port to the host’s LAN IP and host port. Advertise the router’s public address and the external port. For example, if public UDP 5000 forwards to 192.168.1.20:4001, leave the listener on 4001 and advertise 5000:

  advertised_addresses:
    - "/ip4/203.0.113.10/udp/5000/quic-v1"

Replace 203.0.113.10 with your router’s public IP and leave UPnP off. With bridged Compose, the router’s forward must target the published host port.

Verify reachability

AutoNAT is an optional reachability check: weftd asks a peer to try connecting back to your public endpoint. Use a peer outside your network to test inbound access from the internet. The check does not open a port or change your firewall rules.

To run the check, enable AutoNAT in config.yaml:

network:
  enable_autonat: true

Run weft info and check:

  1. ADVERTISED includes the public address and port you expect consumers to dial.
  2. Last dial-back shows <peer ID> dialed <address> for that endpoint from a peer outside your network.

A bootstrap connection confirms outbound traffic. A UPnP Mapped result confirms that the router granted a mapping. Only the successful external dial-back confirms that the probing peer reached the provider.

Advanced: dial-back settings

With AutoNAT enabled, omit autonat_servers or set it to [] to use AutoNAT-capable seeds. To select specific probe peers, list their peer_id and addresses under network.autonat_servers. To disable probes, set enable_autonat: false; setting autonat_servers: null does not disable them. With bundled Compose, set the active file’s --property argument to network.enable_autonat=false and recreate the provider.

If the check fails, troubleshoot the public endpoint. If it succeeds but consumers on the same LAN still can’t connect, see LAN troubleshooting.