Skip to content

Pairing and the link to your account

Pair this machine with your Cinchapi account, and Cinchapi can use its models:

pasture pair

Cinchapi can also reach this machine in two other ways. A Cinchapi app in your browser can call pasture directly once you allow its origin, and a server with a public name can serve HTTPS to Cinchapi.

Pair this machine

pasture pair prints a code and opens cinchapi.com/pair in your browser with the code filled in. Sign in, check the code, and approve. Where no browser opens, such as on a server you reach over SSH, open the page on any device and enter the code. The code works for 10 minutes.

pasture install ends by offering to pair, so a new machine installs and pairs in one step. pasture pair --name "Office server" sets the name your account shows. The default is the machine's name.

Pairing saves this machine's node key in node.json, next to the config, and only you can read the file. pasture unpair deletes it. Your account lists the machine, offline, until you remove it in your account's settings, which also revokes its key.

While the machine is paired, pasture keeps a link to your account. The machine starts every request, as ordinary HTTPS, so it works behind a home router with no port to open. pasture tells your account which models it has, then asks it for work. Cinchapi hands it requests, and pasture answers them the way it answers any request: a request for a moved-away model waits while the model comes back. The link serves only these requests, and answers 403 to any other:

  • POST /v1/chat/completions, POST /v1/completions, and POST /v1/embeddings;
  • GET /v1/models and GET /api/pasture/models.

It serves four requests at a time, and asks for more only while it serves fewer. It tells your account its models again within 10 seconds of a change, and at least once a minute. When a request to your account fails, pasture tries again after 1 to 60 seconds, longer after each failure in a row, and at once after the machine wakes or its network changes. pasture status says how the link stands:

Linked to your Cinchapi account as node 9f1c2b7e-3d4a-4f5b-8c6d-7e8f9a0b1c2d. Cinchapi can use these models.

account_url in the config names another account server, such as a staging server. It defaults to https://api.cinchapi.com.