Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

- Register via pi's `refreshModels` callback instead of a factory-time env-only fetch, so the live `/v1/model/info` catalog is fetched **with the authenticated key** — including the `/login`-stored key that pi passes as the effective credential. Previously the provider only fetched live when `TENSORX_API_KEY` was set, so `/login`-authenticated users were stuck with the bundled snapshot, which had gone stale: TensorX retired `deepseek-v4-flash` (renamed to `deepseek-v4-flash-0731`) and dropped several models, so pi requested a retired id and the router returned 403 `permission_error`. The snapshot now only serves as the initial/offline catalog and is regenerated from `GET /v1/model/info`.
- Raise the minimum pi version: `refreshModels` requires `@earendil-works/pi-coding-agent >= 0.81.0` (was `*`). Dependencies updated accordingly.

## 1.0.0 - 2026-06-28

Initial release.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export TENSORX_API_KEY=your-key-here

TensorX uses static API keys, so it appears under API keys in `/login`, not under subscriptions.

Note: the live catalog endpoint requires a key, and pi does not hand the `/login`-stored key to extensions. So the up-to-date catalog only loads when `TENSORX_API_KEY` is set in your environment. Without it, the extension registers a bundled snapshot of the catalog — enough to log in via `/login` and use the models. Set `TENSORX_API_KEY` if you want the current catalog instead of the snapshot.
Note: the live catalog is fetched by the registered `refreshModels` callback using the API key pi resolves — the `/login`-stored key or `TENSORX_API_KEY`. A bundled snapshot is used only as the initial/offline catalog (before a key is stored, so the provider still appears under `/login` → API Keys) and as a fallback if the fetch fails.

## Use

Expand All @@ -56,7 +56,7 @@ In interactive mode, `/tensorx-models` lists the TensorX models registered by th

## How it works

On startup, the extension fetches `GET https://api.tensorx.ai/v1/model/info`, keeps models that report `supports_function_calling`, and registers them with `pi.registerProvider()` using pi's `openai-completions` API adapter.
On startup the extension registers the tool-capable TensorX catalog with `pi.registerProvider()` using pi's `openai-completions` API adapter. A `refreshModels` callback fetches `GET https://api.tensorx.ai/v1/model/info` using the **effective API key that pi passes in** — the `/login`-stored key or `TENSORX_API_KEY` — so `/login`-authenticated users always get the current catalog, no manual snapshot update needed.

Model metadata comes from each entry's `model_info`:

Expand All @@ -68,7 +68,7 @@ Model metadata comes from each entry's `model_info`:

Duplicate model IDs in the catalog are de-duplicated, keeping the first.

If `TENSORX_API_KEY` is not in the environment, the extension can't reach the catalog endpoint, so it registers a bundled snapshot of the catalog instead. The snapshot is what lets TensorX appear under `/login` → API Keys: pi only lists providers that have registered models. Inference needs either a saved API key from `/login` or `TENSORX_API_KEY`.
A bundled snapshot serves as the initial/offline catalog only — so TensorX still appears under `/login` → API Keys before a key is stored (pi only lists providers that have models) — and as a fallback if the live fetch fails. Once pi has a credential for the provider, `refreshModels` replaces the snapshot with the live catalog. Requires pi `>= 0.81.0`.

## Development

Expand Down
Loading