Pi provider templates
Issue #309 ships one completepi_providers file per provider in templates/pi-providers. Each file is valid JSON in Pi’s models.json shape: copy the whole file to .orbi/pi-providers.json, or copy its single entry into the providers object of an existing file. Set the two selectors in orbi.toml:
Catalog
A template being listed is not a promise of quota, availability, speed, or model support. The
Not tested labels are intentional.
Add a new provider
-
Copy the closest template and give it one provider id. Keep
baseUrl,api,apiKey, and a non-emptymodelslist together. The selectedpi_modelmust exactly match onemodels[].id. -
Use
openai-completionsfor OpenAI-compatible endpoints. Google Gemini usesgoogle-generative-ai; keep itsbaseUrlathttps://generativelanguage.googleapis.com/v1beta. -
Put the real key in
.orbi/env(gitignored, mode600) and use only$VARor${VAR}in the committed JSON:The installed[email protected]loads this file throughEnvironmentFile; it never belongs in Git or a template. Literal keys are a last-resort downgrade: keep the file gitignored and understand that the value can leak through local files and process tooling. -
For a manual tick, systemd is not loading
.orbi/env. Export it first, or source it into the current shell: -
Select only the provider/model in
orbi.toml; do not maintain commented provider blocks there. Run the loader/runner validation before a real task. It fails fast when the selected provider, model, endpoint, API, or selected key reference is invalid.
thinkingLevelMap
Do not invent a complete map for a provider. Gemini’s known-safe template form is exactly {"off": null}: other thinking levels use the provider default mapping. A copied null mapping for every level can send an unsupported value and produce a provider 400. For another provider, omit the field unless its Pi provider contract has been verified.
Google Gemini: AI Studio free tier
Use Google’s AI Studio API key page to create an API key. Keep the key local: the committed template referencesGOOGLE_API_KEY, so the literal value never belongs in Git, an Issue, a PR, or a journal.
-
Create or select a key in AI Studio, then add it to the gitignored environment file used by Orbi:
The installed systemd unit loads
.orbi/env. For a manual tick, export it first as described in Getting started. -
Copy
templates/pi-providers/gemini.jsonto.orbi/pi-providers.json. Its complete selected entry is: -
Select the exact provider and model in
orbi.toml:Theapi,baseUrl, model ID, and$GOOGLE_API_KEYreference are part of the validated template. Keep Gemini’sthinkingLevelMapexactly as{"off": null}unless the installed Pi/Gemini contract is re-verified; mapping every thinking level tonullcan cause an upstream400.
Free-tier limits and observed behavior
As checked on 2026-09-04, AI Studio’s Gemini API free tier is rate-limited by RPM, RPD, and TPM. The official rate-limit page is dynamic, so this guide does not copy a changing promotional number. The real daily RPD/TPD ceiling for this account was not measured; treat it as not tested, not as unlimited. A local setup using providergoogle and model gemini-3.8-flash started a real Pi request in about 15 seconds. After a burst, the upstream returned HTTP 429 with You exceeded your current quota; after roughly 50 minutes it returned HTTP 200 again. This dated observation indicates transient rate limiting, not proof that the key was invalid or that the daily allowance was exhausted. It is one account’s evidence, not a quota guarantee.
Orbi does not silently retry or switch providers mid-session. Preserve the failed run evidence, wait for the transient limit to recover, or manually select another configured provider for the next run:
pi --print check. Switching is manual; the automatic per-provider rotation tracked in #313 is not current behavior.
z.ai GLM: experience/free quota
Use this path when you have a z.ai account with an experience or free allowance. z.ai documents an OpenAI-compatible API; Orbi’s template uses the direct endpointhttps://api.z.ai/api/paas/v4 and Pi’s openai-completions API. See z.ai’s API quick start and API-key management for the current account and key-creation flow. The links and UI may change; do not paste the key into a repository, Issue, PR, or journal.
-
Create an API key in the z.ai console, then keep it in the local, gitignored environment file:
The systemd service loads this file through
EnvironmentFile. A manual tick does not: export it first withset -a; . .orbi/env; set +a, then run the command in Getting started. -
Copy
templates/pi-providers/z-ai.jsonto.orbi/pi-providers.json, or copy its provider entry. Select the exact IDs:The completemodelsentry currently is:reasoningis an optional Pi model-catalog field indicating reasoning support.thinkingLevelMapmaps Pi thinking levels to provider-specific values. The committed z.ai template intentionally omits both: this document does not assert a provider-specific reasoning or thinking-level mapping without verified Pi/z.ai contract evidence. Do not copy Gemini’s{"off": null}mapping to z.ai. -
Validate the selected entry before dispatching work. The Runner’s
_load_pi_providerscheck requires the provider, exact model ID, endpoint/API, and a non-emptyZAI_API_KEY; it does not test or promise quota availability.
What is known about the free allowance
- Verified 2026-09-04: a real Orbi delivery using
glm-5.3-flashcompleted the task from Issue #303 through commitb81f77aand PR #304. This proves one successful run, not a quota guarantee. - z.ai does not statically publish a universal experience/free upper limit in the material used for this guide. Exact allowance, reset time, concurrency and model availability depend on the account and current z.ai policy; not measured here.
- No controlled measurement of exhaustion or rate-limit response is available for this guide; rate-limit behavior: not tested. Treat upstream HTTP authentication/rate-limit errors as the source of truth and avoid retry loops or invented numbers.
Switch when the allowance is exhausted
There is no automatic fallback. Keep the sameorbi.toml selector fields, but change pi_provider and pi_model to match another provider from the catalog; replace the provider file/key, then validate again. For example, switch to the existing OpenRouter template and its selected model:
openrouter.json, set OPENROUTER_API_KEY in .orbi/env, and run one real pi --print check before dispatching. OpenRouter’s z-ai/glm-5.2:free listing is a separate provider route; its availability and quota are not tested or promised here.
Cloudflare Workers AI
Cloudflare’s OpenAI-compatible endpoint is account-scoped. Copycloudflare-workers-ai.json, replace REPLACE_WITH_ACCOUNT_ID in baseUrl with the Cloudflare account ID, and create an API token with both the Workers AI - Read and Workers AI - Edit permissions (the permissions required by Cloudflare’s REST API guide). Keep the token in .orbi/env:
orbi.toml:
Measure a real Orbi task
Record the Workers AI account’s Neurons usage immediately before dispatching one Issue and immediately after the PR is opened (same UTC day). The measured task consumption isafter - before; retain the dashboard/API timestamps, model, Issue and PR URL, but never retain the token. Orbi’s journal proves the selected provider/model, not Neurons usage. This repository has not run a Cloudflare-account-backed Orbi task; the request and Neurons consumption are not tested and must not be inferred.
Hosted versus local Qwen
Workers AI is hosted: Cloudflare provides inference and the account’s Neurons allocation, so it is convenient for a machine without a capable GPU but depends on network access, account quota and Cloudflare model availability.local-qwen is self-hosted: it avoids provider quota and sends requests to a local OpenAI-compatible server, but the operator supplies the hardware, model runtime and electricity. Use Cloudflare for lightweight hosted execution; use local Qwen when data locality and predictable local availability matter.
Local providers
A local OpenAI-compatible server still needs a non-emptyapiKey field to satisfy the provider shape; the local template uses the non-secret dummy value local. Its model id must match the server’s advertised id (for llama.cpp, set it with --alias).
Codex OAuth: use a ChatGPT/Codex subscription
This path uses Pi’s nativeopenai-codex provider and OAuth credentials. It does not use OPENAI_API_KEY and it does not need a second pi_providers JSON file. It is subscription/Codex quota, not OpenAI API billing.
First login: do this in order
-
Start an interactive Pi session with
pi. -
At the Pi prompt, run
/login codex. - Complete the Codex OAuth authorization in the browser.
-
Return to Pi and verify the login with the command supported by the current Pi CLI:
A successful check reports
"status":"ready"and"authType":"oauth". This command refreshes expired OAuth credentials by default; do not use--credentialsin a shared terminal or transcript. - Only after the check succeeds, configure Orbi and run a real Issue.
Minimal Orbi configuration
Deletepi_providers if it exists; leave it unset. Do not copy or create an openai-codex provider entry. Pi supplies the catalog from its own models.json, and Orbi’s per-run agent directory reuses Pi’s native auth.
openai-codex-responses at https://chatgpt.com/backend-api, with reasoning enabled, text/image input, a 1,000,000-token context window, and a 128,000-token output limit. Its catalog thinking map supports minimal → low, xhigh → xhigh, and max → max; leave pi_thinking unset for the default, or set one of those verified levels. These are Pi request limits, not a promise about subscription quota.
Quota and billing boundary
The OAuth credential consumes the user’s Codex/ChatGPT subscription allowance. It is separate from an OpenAI API key, API organization billing, and anyOPENAI_API_KEY balance. Pi’s catalog cost fields are routing metadata, not a bill or quota counter. Allowance, reset time, rate limits, model availability, and error messages depend on the account plan and can change. The 2026-09-05 real-run evidence was from one local account; the account plan and its exact allowance were not recorded, so this guide makes no universal quota claim. On exhaustion or throttling, expect an upstream auth/rate-limit failure in the Pi session and consult the account’s current Codex UI/help; do not infer remaining quota from the catalog.
Real Issue evidence to retain
Run the first Issue in the user’s own repository, then retain the non-secret evidence. A successful run should show all of these:Switch providers when quota or auth fails
Remove or replace only the selectors. For a provider from an Orbi template, add its file back because the fallback is no longer Pi-native:/login codex first; switching providers does not repair an expired Codex session.
Groq Free Plan
Copygroq.json as .orbi/pi-providers.json, then set the selectors and key reference:
api: "openai-completions") and $GROQ_API_KEY; put the key in the gitignored .orbi/env, never in the JSON or a commit.
According to Groq’s rate-limit table, the Free Plan row for groq/compound is 30 RPM / 250 RPD / 70K TPM (checked 2026-09-04). These are account limits, not an Orbi guarantee; check the official table again before relying on them. The model catalog lists a 131,072-token context window and 8,192-token maximum completion for this model. The low TPM makes short, bounded coding Issues and small fixes a better fit than long-context repository analysis.
A quota hit is returned upstream as HTTP 429; Orbi does not silently retry or switch provider mid-session. Treat the run as failed, preserve the Issue/worktree evidence, and manually select another configured provider for the next run. The planned per-provider budget and automatic run-boundary rotation is tracked in #313; it is not yet a promise of current behavior. Real Groq requests, usage measurements, and 429 responses are not tested in this guide; do not claim a successful Groq Issue run without recording redacted evidence.
See Getting started for the existing OpenAI-compatible setup and Issue #305 for the provider article series.