Documentation · Connect a tool

Set up Pi

Pi is a terminal coding agent, and the one we recommend. One command adds Tenvor to it with the model, asks for your key at a hidden prompt, and keeps everything else you have set up.

Guides and contents

What you need

Our recommended tool

We recommend Pi because it is lighter.

  • A Tenvor API key, from the Console. See your first request.
  • On macOS or Linux: Bash, curl and Python 3.8 or newer.
  • On Windows 10 or 11: PowerShell and Python 3.8 or newer. Windows includes curl.exe. Pi runs its commands in Git Bash, which comes with Git for Windows. You can also use WSL and the Bash command, which sets up Pi inside WSL.
  • Pi 1.1.0 or newer, but not Pi 2 yet. The setup was tested on Pi 1.1.0 and 1.2.0.

Pi does not ask before it acts

Pi reads, edits and runs commands as you, and it does not ask for approval before every tool call. Use a synthetic or non-sensitive project during the alpha. Keep it under version control. A coding tool sends your source, tool arguments, terminal output and chat history with each request, and requests are not yet encrypted on the node that runs them. Pi's own guide to running it in isolation covers containers and virtual machines.

Install Pi

If Pi is not installed, the setup says so and points you to pi.dev, where Pi's own install instructions are. It runs Pi's installer only if you answer y. The default is no, and nothing is installed without that answer. To install Pi yourself, follow the instructions on pi.dev.

On macOS and Linux: Pi needs Node.js 22.19 or newer and npm. The setup checks for them before it offers the installer. If they are missing it stops and says so: Pi's installer offers to install them and asks first, and on some systems that asks for your sudo password. The setup itself never uses sudo.

The installer the setup runs is a copy Tenvor reviewed, and the setup checks it against its SHA-256 before it runs it. If the installer on pi.dev has changed since, the setup runs nothing and says so. The setup pins the installer script. It does not pin the Pi release or the npm packages that script then downloads.

On macOS and Linux, Pi's installer shows its own menu and asks again before it installs. It puts Pi in your Pi folder and links the pi command into a folder on your PATH, which on a Mac may be Homebrew's folder. It asks before it edits a shell startup file, and pressing Enter there means yes.

On Windows, the setup offers Pi's installer for Windows, a copy Tenvor reviewed and pinned the same way. It does not need Node.js first, and it runs as you, in the same window. Pi's installer asks its own questions, and pressing Enter at each one means yes:

  • If Node.js 22.19 or newer is missing, it first offers to install Node.js for your user.
  • Its menu then installs Pi in your Pi folder. Press n there to stop without installing Pi. Node.js, if it installed that first, stays installed.
  • If Git Bash is missing, it offers Portable Git, which it sets as Pi's shell in Pi's settings.json. It may also offer winget, which installs Git for every user and can ask for administrator rights.
  • At the end, it may offer to add Pi to your user PATH. The setup finds Pi without that, but to start it by typing pi, open a new window first: only windows opened afterwards see the change.

Run the setup

Copy the command for your system into your terminal. The tabs open on the system this browser runs on. It downloads the launcher and runs it. Paste your key at the prompt and press Enter. The key never shows: on Windows a * appears for each character, and on macOS and Linux nothing appears. Never put the key in the command line.

The Pi setup command for your system
Terminal
curl -fsS https://tenvor.io/setup/pi.sh -o tenvor-pi.sh && bash tenvor-pi.sh

PowerShell
irm https://tenvor.io/setup/pi.ps1 | iex

Command Prompt
curl -fsSL https://tenvor.io/setup/pi.cmd -o tenvor-pi.cmd && tenvor-pi.cmd

You can read the Bash launcher, the PowerShell launcher, the Command Prompt launcher and the Python helper first. The launcher checks the helper against its own pinned SHA-256 before it runs it. The launcher's own SHA-256 is e4d73b3b33fc9731b12e941b6c31f27615cccb4df400ab65def07a7d7896f54e.

On Windows, the PowerShell command downloads the PowerShell launcher and runs it in that window, and it never closes the window. The Command Prompt command saves tenvor-pi.cmd, which downloads the same PowerShell launcher and runs it. The launcher uses Windows' own curl.exe and runs the helper in Python's isolated mode, which ignores PYTHONPATH and your own Python packages. The PowerShell launcher's SHA-256 is 7ae2355a89154f35d33d9662effb99225cc517cf8d58687e7ead208be08ed068, and the Command Prompt launcher's is 07507181e8ca45064b8c3b1dbf114f7e374adfec436ffd69440ea12499ab7cc9.

The setup reads the model's context window and output limit from the live public catalog when you run it, not from this page. It also keeps a single reply well below the whole window: Pi sizes each request's reply allowance from its own estimate of the conversation, and the cap leaves room for that estimate to fall short. If it cannot read the catalog, it stops and writes nothing.

What it changes

Everything is in Pi's folder, usually ~/.pi/agent (%USERPROFILE%\.pi\agent on Windows), or the folder that PI_CODING_AGENT_DIR names. The setup copies models.json and settings.json beside themselves before it changes them. It does not keep a copy of auth.json, because that file holds keys. It replaces each file in one step. If a step fails, or Pi does not accept the result, it puts every file back.

What the setup writes
FileWhat it does
models.jsonAdds the tenvor provider and the chat-35b-moe model. The rest of the file, comments included, stays exactly as it was.
auth.jsonAdds your key, the way Pi keeps its own credentials. On macOS and Linux the file is readable only by you. On Windows it has your user profile's permissions: by default only you, administrators and the system can read it.
settings.jsonMakes tenvor/chat-35b-moe Pi's default model only if you have not chosen one. If you have, the file is left alone and the setup says so.
.tenvor-pi-state.jsonRecords what the setup added, so that removing it undoes only that.
extensions/tenvor-session-kv.jsA small Pi extension (see Long sessions). Pi loads it by itself the next time it starts. The setup writes it only where no other file of that name is, and --no-cache-extension skips it.
.tenvor-pi-cache-state.jsonRecords the extension, and the name of any temporary file the setup is about to create, so that updating or removing it touches only those.

Nothing else in these files changes: your other providers, credentials and settings stay exactly as they are. If a file is not in a shape the setup can edit without risk, or already holds a tenvor entry the setup did not add, it stops and changes nothing. You can run the setup again at any time: if nothing has changed, it changes nothing and writes no backup.

When it finishes, the setup asks Pi whether it lists the model. If Pi does, the setup says it is set up. If Pi does not accept the change, the setup puts every file back and stops. If Pi runs but does not list the model, the setup leaves the files, says it is not confirmed, and exits with a non-zero status. The extension is added last, and only once Pi lists the model. If that step cannot finish, the setup says so in one line, and the model setup stands.

If your settings list enabledModels, Pi starts with the first model that matches the list, before the default. The command below always starts Pi with Tenvor.

Start Pi

The setup prints the exact command. You do not need to restart your terminal. It is usually:

Start Pi with Tenvor
pi --provider tenvor --model chat-35b-moe

You can also select the command and copy it manually.

The provider's base URL is https://orchestrator.tenvor.io/v1. If you had no default model, Tenvor is now Pi's default and plain pi starts with it too. If you had one, it is unchanged, and the command above still starts Pi with Tenvor.

On Windows, if pi is not found right after Pi's installer ran, open a new PowerShell or Command Prompt window: Pi's folder is added to your PATH for windows opened afterwards. If PowerShell says that running scripts is disabled when you type pi, type pi.cmd instead, here and in the commands below. The setup's own printed command already does that when it is needed.

Check that it works

Use a synthetic project. If Pi can switch providers or pick a model for you, turn that off for these checks: another provider's answer says nothing about Tenvor.

Send one short request
pi --provider tenvor --model chat-35b-moe --print "Say hello in one line."

You can also select the command and copy it manually.

  1. Read the reply

    Pi prints one line. If it does not, run pi --list-models tenvor and pi auth check --provider tenvor. The setup asked Pi the same two things when it finished, and told you what it found.

  2. Find the charge

    Open the Usage page in the Console. The request is there as a charge, and in your spend for the day.

A configured URL, or a reply that says it is Tenvor, does not prove a request ran on Tenvor. A charge on the Usage page does.

Long sessions

The setup also installs a small Pi extension, tenvor-session-kv.js. It adds three request headers to requests for the Tenvor model and changes nothing else. If anything in it goes wrong, the request goes out without them. It is plain JavaScript, pinned by checksum, and part of the Python helper, so you can read it before you run anything.

Reuse is never guaranteed. Input the node reuses is billed at half the input price, and shows as cached_input_tokens on the receipt.

The extension was tested on Pi 1.1.0 and 1.2.0. It goes in extensions/tenvor-session-kv.js in Pi's folder. The setup never writes over a file of yours with that name, and that includes a file with the same contents: it leaves that file as it is, does not record it as its own, and does not delete it when you remove the setup. Pi would not load the extension from a folder that has its own index.js or index.ts, or a package.json that lists extensions, whatever it lists, because Pi then loads only what that names. The setup skips the extension in that case, and when the folder is a symlink or, on Windows, a junction, and says so.

To set up without the extension, add --no-cache-extension to the command. To remove it together with the rest of the setup, run bash tenvor-pi.sh --remove (on Windows, & ([scriptblock]::Create((irm https://tenvor.io/setup/pi.ps1))) --remove in PowerShell, or tenvor-pi.cmd --remove in Command Prompt). To remove only the extension, delete extensions/tenvor-session-kv.js from Pi's folder, and add --no-cache-extension whenever you run the setup again: a plain run puts the file back.

While it works on the extension, the setup holds a lock file, .tenvor-pi-cache.lock, in Pi's folder and removes it when it finishes. If you run the setup twice at once, the second run waits up to 30 seconds, then skips the extension and says so. The exit status does not change.

Two limits apply to long sessions. A request over either is refused with HTTP 400 and the message dynamic request is invalid. See Find your error.

  • A request may carry at most 256 messages. Start a new Pi session to continue.
  • A request whose history has tool calls must still list the tools those calls used. A request with earlier tool calls and an empty tools list is refused, which is what happens if you turn tools off in the middle of a Pi session.

Replace your key

Run these commands in the folder where the setup command saved tenvor-pi.sh, or tenvor-pi.cmd in Command Prompt on Windows (the PowerShell form needs no saved file). If the launcher says the helper failed verification, it is out of date: download it again with the setup command above, then run the command you wanted.

To use a replacement key, replace it in the Console, then run the next command and paste the new key at the prompt. The old key stops working as soon as you replace it.

Give Pi a new key
Terminal
bash tenvor-pi.sh --rotate-key

PowerShell
& ([scriptblock]::Create((irm https://tenvor.io/setup/pi.ps1))) --rotate-key

Command Prompt
tenvor-pi.cmd --rotate-key

This runs the setup again with the new key. It replaces the Tenvor entry in auth.json and keeps no copy of the old key. It also brings the provider in models.json up to date with the live catalog. A plain rerun of the setup leaves a key you replaced yourself in Pi as you set it. --rotate-key writes the key you type over it.

Remove the setup

Remove the local setup
Terminal
bash tenvor-pi.sh --remove

PowerShell
& ([scriptblock]::Create((irm https://tenvor.io/setup/pi.ps1))) --remove

Command Prompt
tenvor-pi.cmd --remove

This removes only what the setup added to Pi on this machine. It takes the key out of auth.json and keeps no copy of it. If the setup made Tenvor your default model, it puts back the setting you had. If you edited a Tenvor entry yourself since, the setup leaves your edit in place and says so.

It also removes the cache extension, but only a file whose contents are still exactly what the setup recorded when it wrote it. A file that was already there before the setup stays in place, and the setup said so when it ran. A file that you changed since stays in place, and the removal says so and what to do: move or delete the file, then run the removal again. Until the file is gone, the setup keeps its record of the extension, so that running the removal again finishes the job.

The setup deletes its record of the extension only after it has checked that the extension file is gone and that nothing of its own is pending. If it cannot make that check, the record stays. It deletes a temporary file only if the record lists its name and the file holds what the setup wrote. A file that merely looks like one, or a listed name that holds anything else, stays in place, and so does the record.

The copies of models.json and settings.json that the setup made stay where they are. They hold no Tenvor key, and you can delete them. The setup does not uninstall Pi, and it does not revoke your key on Tenvor. To do that, use the API keys page in the Console.

Content checked . Live limits and prices can change.