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 open to your account. The machine connects out, so it works behind a home router with no port to open. Cinchapi sends its requests down the link, 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. When a link that was open for at least 30 seconds closes, pasture opens it again at once. Otherwise, as when it cannot connect, pasture opens it 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 9f1c2b. 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.