feat: add first-class Cheaper Inference provider template - #1364
akramcodez merged 4 commits into
Conversation
The wizard template fills in the base URL for the gateway so only an API key and a model are needed, and the two tests are the pair the OrcaRouter template carries: the built config and the default provider name and model.
Minor bump, as every other provider-template addition carries.
A provider page in the shape of the other gateway pages, plus its line in the provider index.
nc-review: comments — 2 nits@aiapienthusiast — a few things worth a look, none blocking. Adds Cheaper Inference as a first-class provider template by appending a single ⚪ nit ·
⚪ nit · The two new tests assert behaviour that the surrounding 🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with |
Review nit: 19 was already used by orcarouter.md, groq.md and together.md. 26 is unused, so the page slots in after the existing entries instead of tying with three others.
|
Both nits looked at.
On the tests: agreed that they mostly exercise |
|
Thanks for the PR @aiapienthusiast |
Description
Adds Cheaper Inference (
https://api.cheaperinference.com/v1) as a first-class provider template in the setup wizard. It also adds a documentation page.Cheaper Inference is an OpenAI-compatible gateway. One endpoint and one API key reach models from several upstream providers. It speaks the OpenAI Chat Completions API, so it needs no new SDK path. It flows through the existing generic
openai-compatibleprovider. This change is therefore a wizard template, a docs page and tests.The change follows #874 (
feat: add first-class OrcaRouter provider template), which added OrcaRouter in the same way.Files changed
source/wizards/templates/provider-templates.tsapiKeyTemplateentry: idcheaper-inference, base URL pre-filled, default modelclaude-sonnet-5.source/wizards/templates/provider-templates.spec.tsdocs/configuration/providers/cheaper-inference.mddocs/configuration/providers/index.md.changeset/add-cheaper-inference-provider.mdNot included
#874 also added
source/ai-sdk-client/providers/orcarouter.tsand aprovider-factory.tsbranch that attachesHTTP-RefererandX-Titleapp-attribution headers.Those headers are the OpenRouter convention. No documentation shows that Cheaper Inference reads them, so this PR does not assert that it does. If it does, the predicate file and the factory branch are a small follow-up.
Type of Change
Changeset
pnpm changeset) describing this change for the changelogDocs-only or internal chores need no changeset (or run
pnpm changeset --emptyto note that intentionally).Testing
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)pnpm test:alldid not run to completion. These checks ran onb2ef8f01d507b88c6b67fb83a52505ef39bb87f5:pnpm test:types— passpnpm test:types:vscode— passpnpm test:lint— pass, cleanpnpm test:knip— pass, hints onlypnpm test:ava source/wizards/templates/provider-templates.spec.ts— 44 passed, with the two new casespnpm test:format— one pre-existing error insource/tools/file-ops/write-file.tsx(import ordering). It is present on the base commit. No file in this PR is flagged.pnpm test:ava(whole suite) — did not finish. The sandbox filesystem filled up and the run was killed. Every test it reported passed, and it printed no failure, but there is no exit code. This is therefore not a pass.pnpm test:auditandpnpm test:security— not runThe two new tests cover template construction, which has no error path. The third box stays unticked.
Manual Testing
Nothing ran through nanocoder itself, so no box is ticked.
A direct check with a real key confirmed the endpoint.
GET /v1/modelsreturns the catalogue. A plain chat completion and an SSE stream both answer. The base URL and the key header in this template are the working ones.A reviewer should confirm the path through nanocoder: the wizard writes the config it should, and a chat completion succeeds from the app.
Checklist
No logging was added. The change is a declarative template entry and docs, with no new runtime code path to log from.