Discover Pico AI Homelab servers using Bonjour
Pico AI Homelab broadcasts its hostname, IP address and port using Bonjour by default. Chat applications can listen to these Bonjour broadcasts to automatically connect to Pico AI Homelab.
Consider enhancing user convenience of your chat app by adding the option to automatically detect Pico AI Homelab servers on the user's local network using Bonjour.
Pico AI Homelab will broadcast its human readable instance name (e.g. Ronald's AI Homelab), the server's local hostname (e.g. macbook-pro.local), IP address and the port Pico AI Homelab is running on (e.g. 11434).
A chat app can use this infrormation to automatically configure the app to connect to Pico AI Homelab, without the user needing to enter IP addresses or host names. Bonjour dramatically simplifies settings up chat clients.
From the chat app user's perspective, these are the steps to take:
In settings or during setup, the user taps a "Scan for Pico AI Homelab" button.
The chat app will now listen to Bonjour packets sent by all Pico AI Homelab instances on the local area network.
The app displays a list of available Pico AI Homelab instances for the user to select. Each Pico AI Homelab instance has a human readable name. It is recommended to show the human readable name to the user.
The user selects one or more Pico AI Homelab servers to connect to connect to
The app will automatically store the server name, port, ip address and/or host name and (re)connect to the server automatically
Users can disable Bonjour in the Pico AI Homelab settings. Chat apps should not depend solely on Bonjour for connections. Always provide an alternative method for users to manually enter the port and hostname or IP address of the Pico AI Homelab server they wish to connect to.
Pico AI Homelab broadcasts Bonjour service _pico._tcp,
the human readable service name (e.g. Ronald's AI Homelab) and send a dictionary in the Bonjour txtRecord
with the following info:
IPAddress
: The IP address of the Pico AI Homelab serverPort
: The port number, specified as a string, to which the Pico AI Homelab HTTP server is bound. Default is11434
.LocalHostName
: The local host name, e.g. ronalds-macbook.localServerIdentifier
: A unique UUID string to identify a Pico AI Homelab instance, even if IP address, serice name, and local host name changed.
Example projects
Sample client code
Make sure to update your app settings:
If your app is sandboxed, enable
Outgoing Connections (Client)
inSigning & Capabilities -> App Sandbox
.
Last updated